-
Notifications
You must be signed in to change notification settings - Fork 63
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
Pass catchment hydrofabric attributes to BMI models as model_params
#554
Comments
A valid special case occurs to me... the |
Some Notes:
To accomplish what this issue requires, I think we'd want to move the properties from the As for representing which keys must be taken, maybe we have a designated object scheme within "model_params": {
"sloth_ice_fraction_schaake(1,double,m,node)": 0.0,
"sloth_ice_fraction_xinan(1,double,1,node)": 0.0,
"sloth_smp(1,double,1,node)": 0.0,
"areasqkm": {
"from": "hydrofabric",
"as": "area_sqkm"
}
} This also potentially allows for alternative sources to be specified and joined on startup (i.e. sidecar files, with |
Some more notes: After some initial investigation/work, I think we can conceptualize these additional model parameters as dynamic parameters (like the However, the responsibility of this gets very muddled in the NGen executable code, since we only have access to a
|
Especially wIth GeoPKG hydrofabric support in #522, add the ability to pass attributes from the features to the BMI model stack. The foremost use-case is to pass
area_sqkm
to a lumped module that needs it to convert rainfall depth to volume, but also we may store other model-specific or general attributes/parameters in the hydrofabric where appropriate.These parameters/values should be passed only once, before the input variables (gotten from
get_input_var_names
) are passed--at about the same time as anymodel_params
from the realization config are passed, and using a similar mechanism. A model accepting such a parameter should respond properly to metadata functions for that parameter such asget_var_type
and this information should determine how the value is passed to the module.Preferably, some mechanism should be designed such that the value is only attempted to be set on a BMI model that needs it--possibly using the existing
model_params
feature with an object value (instead of a numeric value) that indicates that the source of the parameter is the hydrofabric. Some way of mapping the hydrofabric attribute name to a model parameter name--which may be different--is also desirable, e.g. leveragevariables_names_map
or allow aliasing information in a JSON key withinmodel_params
.This feature is focused on lumped catchment models defined in the hydrofabric. Future similar use-cases to keep in mind:
Current behavior
No information from the hydrofabric is made available to BMI models
Expected behavior
A BMI model (including nested models in a multi-BMI stack) should be able to have attributes from the hydrofabric passed to it.
Steps to replicate behavior (include URLs)
Screenshots
The text was updated successfully, but these errors were encountered: