From deba2dfbb6e4c1ecbc3d18f723020fe0c67d8264 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Mon, 2 Oct 2023 14:02:19 +0200 Subject: [PATCH] The forcing directory should be required (#382) --- src/ewatercycle/base/forcing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ewatercycle/base/forcing.py b/src/ewatercycle/base/forcing.py index e53afcbf..34900ae0 100644 --- a/src/ewatercycle/base/forcing.py +++ b/src/ewatercycle/base/forcing.py @@ -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 )