Skip to content

Commit

Permalink
Remove update_timestep in Ribasim Python
Browse files Browse the repository at this point in the history
Fixes #1093
  • Loading branch information
Hofer-Julian committed Feb 8, 2024
1 parent 6093e14 commit ed9ae92
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions python/ribasim/ribasim/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
DirectoryPath,
Field,
field_serializer,
field_validator,
model_serializer,
model_validator,
)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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 (
Expand All @@ -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)
Expand Down

0 comments on commit ed9ae92

Please sign in to comment.