49 create convert static to state function #51
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 .