Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fix/fix-endpoint-links…
Browse files Browse the repository at this point in the history
…-creation
  • Loading branch information
TheoPascoli committed Sep 25, 2024
2 parents d520b83 + 1c27c6e commit 40c42d0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions antarest/study/business/general_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,32 @@ class GeneralFormFields(FormFieldsBaseModel):
geographic_trimming: StrictBool
thematic_trimming: StrictBool

model_config = {
"json_schema_extra": {
"examples": [
{
"mode": "Economy",
"first_day": 1,
"last_day": 365,
"horizon": "2020",
"first_month": "january",
"first_week_day": "Monday",
"first_january": "Monday",
"leap_year": True,
"nb_years": 5,
"building_mode": "Automatic",
"selection_mode": True,
"year_by_year": True,
"simulation_synthesis": True,
"mc_scenario": True,
"filtering": True,
"geographic_trimming": True,
"thematic_trimming": True,
}
]
}
}

@model_validator(mode="before")
def day_fields_validation(cls, values: Union[Dict[str, Any], ValidationInfo]) -> Dict[str, Any]:
new_values = values if isinstance(values, dict) else values.data
Expand Down

0 comments on commit 40c42d0

Please sign in to comment.