-
Notifications
You must be signed in to change notification settings - Fork 8
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
use pydantic to define data structure #299
Comments
I've created two new issues related to my last comment here:
|
Just to follow up on this - I've completed the framework of The remaining task is to address the missing columns/variables in both the YAML file and Pydantic class definitions. To continue with this work, run |
After making sure that my branch was up to date with @sunt05, I worked on a new @model_validator (validate_rsl_zd_range) in class BuildingProperties and pushed it in dayantur/adding_pydantic_rules. The new @model_validator is related to RSL scheme as described in #302 by @vitorlavor and represents a first example of how we can avoid some dangerous regimes for the model run by controlling the inputs upfront. This is the warning we get if we do not avoid the regime: I've added this new @model_validator to the list at #300. |
@sunt05, I've tried to run def_config_suews.py today, and I got a (weird to me) kernel error when entering storageheatmethod: 1 in YAML file config-suews.yml and trying a run with sp.run_supy(df_forcing, df_state_test):
The error is not present when trying sp.run_supy(df_forcing, df_state):
I tried changing storageheatmethod: 2 and supy can run with both df_state_test and df_state (and give outputs). Any idea of what can this be related to? |
No worries—that's expected and can be reproduced here. The YAML input was somewhat randomly created, so such errors are anticipated. Let's continue adding rules and hope the input YAML errors can be properly detected. |
Thanks @sunt05! I also tried to plot outputs from df_state_test, and this is what I got (again, storageheatmethod = 2): ![]() I suppose this might be again related to the YAML being randomly populated. |
#301 has been separated from this issue as an ongoing task to conclude this stage. |
Use a pydantic-based class to define all data structures, ensuring consistency and improving sustainability for maintenance.
The text was updated successfully, but these errors were encountered: