Skip to content

Commit

Permalink
add the database name to the config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaelicke committed Jan 29, 2024
1 parent 3b04c53 commit 266386f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ class NetCDFBackends(str, Enum):


class Params(BaseModel):
# mandatory inputs are the dataset ids and the reference area
dataset_ids: List[int]
reference_area: dict = Field(repr=False)

# optional parameters to configure the processing
start_date: datetime = None
end_date: datetime = None
keep_intermediate: bool = False
integration: Integrations = Integrations.ALL

# optional parameter to configure output
keep_intermediate: bool = False
database_name: str = 'dataset.db'

# stuff that we do not change in the tool
base_path: str = '/out'
netcdf_backend: NetCDFBackends = NetCDFBackends.XARRAY
Expand All @@ -61,12 +66,16 @@ def dataset_path(self) -> Path:
p.mkdir(parents=True, exist_ok=True)

return p


@property
def database_path(self) -> Path:
return Path(self.base_path) / self.database_name

@property
def reference_area_df(self) -> gpd.GeoDataFrame:
return gpd.GeoDataFrame.from_features([self.reference_area])


# manage a single instance to this class
__SINGLETON: Params = None
def load_params(**kwargs) -> Params:
Expand Down

0 comments on commit 266386f

Please sign in to comment.