Closed xaviernogueira closed 1 year ago
Merging #51 (c38c6b6) into main (5772cf2) will increase coverage by
1.54%
. Report is 1 commits behind head on main. The diff coverage is80.00%
.
@@ Coverage Diff @@
## main #51 +/- ##
==========================================
+ Coverage 36.18% 37.72% +1.54%
==========================================
Files 33 33
Lines 1133 1153 +20
==========================================
+ Hits 410 435 +25
+ Misses 723 718 -5
Files | Coverage Δ | |
---|---|---|
src/clearwater_modules/tsm/processes.py | 71.42% <100.00%> (+0.37%) |
:arrow_up: |
src/clearwater_modules/utils.py | 58.82% <0.00%> (ø) |
|
src/clearwater_modules/base.py | 87.29% <85.71%> (+4.57%) |
:arrow_up: |
@xaviernogueira, thanks for moving this forward! I only did a quick scan, but it generally looks good!
Closes #49
Changes:
ri_function
using two-step logic following a misunderstanding in my last PR @aufdenkampeupdateable_static_variables
that allow them to be updated between timesteps (essentially gives them a time dimension). See example belowpyright
(a handy command line tool) to fix a few unaligned type hints@sjordan29 @jrutyna You can now proceed as discussed.
For example, imagine a model with a 1 state variable called "state_variable_1" and two static variables "static_1" and "static_2". Despite the static variables not being changed by the model itself (hence why they are called static), one might want to alter "static_1" between running timesteps via another model like
Clearwater-Riverine
. To do so you simply init the model as shown below:then when running a timestep you can use the
update_state_values
argument, which takes a dictionary with variable names as keys, andxr.DataArrays
as values. For now, this requires data arrays, but I am going to open a new issue to support just passing in a number, and having that number broadcast to the shape of ourxr.Dataset
, see #52 .