respec / HSPsquared

Hydrologic Simulation Program Python (HSPsquared)
GNU Affero General Public License v3.0
43 stars 17 forks source link

mainDoE() KeyError #95

Open gcoyle83 opened 2 years ago

gcoyle83 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

Bob Heaphy implemented this feature.

JASON LOVE, P.E. President

605.394.6512 office // 605.484.2380 cell


From: Paul Duda @.> Sent: Thursday, June 30, 2022 9:00:43 AM To: respec/HSPsquared @.> Cc: Subscribed @.***> Subject: Re: [respec/HSPsquared] mainDoE() KeyError (Issue #95)

@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 ZjQcmQRYFpfptBannerStart This Message Is From an External Sender This message came from outside your organization. https://us-phishalarm-ewt.proofpoint.com/EWT/v1/GzRj30k!73GInFyXIfKBx4cpQr6ohHMN_FqimZLDEac2cIwJkGcPd0ERFfVmqergspE_QWqGFrT2oq_E25mjGSwwSBWFIJHo0IZ2XouxQeY2sw$ Report Suspicious

ZjQcmQRYFpfptBannerEnd

@gcoyle83https://urldefense.com/v3/__https://github.com/gcoyle83__;!!GzRj30k!SPyGfqnSiobloSTc_mAQkrKQauK38x27qphDhu0tLLPr3phK5x-_-9-inBVpW73LY8C22TcdBQHRQF4p_OjbEGJXDA$ , 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?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/respec/HSPsquared/issues/95*issuecomment-1171330457__;Iw!!GzRj30k!SPyGfqnSiobloSTc_mAQkrKQauK38x27qphDhu0tLLPr3phK5x-_-9-inBVpW73LY8C22TcdBQHRQF4p_OiyeykG4g$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AHDAVXXBIEWT4LYSIY4EVG3VRWZBXANCNFSM52HYUFGQ__;!!GzRj30k!SPyGfqnSiobloSTc_mAQkrKQauK38x27qphDhu0tLLPr3phK5x-_-9-inBVpW73LY8C22TcdBQHRQF4p_OjqAuXTWw$. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Confidentiality Notice: This E-mail and any attachments is covered by the Electronic Communications Privacy Act, 18 U.S.C. & 2510-2524, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, and permanently delete the original and destroy any copy, including printed copies of this email and any attachments thereto.