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

mainDoE() KeyError #95

Open
gcoyle83 opened this issue Jun 30, 2022 · 5 comments
Open

mainDoE() KeyError #95

gcoyle83 opened this issue Jun 30, 2022 · 5 comments

Comments

@gcoyle83
Copy link

I am unable to get the HSP2.mainDoE function working, e.g.:

HSP2.mainDoE(
    output_hdf5_path,
    doe,
    'Sensitivity_LZSN_INFILT'
)

Leads to a KeyError:

KeyError                                  Traceback (most recent call last)
Input In [34], in <cell line: 1>()
----> 1 HSP2.mainDoE(
      2     output_hdf5_path,
      3     doe,
      4     'Sensitivity_LZSN_INFILT'
      5 )

File ~\Anaconda3\envs\hsp2_py38\lib\site-packages\HSP2\mainDoE.py:134, in main(hdfname, doe, doename, saveall)
    131         ui[table].update(ruci[operation, activity, segment][table])
    133 ############ calls activity function like snow() ##############
--> 134 errors, errmessages = function(store, siminfo, ui, ts)
    135 ###############################################################
    137 for errorcnt, errormsg in zip(errors, errmessages):

File ~\Anaconda3\envs\hsp2_py38\lib\site-packages\HSP2\SNOW.py:36, in snow(io_manager, siminfo, uci, ts)
     28 ''' high level driver for SNOW module
     29 CALL: snow(store, general, ui, ts)
     30    store is the Pandas/PyTable open store
     31    siminfo is a dictionary with simulation level infor (OP_SEQUENCE for example)
     32    ui is a dictionary with segment specific HSPF UCI like data
     33    ts is a dictionary with segment specific timeseries'''
     35 steps   = siminfo['steps']                # number of simulation timesteps
---> 36 UUNITS  = siminfo['units']
     38 ts['SVP'] = SVP
     39 ts['SEASONS'] = monthval(siminfo, SEASONS)

KeyError: 'units'
@gcoyle83
Copy link
Author

From what I can tell the siminfo dict is created empty and is only assigned start and stop keys before being called again and asked to return the units key, which doesn't exist...

@gcoyle83 gcoyle83 changed the title mainDoE() bugs and/or examples needed mainDoE() KeyError Jun 30, 2022
@gcoyle83
Copy link
Author

After looking at this a bit further and trying to trace and fix the errors on my local copy, I'm seeing that in addition to this original KeyError there are many, many more of these distributed throughout the calls to various modules from mainDoE. This seems to be related to using the store as opposed to the iomanager used in the main function. Is support for the mainDoE expected to continue?

@PaulDudaRESPEC
Copy link
Member

@gcoyle83 , it looks like you've correctly identified the issue -- mainDoE needs some upgrades to be compatible with the current iomanager. I'm not sure of the best path forward here. Were you involved in the original development of the mainDoE function?

@gcoyle83
Copy link
Author

@PaulDudaRESPEC Thanks for the reply. No, not involved - I am just getting familiar with the repo to see if it is useful for my purposes. For now, I'll just avoid using the function and rely on main for conducting new runs. I will keep an eye on this, though, as it seems a very desirable feature.

@JasonLoveRespec
Copy link
Contributor

JasonLoveRespec commented Jun 30, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants