diff --git a/python/ribasim/ribasim/schemas.py b/python/ribasim/ribasim/schemas.py index 53b42bc3c..69f455a89 100644 --- a/python/ribasim/ribasim/schemas.py +++ b/python/ribasim/ribasim/schemas.py @@ -32,7 +32,7 @@ class BasinStaticSchema(_BaseSchema): class BasinSubgridSchema(_BaseSchema): - subgrid_id: Series[int] = pa.Field(nullable=False) + subgrid_id: Series[int] = pa.Field(nullable=False, default=0) node_id: Series[int] = pa.Field(nullable=False, default=0) basin_level: Series[float] = pa.Field(nullable=False) subgrid_level: Series[float] = pa.Field(nullable=False) @@ -49,67 +49,67 @@ class BasinTimeSchema(_BaseSchema): class DiscreteControlConditionSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) listen_feature_type: Series[str] = pa.Field(nullable=True) - listen_feature_id: Series[int] = pa.Field(nullable=False) + listen_feature_id: Series[int] = pa.Field(nullable=False, default=0) variable: Series[str] = pa.Field(nullable=False) greater_than: Series[float] = pa.Field(nullable=False) look_ahead: Series[float] = pa.Field(nullable=True) class DiscreteControlLogicSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) truth_state: Series[str] = pa.Field(nullable=False) control_state: Series[str] = pa.Field(nullable=False) class FlowBoundaryStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) flow_rate: Series[float] = pa.Field(nullable=False) class FlowBoundaryTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) flow_rate: Series[float] = pa.Field(nullable=False) class FractionalFlowStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) fraction: Series[float] = pa.Field(nullable=False) control_state: Series[str] = pa.Field(nullable=True) class LevelBoundaryStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) level: Series[float] = pa.Field(nullable=False) class LevelBoundaryTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) level: Series[float] = pa.Field(nullable=False) class LevelDemandStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) min_level: Series[float] = pa.Field(nullable=False) max_level: Series[float] = pa.Field(nullable=False) - priority: Series[int] = pa.Field(nullable=False) + priority: Series[int] = pa.Field(nullable=False, default=0) class LevelDemandTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) min_level: Series[float] = pa.Field(nullable=False) max_level: Series[float] = pa.Field(nullable=False) - priority: Series[int] = pa.Field(nullable=False) + priority: Series[int] = pa.Field(nullable=False, default=0) class LinearResistanceStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) resistance: Series[float] = pa.Field(nullable=False) max_flow_rate: Series[float] = pa.Field(nullable=True) @@ -117,7 +117,7 @@ class LinearResistanceStaticSchema(_BaseSchema): class ManningResistanceStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) length: Series[float] = pa.Field(nullable=False) manning_n: Series[float] = pa.Field(nullable=False) @@ -127,7 +127,7 @@ class ManningResistanceStaticSchema(_BaseSchema): class OutletStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) flow_rate: Series[float] = pa.Field(nullable=False) min_flow_rate: Series[float] = pa.Field(nullable=True) @@ -137,10 +137,10 @@ class OutletStaticSchema(_BaseSchema): class PidControlStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) listen_node_type: Series[str] = pa.Field(nullable=True) - listen_node_id: Series[int] = pa.Field(nullable=False) + listen_node_id: Series[int] = pa.Field(nullable=False, default=0) target: Series[float] = pa.Field(nullable=False) proportional: Series[float] = pa.Field(nullable=False) integral: Series[float] = pa.Field(nullable=False) @@ -149,9 +149,9 @@ class PidControlStaticSchema(_BaseSchema): class PidControlTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) listen_node_type: Series[str] = pa.Field(nullable=True) - listen_node_id: Series[int] = pa.Field(nullable=False) + listen_node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) target: Series[float] = pa.Field(nullable=False) proportional: Series[float] = pa.Field(nullable=False) @@ -161,7 +161,7 @@ class PidControlTimeSchema(_BaseSchema): class PumpStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) flow_rate: Series[float] = pa.Field(nullable=False) min_flow_rate: Series[float] = pa.Field(nullable=True) @@ -170,7 +170,7 @@ class PumpStaticSchema(_BaseSchema): class TabulatedRatingCurveStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) level: Series[float] = pa.Field(nullable=False) flow_rate: Series[float] = pa.Field(nullable=False) @@ -178,29 +178,29 @@ class TabulatedRatingCurveStaticSchema(_BaseSchema): class TabulatedRatingCurveTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) level: Series[float] = pa.Field(nullable=False) flow_rate: Series[float] = pa.Field(nullable=False) class TerminalStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) class UserDemandStaticSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) active: Series[pa.BOOL] = pa.Field(nullable=True) demand: Series[float] = pa.Field(nullable=False) return_factor: Series[float] = pa.Field(nullable=False) min_level: Series[float] = pa.Field(nullable=False) - priority: Series[int] = pa.Field(nullable=False) + priority: Series[int] = pa.Field(nullable=False, default=0) class UserDemandTimeSchema(_BaseSchema): - node_id: Series[int] = pa.Field(nullable=False) + node_id: Series[int] = pa.Field(nullable=False, default=0) time: Series[Timestamp] = pa.Field(nullable=False) demand: Series[float] = pa.Field(nullable=False) return_factor: Series[float] = pa.Field(nullable=False) min_level: Series[float] = pa.Field(nullable=False) - priority: Series[int] = pa.Field(nullable=False) + priority: Series[int] = pa.Field(nullable=False, default=0)