Deltares / hydromt

HydroMT: Automated and reproducible model building and analysis
https://deltares.github.io/hydromt/
MIT License
67 stars 27 forks source link

Validated (pydantic) models should be used in the code base. #639

Open savente93 opened 10 months ago

savente93 commented 10 months ago

Kind of request

Changing existing functionality

Enhancement Description

Currently the validated pydantic models are only used in the hydromt check command, but it would be good to use them throughout the code base so we can always be sure we are using valid objects.

Use case

This is a nice feature for both users and developers as things outside of the hydromt check command can also be validated.

Additional Context

No response

Jaapel commented 3 months ago

With the introduction of pydantic in the DataAdapter, Driver and MetadataResolver classes, the DataCatalog is missing on the data side. What about the model side @savente93?

savente93 commented 3 months ago

Not sure it's feasible or even that useful to use pydantic on the model side, since I think a lot of the dynamic attributes pydantic will struggle with. We would look into it but we also do a lot of custom validation there already so I'm not sure it's worth the effort tbh. Maybe as a rainy day feature