Validating the model during creation, and before it goes to MODFLOW #52
deltamarnix
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MODFLOW validates models before running them, but we foresee that we can aid the user in creating models by validating the input that the user provides. We can define multiple moments where validation can be useful:
Since we were thinking of using
attrs
as our data class package, we can leverage the validation functionality that is built into the package. But it is likely that not all checks can be built within this structure.attrs
states that initializers should remain simple. And therefore I'm not sure if we should validate a whole data grid with attrs the moment that we read it. Especially since we want to do lazy loading as much as possible with packages like Dask or XArray.I do think that validation of more simple parameters can already help a lot, especially on input types and perhaps some extra range checks.
It would also be possible to disable the checks system while creating and setting attributes, and only check input validation via
attr.validate()
manually. We could give the user a simple handle to let them validate their modelmodel.validate()
.There are some built-in validators that help set up simple checks, also for lists and dicts.
Beta Was this translation helpful? Give feedback.
All reactions