-
Notifications
You must be signed in to change notification settings - Fork 9
When to validate variable values? #32
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
Comments
Ideally, the earlier input values are validated the better. However, validating input values when creating the input dataset (using So the best place, common to all cases, is to validate just before setting inputs into the simulation data store. All kinds of validation (even for model inputs) should be optional, as it may impact performance. Control on validation might be possible by introducing a parameter to
The latter may be costly, but it is useful for debugging.
This is not possible, as validation must be performed at the level of a process class (e.g., when validation involves checking the values of multiple variables declared in the process class). |
Actually, using |
Validation should be done on each value given as a model input, either when creating the input
xarray.Dataset
or when we add the value in the key-value store (see #31). The second might be better if we eventually want to use the modelling framework with another interface thanxarray.Dataset
.For performance issues, it may be wise not to systematically validate the value of a variable when it is set/updated by a process during a simulation. Validation may be needed in some cases, though (e.g., to ensure that values computed in a process does not fall outside of an acceptable range). This would require a convenient way to call the validators of a (possibly foreign) variable from within a process.
The text was updated successfully, but these errors were encountered: