diff --git a/flood_adapt/object_model/interface/benefits.py b/flood_adapt/object_model/interface/benefits.py index 83288c987..411048a47 100644 --- a/flood_adapt/object_model/interface/benefits.py +++ b/flood_adapt/object_model/interface/benefits.py @@ -3,7 +3,7 @@ from typing import Any, Optional, Union import pandas as pd -from pydantic import BaseModel, validator +from pydantic import BaseModel class CurrentSituationModel(BaseModel): @@ -16,7 +16,6 @@ class BenefitModel(BaseModel): name: str description: Optional[str] = "" - lock_count: int = 0 strategy: str event_set: str projection: str @@ -27,13 +26,6 @@ class BenefitModel(BaseModel): implementation_cost: Optional[float] = None annual_maint_cost: Optional[float] = None - @validator("lock_count") - def validate_lock_count(cls, lock_count: int) -> int: - """Validate lock_count""" - if lock_count < 0: - raise ValueError("lock_count must be a positive integer") - return lock_count - class IBenefit(ABC): attrs: BenefitModel diff --git a/flood_adapt/object_model/interface/measures.py b/flood_adapt/object_model/interface/measures.py index f08d7f60f..8f430febf 100644 --- a/flood_adapt/object_model/interface/measures.py +++ b/flood_adapt/object_model/interface/measures.py @@ -51,16 +51,8 @@ class MeasureModel(BaseModel): name: str = Field(..., min_length=1) description: Optional[str] = "" - lock_count: int = 0 type: Union[HazardType, ImpactType] - @validator("lock_count") - def validate_lock_count(cls, lock_count: int) -> int: - """Validate lock_count""" - if lock_count < 0: - raise ValueError("lock_count must be a positive integer") - return lock_count - class HazardMeasureModel(MeasureModel): """BaseModel describing the expected variables and data types of attributes common to all impact measures""" diff --git a/flood_adapt/object_model/interface/projections.py b/flood_adapt/object_model/interface/projections.py index 36cf39a20..902e67b08 100644 --- a/flood_adapt/object_model/interface/projections.py +++ b/flood_adapt/object_model/interface/projections.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Any, Optional, Union -from pydantic import BaseModel, validator +from pydantic import BaseModel from flood_adapt.object_model.io.unitfulvalue import ( UnitfulLength, @@ -34,17 +34,9 @@ class SocioEconomicChangeModel(BaseModel): class ProjectionModel(BaseModel): name: str description: Optional[str] = "" - lock_count: int = 0 physical_projection: PhysicalProjectionModel socio_economic_change: SocioEconomicChangeModel - @validator("lock_count") - def validate_lock_count(cls, lock_count: int) -> int: - """Validate lock_count""" - if lock_count < 0: - raise ValueError("lock_count must be a positive integer") - return lock_count - class IProjection(ABC): attrs: ProjectionModel diff --git a/flood_adapt/object_model/interface/scenarios.py b/flood_adapt/object_model/interface/scenarios.py index 8fcb51d97..610eaaf27 100644 --- a/flood_adapt/object_model/interface/scenarios.py +++ b/flood_adapt/object_model/interface/scenarios.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Any, Optional, Union -from pydantic import BaseModel, validator +from pydantic import BaseModel class ScenarioModel(BaseModel): @@ -10,18 +10,10 @@ class ScenarioModel(BaseModel): name: str description: Optional[str] = "" - lock_count: int = 0 event: str projection: str strategy: str - @validator("lock_count") - def validate_lock_count(cls, lock_count: int) -> int: - """Validate lock_count""" - if lock_count < 0: - raise ValueError("lock_count must be a positive integer") - return lock_count - class IScenario(ABC): attrs: ScenarioModel diff --git a/flood_adapt/object_model/interface/strategies.py b/flood_adapt/object_model/interface/strategies.py index 4b7e347c0..a1e091892 100644 --- a/flood_adapt/object_model/interface/strategies.py +++ b/flood_adapt/object_model/interface/strategies.py @@ -2,22 +2,14 @@ from abc import ABC, abstractmethod from typing import Any, Optional, Union -from pydantic import BaseModel, validator +from pydantic import BaseModel class StrategyModel(BaseModel): name: str description: Optional[str] = "" - lock_count: int = 0 measures: Optional[list[str]] = [] - @validator("lock_count") - def validate_lock_count(cls, lock_count: int) -> int: - """Validate lock_count""" - if lock_count < 0: - raise ValueError("lock_count must be a positive integer") - return lock_count - class IStrategy(ABC): attrs: StrategyModel