From 6c6969f4d5e7624ea6796ae2d16ec44c2a4c0d62 Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:44:20 +0100 Subject: [PATCH] Remove `update_timestep` in Ribasim Python (#1099) Fixes #1093 --- python/ribasim/ribasim/model.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/python/ribasim/ribasim/model.py b/python/ribasim/ribasim/model.py index 05057a58c..6cc5af9db 100644 --- a/python/ribasim/ribasim/model.py +++ b/python/ribasim/ribasim/model.py @@ -12,7 +12,6 @@ DirectoryPath, Field, field_serializer, - field_validator, model_serializer, model_validator, ) @@ -111,8 +110,6 @@ class Model(FileModel): endtime : datetime.datetime End time of the simulation. - update_timestep: datetime.timedelta = timedelta(seconds=86400) - The output time step of the simulation in seconds (default of 1 day) input_dir: Path = Path(".") The directory of the input files. results_dir: Path = Path("results") @@ -187,13 +184,6 @@ class Model(FileModel): pid_control: PidControl = Field(default_factory=PidControl) user: User = Field(default_factory=User) - @field_validator("update_timestep") - @classmethod - def timestep_in_seconds(cls, v: Any) -> datetime.timedelta: - if not isinstance(v, datetime.timedelta): - v = datetime.timedelta(seconds=v) - return v - @model_validator(mode="after") def set_node_parent(self) -> "Model": for ( @@ -204,10 +194,6 @@ def set_node_parent(self) -> "Model": setattr(v, "_parent_field", k) return self - @field_serializer("update_timestep") - def serialize_dt(self, td: datetime.timedelta) -> int: - return int(td.total_seconds()) - @field_serializer("input_dir", "results_dir") def serialize_path(self, path: Path) -> str: return str(path)