Skip to content

Commit

Permalink
Generate schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Feb 26, 2024
1 parent 68b2c6e commit 5bc0a91
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions python/ribasim/ribasim/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -49,75 +49,75 @@ 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)
control_state: Series[str] = pa.Field(nullable=True)


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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -170,37 +170,37 @@ 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)
control_state: Series[str] = pa.Field(nullable=True)


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)

0 comments on commit 5bc0a91

Please sign in to comment.