Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZRW_WestIndian Error 2 #8

Open
steveskrip opened this issue Apr 25, 2020 · 1 comment
Open

ZRW_WestIndian Error 2 #8

steveskrip opened this issue Apr 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@steveskrip
Copy link
Member

Received following error when attempting to read_UCI using the ZRW_WestIndian .uci file. Still working on a workaround.

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-8-af0364dabdb1> in <module>
      1 from readUCI import read_UCI
----> 2 read_UCI(filepath+'hspf.uci', filepath+'hspf.h5')
~\Documents\GitHub\HSPsquared\HSP2\readUCI.py in read_UCI(uciname, hdfname)
    869             if line[0:7] == 'FTABLES':      ftables(info, getlines(f))
    870             if line[0:3] == 'EXT':              ext(info, getlines(f))
--> 871             if line[0:6] == 'PERLND':     operation(info, getlines(f),'PERLND')
    872             if line[0:6] == 'IMPLND':     operation(info, getlines(f),'IMPLND')
    873             if line[0:6] == 'RCHRES':     operation(info, getlines(f),'RCHRES')
~\Documents\GitHub\HSPsquared\HSP2\readUCI.py in operation(info, llines, op)
   1132                 df = concat(x)
   1133                 df.columns = Months
-> 1134                 df = fix_df(df, op, save, ddfaults, valid)
   1135                 df.to_hdf(store, f'{op}/{save}/MONTHLY/{name}', data_columns=True)
   1136         elif cat == 'EXTENDED':
~\Documents\GitHub\HSPsquared\HSP2\readUCI.py in fix_df(df, op, save, ddfaults, valid, sortflag)
    645     if df.isna().any().any():                      # replace NaNs with defaults
    646         for col in df.columns:
--> 647             df[col] = df[col].fillna(ddfaults[op, save, col])
    648     if sortflag:
    649         df = df.sort_index(axis=1)
KeyError: ('PERLND', 'PWATER', 'JAN')
@steveskrip steveskrip added the bug Something isn't working label Apr 25, 2020
@aufdenkampe
Copy link
Member

@steveskrip, has this issue been resolved by fixes since April (such as connected to respec#40)?

If so, please close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants