Skip to content

Commit

Permalink
Merge pull request #222 from bowguy/master
Browse files Browse the repository at this point in the history
Change depreciated delim_whitespace
  • Loading branch information
aerispaha authored Aug 19, 2024
2 parents a90410a + 4120f25 commit 2d1ab06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions swmmio/utils/dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def dataframe_from_rpt(rpt_path, section, element_id=None):

# extract the string and read into a dataframe
s = extract_section_of_file(rpt_path, start_strings, end_strings)
df = pd.read_csv(StringIO(s), header=None, delim_whitespace=True, skiprows=[0],
df = pd.read_csv(StringIO(s), header=None, sep='\s+', skiprows=[0],
index_col=0, names=cols)

# confirm index name is string
Expand Down Expand Up @@ -164,7 +164,7 @@ def dataframe_from_inp(inp_path, section, additional_cols=None, quote_replace='
return pd.read_csv(StringIO(s), delim_whitespace=False)
else:
try:
df = pd.read_csv(StringIO(s), header=None, delim_whitespace=True,
df = pd.read_csv(StringIO(s), header=None, sep='\s+',
skiprows=[0], index_col=0, names=cols)
except:
raise IndexError(f'failed to parse {section} with cols: {cols}. head:\n{s[:500]}')
Expand Down
2 changes: 1 addition & 1 deletion swmmio/utils/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_inp_sections_details(inp_path, include_brackets=False):
ops_cols = INP_OBJECTS['OPTIONS']['columns']
ops_string = extract_section_of_file(inp_path, '[OPTIONS]', INP_SECTION_TAGS, )
options = pd.read_csv(StringIO(ops_string), header=None,
delim_whitespace=True, skiprows=[0], index_col=0,
sep='\s+', skiprows=[0], index_col=0,
names=ops_cols)

if 'INFILTRATION' in found_sects:
Expand Down

0 comments on commit 2d1ab06

Please sign in to comment.