Skip to content

Commit

Permalink
The forcing directory should be required (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Oct 2, 2023
1 parent 9cc544d commit deba2df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ewatercycle/base/forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ class DefaultForcing(BaseModel):
# TODO make sure start_time < end_time
start_time: str
end_time: str
directory: Optional[Annotated[Path, AfterValidator(_to_absolute_path)]] = None
directory: Annotated[Path, AfterValidator(_to_absolute_path)]
shape: Optional[Path] = None

@model_validator(mode="after")
def _absolute_shape(self):
if self.shape is not None and self.directory is not None:
if self.shape is not None:
self.shape = to_absolute_path(
self.shape, parent=self.directory, must_be_in_parent=False
)
Expand Down

0 comments on commit deba2df

Please sign in to comment.