Skip to content

Commit

Permalink
update(PrmsData): update load_from_file method for more robust parsin…
Browse files Browse the repository at this point in the history
…g of data file
  • Loading branch information
jlarsen-usgs committed Apr 21, 2023
1 parent 7c183a0 commit 11600d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gsflow/prms/prms_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def load_from_file(data_file):
columns.append(val_nm[0] + "_" + str(val))

columns = GsConstant.COLUMN_HEADER + columns
data_pd = pd.read_csv(fid, delim_whitespace=True, names=columns)
data_pd = pd.read_csv(fid, delim_whitespace=True, header=None)
if len(list(data_pd)) > len(columns):
data_pd = data_pd[[i for i in range(len(list(columns)))]]
data_pd.rename(columns={ix: i for ix, i in enumerate(columns)}, inplace=True)

Dates = []
for index, irow in data_pd.iterrows():
dt = datetime.datetime(
Expand Down

0 comments on commit 11600d7

Please sign in to comment.