Skip to content
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

Model input parameter validation features and standards #3

Open
tariqshihadah opened this issue Feb 22, 2024 · 0 comments
Open

Model input parameter validation features and standards #3

tariqshihadah opened this issue Feb 22, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@tariqshihadah
Copy link
Owner

Model parameter input validation will be a critical component of the framework and the development of models using the framework. Past iterations have used homebrewed, purpose-built validation classes which worked OK for basic cases but were not robust and very limited in scope. Instead, I'm initially recommending use of the open-source cerberus package which is vast, well-documented, and easily extensible, making it a strong fit for this project I think. Additionally, validation parameters can easily be serialized to JSON or .py, making it simpler to store and manage validation information outside of the main model files and is consistent with the goals of the framework to be modular and accessible for necessary editing by users with minimal python skills.

Check out the validation module to see how this is currently being implemented. At this time, it is minimal and can only be used to perform success/fail validation of all parameter inputs using the existing cerberus API and is not plugged into all branches. A few goals/hopes/dreams for this issue:

  • Validation failure fallback. It would be great to add a variety of options to respond to validation failures, such as snapping numerical values to the required range, providing a default value, or throwing/documenting a non-fatal warning
  • Automated parameter help documentation. Based on the different types of validation, it would be great to be able to automatically present basic text documentation for set validation specification, exposing rules to users through a help() method on model Container subclasses or similar where validation is set.
@tariqshihadah tariqshihadah added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels Feb 22, 2024
@tariqshihadah tariqshihadah self-assigned this Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant