-
Notifications
You must be signed in to change notification settings - Fork 18
Description
In HydPy, we usually prepare one control parameter file for each model instance, e. g. for each subcatchment. If we want to assign the same parameter value to different model instances, we can use the auxiliary file mechanism. The following example shows how the auxfile keyword delegates the look-up for the actual parameter value to another file:
subcatchment_x.py
parameter_y(auxfile='default_parameters')
default_parameters.py
parameter_y(1.0)
The auxfile argument in file subcatchment_x.py points to the file actually defining the parameter value.
This approach is flexible but not always easy to handle. In big projects, it is hard to find out which parameter instance is taking its value from which auxiliary file.
Maybe we could implement an additional strategy relying on selections. Each auxiliary file should then correspond to the name of one selection, possibly in combination with the relevant model type, e. g.:
selection_a_model_b.py
parameter_y(1.0)
Then, we could use a constant to ensure that each parameter instance searches for the currently relevant selection:
subcatchment_x.py
parameter_y(auxfile=SELECTION)
Additionally, we could allow omitting any definition of a parameter value within a specific control file, as long as its model instance belongs to one of the covered selections.
However, we need to consider that the selection mechanism of HydPy is much more flexible than, for example, the "Pegel-Kontrollbereich" approach of LARSIM, allowing for intersections between different selections. Hence, we would need to put some effort into defining supplemental features that help to prevent erroneous project configurations.