API for state saving and restoring (NGWPC-8996)#85
Merged
idtodd merged 135 commits intodevelopmentfrom Mar 13, 2026
Merged
Conversation
1e36556 to
6817947
Compare
e48e098 to
6817947
Compare
… variables with dimensions (catchment, time)
…i_Module_Formulation
…realization config
ee15910 to
d97e4a7
Compare
…i_Module_Formulation
cmaynard-ngwpc
approved these changes
Mar 12, 2026
cmaynard-ngwpc
left a comment
There was a problem hiding this comment.
Tested running will all modules but Evapotranspiration (PET), since I don't have the capability to test a formulation with that module. We can go ahead with this merge and test PET once it has been added by Mohammed with the ewts updates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds the structure for save stating and compatibility with hindcasting (saving at the end of a run, then loading that state at the beginning of the next).
Save stating is controlled with the realization config JSON using the
state_savingproperty. The optional property is an array of objects with properties related to how and when state is supposed to be saved or loaded:An example for saving state would be
An example of loading that state for the next state would be
Additions
NgenSimulation,Layer, and the BMI formulation classes for controlling saving and loading state.Bmi_Py_Adapter::set_value_uncheckedfunction for sending arbitrarily large data to a python BMI. This is needed to allow sending serialized state data without the BMI interfaces checking that the receiving "variable" is the appropriate size.Removals
Changes
Testing
Notes
Todos
Checklist