-
Notifications
You must be signed in to change notification settings - Fork 0
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
Scoping Code Tasks: #12
Comments
Hey @gcambridge and @jdkleiner -- I just had a breakthrough. Got the hsp2 on deq1 functioning like the one on hsp2. And, here is the output that the model tells me (someone put a little message in):
|
This is most excellent (glad the little message I put in there is functioning as expected!). What test did you run that resulted in that output? I want to be sure I can replicate your result, I've tried running the test10 but not getting the same output |
@rburghol disregard the above comment, the following does indeed work for me.
|
@rburghol SPECL.py has been set up and initial proof of concept testing successful (preforms a simple calculation on an array and returns the modified array to HYDR.py) https://github.com/HARPgroup/HSPsquared/blob/specl/HSP2/SPECL.py |
See here for example of how to view HDF5 data in R: #24 (comment) |
Scoping code goal: create the functions to call and execute a single, test withdrawal
snow()
for example, can be arbitrary Python, Pandas and Numpy code which prepares data to be used by the second level code like_snow_( )
. The second level code and all routines called by it must be compatible with Numba so that the code can be compiled. Any violation of Numba constraints will prohibit the compilation and force the code to run a Python speed."specl()
and_specl_()
specl()
arguments: see pull request test passing the TS and modifying the last step value #23def specl(io_manager, siminfo, ui, ts, step, speclactions)
wherets = ts[step]
,state = ts[step -1]
(more details of this approach in specl(): Proposed function definition for SPEC-ACTIONS #13)ts[step]
since that particular notation throws an error. But, once inside the specl() function we can do things likets['VOL'][step - 1] = 1000.0
and that works nicely, sets back the variable in the calling function (i.e.ts
is passed by reference)OVOL[step -1]
would be used by flowbys, but withdrawals will want to modifyOUTDGT[step]
_specl_()
should take the same parameters asspecl()
??: looks like these do NOT take identical params, since it causes errors with numpy due to numpy not liking all dictionaries (only numerical ones?)specl()
and_specl_()
inside HYDR.py until we determine how to insurehsp2
code files are loaded with the modelif irexit >= 0:
- see: https://github.com/respec/HSPsquared/blob/f9555f2e48cc3409f33c29d3c6504d9bdc0f91fb/HSP2/HYDR.py#L267ts[step - 1]
?ts
dictionary. Example,vol
is the current time-step volume, which is equal tots['VOL'][step]
, which is also settable by reference to the variableVOL[step]
ts
dictionary, but also, should modify the state variables.ts['VOL'][step-1] = XXX
, does this automatically make the variablevol = XXX
? (see below, same question withoutdgt
variable which holds withdrawal information`ts
? See Setting data ints
andui
, pass by reference in python functions #19ts
dict object within_specl_
automatically alters the ts object withinhydr()
demand()
function do? Does it overwrite our OUTDGT work? (see lines 277, 279, 329, 337, etc )O1
,O2
,O3
andRO
see: Handle PS and WD (DIVR) in data harvest to _hydr.csv file HARParchive#541specl
UCI table? (assuming this is where our defs will go), do we add them to theui
/ts
variables that are passed in to each function? See Write a parser for basic SPECL (just setting variables till we decide on our final approach) #24ui
andts
depending on which module/block is being executed, we can makespecl
objects passed in to all perhaps?Notes From Scoping Session 8/26/22:
@rburghol
main.py
is what runs the model: https://github.com/HARPgroup/HSPsquared/blob/master/HSP2/main.pyHYDR
is an activity inside theRCHRES
operationhydr()
function defined in fileHYDR.py
: https://github.com/HARPgroup/HSPsquared/blob/master/HSP2/HYDR.pyfunction(io_manager, siminfo, ui, ts)
HYDR
gets a fifth variableftables
RQUAL
has some other variables passed in as wellui
is a dictionaryui = uci[(operation, activity, segment)]
RCHRES
is an operationHYDR
is the activityts
is a dictionaryts
variables are initialized inHYDR.py
ROVOL
is the flow out variablets
is being modified by the_hydr_
functionts
in there modifiests
ROVOL[step] = rovol / VFACT
we believe actually modifies the value(s) forROVOL
in thets
dictionaryHYDR
iterates the entire timeseriesOVOL
=Qout
VOL
is the volume of water in the reachts
dictionaryrovol = ROVOL
step
is just an array of integers (0 to x or seconds since Unix epoch)The text was updated successfully, but these errors were encountered: