From 8a9a804d26bacf2ec485c4f3fe12570652f1067e Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Thu, 5 Oct 2023 14:49:48 +0200 Subject: [PATCH] pixi run codegen --- docs/schema/BasinProfile.schema.json | 26 +- docs/schema/BasinState.schema.json | 22 +- docs/schema/BasinStatic.schema.json | 36 +-- docs/schema/BasinTime.schema.json | 36 +-- docs/schema/Config.schema.json | 196 ++++++------- .../DiscreteControlCondition.schema.json | 34 +-- docs/schema/DiscreteControlLogic.schema.json | 26 +- docs/schema/Edge.schema.json | 32 +-- docs/schema/FlowBoundaryStatic.schema.json | 22 +- docs/schema/FlowBoundaryTime.schema.json | 22 +- docs/schema/FractionalFlowStatic.schema.json | 22 +- docs/schema/LevelBoundaryStatic.schema.json | 26 +- docs/schema/LevelBoundaryTime.schema.json | 26 +- .../schema/LinearResistanceStatic.schema.json | 26 +- docs/schema/Logging.schema.json | 22 +- .../ManningResistanceStatic.schema.json | 42 +-- docs/schema/Node.schema.json | 22 +- docs/schema/OutletStatic.schema.json | 54 ++-- docs/schema/Output.schema.json | 36 +-- docs/schema/PIDControlStatic.schema.json | 42 +-- docs/schema/PidControlTime.schema.json | 36 +-- docs/schema/PumpStatic.schema.json | 52 ++-- docs/schema/Solver.schema.json | 98 +++---- .../TabulatedRatingCurveStatic.schema.json | 30 +- .../TabulatedRatingCurveTime.schema.json | 30 +- docs/schema/TerminalStatic.schema.json | 22 +- docs/schema/UserStatic.schema.json | 26 +- docs/schema/UserTime.schema.json | 26 +- docs/schema/basin.schema.json | 14 +- docs/schema/discrete_control.schema.json | 14 +- docs/schema/flow_boundary.schema.json | 14 +- docs/schema/fractional_flow.schema.json | 10 +- docs/schema/level_boundary.schema.json | 14 +- docs/schema/linear_resistance.schema.json | 10 +- docs/schema/manning_resistance.schema.json | 10 +- docs/schema/outlet.schema.json | 10 +- docs/schema/pid_control.schema.json | 14 +- docs/schema/pump.schema.json | 10 +- docs/schema/root.schema.json | 70 ++--- .../schema/tabulated_rating_curve.schema.json | 14 +- docs/schema/terminal.schema.json | 10 +- docs/schema/user.schema.json | 14 +- python/ribasim/ribasim/config.py | 148 +++++----- python/ribasim/ribasim/models.py | 258 +++++++++--------- 44 files changed, 862 insertions(+), 862 deletions(-) diff --git a/docs/schema/BasinProfile.schema.json b/docs/schema/BasinProfile.schema.json index 98dc78dd0..aede486b5 100644 --- a/docs/schema/BasinProfile.schema.json +++ b/docs/schema/BasinProfile.schema.json @@ -1,32 +1,32 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/BasinProfile.schema.json", + "title": "BasinProfile", + "description": "A BasinProfile object based on Ribasim.BasinProfileV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "area": { "format": "double", "type": "number" }, - "node_id": { - "format": "default", - "type": "integer" - }, "level": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "area", "level" - ], - "$id": "https://deltares.github.io/Ribasim/schema/BasinProfile.schema.json", - "title": "BasinProfile", - "description": "A BasinProfile object based on Ribasim.BasinProfileV1", - "type": "object" + ] } diff --git a/docs/schema/BasinState.schema.json b/docs/schema/BasinState.schema.json index 906bf5a96..e5ca6dd60 100644 --- a/docs/schema/BasinState.schema.json +++ b/docs/schema/BasinState.schema.json @@ -1,12 +1,10 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/BasinState.schema.json", + "title": "BasinState", + "description": "A BasinState object based on Ribasim.BasinStateV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, "node_id": { "format": "default", "type": "integer" @@ -14,14 +12,16 @@ "level": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "level" - ], - "$id": "https://deltares.github.io/Ribasim/schema/BasinState.schema.json", - "title": "BasinState", - "description": "A BasinState object based on Ribasim.BasinStateV1", - "type": "object" + ] } diff --git a/docs/schema/BasinStatic.schema.json b/docs/schema/BasinStatic.schema.json index a47d2970b..2d8366e7f 100644 --- a/docs/schema/BasinStatic.schema.json +++ b/docs/schema/BasinStatic.schema.json @@ -1,35 +1,39 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/BasinStatic.schema.json", + "title": "BasinStatic", + "description": "A BasinStatic object based on Ribasim.BasinStaticV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, - "precipitation": { + "drainage": { "format": "double", "type": "number" }, - "infiltration": { + "potential_evaporation": { "format": "double", "type": "number" }, - "urban_runoff": { + "infiltration": { "format": "double", "type": "number" }, - "node_id": { - "format": "default", - "type": "integer" - }, - "potential_evaporation": { + "precipitation": { "format": "double", "type": "number" }, - "drainage": { + "urban_runoff": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -39,9 +43,5 @@ "infiltration", "precipitation", "urban_runoff" - ], - "$id": "https://deltares.github.io/Ribasim/schema/BasinStatic.schema.json", - "title": "BasinStatic", - "description": "A BasinStatic object based on Ribasim.BasinStaticV1", - "type": "object" + ] } diff --git a/docs/schema/BasinTime.schema.json b/docs/schema/BasinTime.schema.json index d505d525c..badcdf567 100644 --- a/docs/schema/BasinTime.schema.json +++ b/docs/schema/BasinTime.schema.json @@ -1,39 +1,43 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/BasinTime.schema.json", + "title": "BasinTime", + "description": "A BasinTime object based on Ribasim.BasinTimeV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "time": { "format": "date-time", "type": "string" }, - "precipitation": { + "drainage": { "format": "double", "type": "number" }, - "infiltration": { + "potential_evaporation": { "format": "double", "type": "number" }, - "urban_runoff": { + "infiltration": { "format": "double", "type": "number" }, - "node_id": { - "format": "default", - "type": "integer" - }, - "potential_evaporation": { + "precipitation": { "format": "double", "type": "number" }, - "drainage": { + "urban_runoff": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -44,9 +48,5 @@ "infiltration", "precipitation", "urban_runoff" - ], - "$id": "https://deltares.github.io/Ribasim/schema/BasinTime.schema.json", - "title": "BasinTime", - "description": "A BasinTime object based on Ribasim.BasinTimeV1", - "type": "object" + ] } diff --git a/docs/schema/Config.schema.json b/docs/schema/Config.schema.json index 290954732..0663dad60 100644 --- a/docs/schema/Config.schema.json +++ b/docs/schema/Config.schema.json @@ -1,64 +1,55 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Config.schema.json", + "title": "Config", + "description": "A Config object based on Ribasim.config.Config", + "type": "object", "properties": { - "output": { - "default": { - "basin": "output/basin.arrow", - "flow": "output/flow.arrow", - "control": "output/control.arrow", - "outstate": null, - "compression": "zstd", - "compression_level": 6 - }, - "$ref": "https://deltares.github.io/Ribasim/schema/Output.schema.json" - }, "starttime": { "format": "date-time", "type": "string" }, + "endtime": { + "format": "date-time", + "type": "string" + }, "update_timestep": { "format": "double", - "default": 86400, - "type": "number" + "type": "number", + "default": 86400 + }, + "relative_dir": { + "format": "default", + "type": "string", + "default": "." }, "input_dir": { "format": "default", - "default": ".", - "type": "string" + "type": "string", + "default": "." }, "output_dir": { "format": "default", - "default": ".", - "type": "string" - }, - "level_boundary": { - "default": { - "static": null, - "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/level_boundary.schema.json" - }, - "user": { - "default": { - "static": null, - "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/user.schema.json" + "type": "string", + "default": "." }, - "pump": { - "default": { - "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/pump.schema.json" + "geopackage": { + "format": "default", + "type": "string" }, - "discrete_control": { + "output": { + "$ref": "https://deltares.github.io/Ribasim/schema/Output.schema.json", "default": { - "condition": null, - "logic": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/discrete_control.schema.json" + "basin": "output/basin.arrow", + "flow": "output/flow.arrow", + "control": "output/control.arrow", + "outstate": null, + "compression": "zstd", + "compression_level": 6 + } }, "solver": { + "$ref": "https://deltares.github.io/Ribasim/schema/Solver.schema.json", "default": { "algorithm": "QNDF", "saveat": [ @@ -73,90 +64,103 @@ "maxiters": 1000000000, "sparse": true, "autodiff": true - }, - "$ref": "https://deltares.github.io/Ribasim/schema/Solver.schema.json" + } }, - "flow_boundary": { + "logging": { + "$ref": "https://deltares.github.io/Ribasim/schema/Logging.schema.json", "default": { - "static": null, - "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/flow_boundary.schema.json" + "verbosity": { + "level": 0 + }, + "timing": false + } + }, + "terminal": { + "$ref": "https://deltares.github.io/Ribasim/schema/terminal.schema.json", + "default": { + "static": null + } }, "pid_control": { + "$ref": "https://deltares.github.io/Ribasim/schema/pid_control.schema.json", "default": { "static": null, "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/pid_control.schema.json" + } }, - "fractional_flow": { + "level_boundary": { + "$ref": "https://deltares.github.io/Ribasim/schema/level_boundary.schema.json", "default": { - "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/fractional_flow.schema.json" - }, - "relative_dir": { - "format": "default", - "default": ".", - "type": "string" - }, - "endtime": { - "format": "date-time", - "type": "string" + "static": null, + "time": null + } }, - "manning_resistance": { + "pump": { + "$ref": "https://deltares.github.io/Ribasim/schema/pump.schema.json", "default": { "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/manning_resistance.schema.json" + } }, "tabulated_rating_curve": { + "$ref": "https://deltares.github.io/Ribasim/schema/tabulated_rating_curve.schema.json", "default": { "static": null, "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/tabulated_rating_curve.schema.json" - }, - "logging": { - "default": { - "verbosity": { - "level": 0 - }, - "timing": false - }, - "$ref": "https://deltares.github.io/Ribasim/schema/Logging.schema.json" + } }, - "outlet": { + "user": { + "$ref": "https://deltares.github.io/Ribasim/schema/user.schema.json", "default": { - "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/outlet.schema.json" - }, - "geopackage": { - "format": "default", - "type": "string" + "static": null, + "time": null + } }, - "terminal": { + "flow_boundary": { + "$ref": "https://deltares.github.io/Ribasim/schema/flow_boundary.schema.json", "default": { - "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/terminal.schema.json" + "static": null, + "time": null + } }, "basin": { + "$ref": "https://deltares.github.io/Ribasim/schema/basin.schema.json", "default": { "profile": null, "state": null, "static": null, "time": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/basin.schema.json" + } + }, + "manning_resistance": { + "$ref": "https://deltares.github.io/Ribasim/schema/manning_resistance.schema.json", + "default": { + "static": null + } + }, + "discrete_control": { + "$ref": "https://deltares.github.io/Ribasim/schema/discrete_control.schema.json", + "default": { + "condition": null, + "logic": null + } + }, + "outlet": { + "$ref": "https://deltares.github.io/Ribasim/schema/outlet.schema.json", + "default": { + "static": null + } }, "linear_resistance": { + "$ref": "https://deltares.github.io/Ribasim/schema/linear_resistance.schema.json", "default": { "static": null - }, - "$ref": "https://deltares.github.io/Ribasim/schema/linear_resistance.schema.json" + } + }, + "fractional_flow": { + "$ref": "https://deltares.github.io/Ribasim/schema/fractional_flow.schema.json", + "default": { + "static": null + } } }, "required": [ @@ -183,9 +187,5 @@ "outlet", "linear_resistance", "fractional_flow" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Config.schema.json", - "title": "Config", - "description": "A Config object based on Ribasim.config.Config", - "type": "object" + ] } diff --git a/docs/schema/DiscreteControlCondition.schema.json b/docs/schema/DiscreteControlCondition.schema.json index 3ce188fe2..e7e6b14df 100644 --- a/docs/schema/DiscreteControlCondition.schema.json +++ b/docs/schema/DiscreteControlCondition.schema.json @@ -1,21 +1,15 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/DiscreteControlCondition.schema.json", + "title": "DiscreteControlCondition", + "description": "A DiscreteControlCondition object based on Ribasim.DiscreteControlConditionV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, - "greater_than": { - "format": "double", - "type": "number" - }, - "listen_feature_id": { + "node_id": { "format": "default", "type": "integer" }, - "node_id": { + "listen_feature_id": { "format": "default", "type": "integer" }, @@ -23,6 +17,10 @@ "format": "default", "type": "string" }, + "greater_than": { + "format": "double", + "type": "number" + }, "look_ahead": { "format": "default", "anyOf": [ @@ -33,6 +31,12 @@ "type": "number" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -40,9 +44,5 @@ "listen_feature_id", "variable", "greater_than" - ], - "$id": "https://deltares.github.io/Ribasim/schema/DiscreteControlCondition.schema.json", - "title": "DiscreteControlCondition", - "description": "A DiscreteControlCondition object based on Ribasim.DiscreteControlConditionV1", - "type": "object" + ] } diff --git a/docs/schema/DiscreteControlLogic.schema.json b/docs/schema/DiscreteControlLogic.schema.json index 76a549b6b..e7e42b565 100644 --- a/docs/schema/DiscreteControlLogic.schema.json +++ b/docs/schema/DiscreteControlLogic.schema.json @@ -1,32 +1,32 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/DiscreteControlLogic.schema.json", + "title": "DiscreteControlLogic", + "description": "A DiscreteControlLogic object based on Ribasim.DiscreteControlLogicV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "truth_state": { "format": "default", "type": "string" }, - "node_id": { - "format": "default", - "type": "integer" - }, "control_state": { "format": "default", "type": "string" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "truth_state", "control_state" - ], - "$id": "https://deltares.github.io/Ribasim/schema/DiscreteControlLogic.schema.json", - "title": "DiscreteControlLogic", - "description": "A DiscreteControlLogic object based on Ribasim.DiscreteControlLogicV1", - "type": "object" + ] } diff --git a/docs/schema/Edge.schema.json b/docs/schema/Edge.schema.json index 43626db5f..319a947ba 100644 --- a/docs/schema/Edge.schema.json +++ b/docs/schema/Edge.schema.json @@ -1,17 +1,15 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Edge.schema.json", + "title": "Edge", + "description": "A Edge object based on Ribasim.EdgeV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, - "edge_type": { + "fid": { "format": "default", - "type": "string" + "type": "integer" }, - "fid": { + "from_node_id": { "format": "default", "type": "integer" }, @@ -19,9 +17,15 @@ "format": "default", "type": "integer" }, - "from_node_id": { + "edge_type": { "format": "default", - "type": "integer" + "type": "string" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -29,9 +33,5 @@ "from_node_id", "to_node_id", "edge_type" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Edge.schema.json", - "title": "Edge", - "description": "A Edge object based on Ribasim.EdgeV1", - "type": "object" + ] } diff --git a/docs/schema/FlowBoundaryStatic.schema.json b/docs/schema/FlowBoundaryStatic.schema.json index 8300ea9fd..8ff56bd1f 100644 --- a/docs/schema/FlowBoundaryStatic.schema.json +++ b/docs/schema/FlowBoundaryStatic.schema.json @@ -1,11 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/FlowBoundaryStatic.schema.json", + "title": "FlowBoundaryStatic", + "description": "A FlowBoundaryStatic object based on Ribasim.FlowBoundaryStaticV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -22,17 +24,15 @@ "format": "double", "type": "number" }, - "node_id": { + "remarks": { + "description": "a hack for pandera", + "type": "string", "format": "default", - "type": "integer" + "default": "" } }, "required": [ "node_id", "flow_rate" - ], - "$id": "https://deltares.github.io/Ribasim/schema/FlowBoundaryStatic.schema.json", - "title": "FlowBoundaryStatic", - "description": "A FlowBoundaryStatic object based on Ribasim.FlowBoundaryStaticV1", - "type": "object" + ] } diff --git a/docs/schema/FlowBoundaryTime.schema.json b/docs/schema/FlowBoundaryTime.schema.json index dc64986ce..7f1d00465 100644 --- a/docs/schema/FlowBoundaryTime.schema.json +++ b/docs/schema/FlowBoundaryTime.schema.json @@ -1,11 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/FlowBoundaryTime.schema.json", + "title": "FlowBoundaryTime", + "description": "A FlowBoundaryTime object based on Ribasim.FlowBoundaryTimeV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "time": { "format": "date-time", @@ -15,18 +17,16 @@ "format": "double", "type": "number" }, - "node_id": { + "remarks": { + "description": "a hack for pandera", + "type": "string", "format": "default", - "type": "integer" + "default": "" } }, "required": [ "node_id", "time", "flow_rate" - ], - "$id": "https://deltares.github.io/Ribasim/schema/FlowBoundaryTime.schema.json", - "title": "FlowBoundaryTime", - "description": "A FlowBoundaryTime object based on Ribasim.FlowBoundaryTimeV1", - "type": "object" + ] } diff --git a/docs/schema/FractionalFlowStatic.schema.json b/docs/schema/FractionalFlowStatic.schema.json index 64bed064f..60cf463ab 100644 --- a/docs/schema/FractionalFlowStatic.schema.json +++ b/docs/schema/FractionalFlowStatic.schema.json @@ -1,12 +1,10 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/FractionalFlowStatic.schema.json", + "title": "FractionalFlowStatic", + "description": "A FractionalFlowStatic object based on Ribasim.FractionalFlowStaticV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, "node_id": { "format": "default", "type": "integer" @@ -25,14 +23,16 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "fraction" - ], - "$id": "https://deltares.github.io/Ribasim/schema/FractionalFlowStatic.schema.json", - "title": "FractionalFlowStatic", - "description": "A FractionalFlowStatic object based on Ribasim.FractionalFlowStaticV1", - "type": "object" + ] } diff --git a/docs/schema/LevelBoundaryStatic.schema.json b/docs/schema/LevelBoundaryStatic.schema.json index f635afce0..8c1e30d27 100644 --- a/docs/schema/LevelBoundaryStatic.schema.json +++ b/docs/schema/LevelBoundaryStatic.schema.json @@ -1,11 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/LevelBoundaryStatic.schema.json", + "title": "LevelBoundaryStatic", + "description": "A LevelBoundaryStatic object based on Ribasim.LevelBoundaryStaticV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -18,21 +20,19 @@ } ] }, - "node_id": { - "format": "default", - "type": "integer" - }, "level": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "level" - ], - "$id": "https://deltares.github.io/Ribasim/schema/LevelBoundaryStatic.schema.json", - "title": "LevelBoundaryStatic", - "description": "A LevelBoundaryStatic object based on Ribasim.LevelBoundaryStaticV1", - "type": "object" + ] } diff --git a/docs/schema/LevelBoundaryTime.schema.json b/docs/schema/LevelBoundaryTime.schema.json index e50696c32..89c8dfea2 100644 --- a/docs/schema/LevelBoundaryTime.schema.json +++ b/docs/schema/LevelBoundaryTime.schema.json @@ -1,32 +1,32 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/LevelBoundaryTime.schema.json", + "title": "LevelBoundaryTime", + "description": "A LevelBoundaryTime object based on Ribasim.LevelBoundaryTimeV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "time": { "format": "date-time", "type": "string" }, - "node_id": { - "format": "default", - "type": "integer" - }, "level": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "time", "level" - ], - "$id": "https://deltares.github.io/Ribasim/schema/LevelBoundaryTime.schema.json", - "title": "LevelBoundaryTime", - "description": "A LevelBoundaryTime object based on Ribasim.LevelBoundaryTimeV1", - "type": "object" + ] } diff --git a/docs/schema/LinearResistanceStatic.schema.json b/docs/schema/LinearResistanceStatic.schema.json index 5a5146ea9..655f2d3c3 100644 --- a/docs/schema/LinearResistanceStatic.schema.json +++ b/docs/schema/LinearResistanceStatic.schema.json @@ -1,11 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/LinearResistanceStatic.schema.json", + "title": "LinearResistanceStatic", + "description": "A LinearResistanceStatic object based on Ribasim.LinearResistanceStaticV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -18,10 +20,6 @@ } ] }, - "node_id": { - "format": "default", - "type": "integer" - }, "resistance": { "format": "double", "type": "number" @@ -36,14 +34,16 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "resistance" - ], - "$id": "https://deltares.github.io/Ribasim/schema/LinearResistanceStatic.schema.json", - "title": "LinearResistanceStatic", - "description": "A LinearResistanceStatic object based on Ribasim.LinearResistanceStaticV1", - "type": "object" + ] } diff --git a/docs/schema/Logging.schema.json b/docs/schema/Logging.schema.json index 86fb596a7..3db246070 100644 --- a/docs/schema/Logging.schema.json +++ b/docs/schema/Logging.schema.json @@ -1,23 +1,23 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Logging.schema.json", + "title": "Logging", + "description": "A Logging object based on Ribasim.config.Logging", + "type": "object", "properties": { - "timing": { + "verbosity": { "format": "default", - "default": false, - "type": "boolean" + "type": "string", + "default": "info" }, - "verbosity": { + "timing": { "format": "default", - "default": "info", - "type": "string" + "type": "boolean", + "default": false } }, "required": [ "verbosity", "timing" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Logging.schema.json", - "title": "Logging", - "description": "A Logging object based on Ribasim.config.Logging", - "type": "object" + ] } diff --git a/docs/schema/ManningResistanceStatic.schema.json b/docs/schema/ManningResistanceStatic.schema.json index 22bad56df..12cc0ce38 100644 --- a/docs/schema/ManningResistanceStatic.schema.json +++ b/docs/schema/ManningResistanceStatic.schema.json @@ -1,19 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/ManningResistanceStatic.schema.json", + "title": "ManningResistanceStatic", + "description": "A ManningResistanceStatic object based on Ribasim.ManningResistanceStaticV1", + "type": "object", "properties": { - "length": { - "format": "double", - "type": "number" - }, - "manning_n": { - "format": "double", - "type": "number" - }, - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -26,13 +20,17 @@ } ] }, - "profile_width": { + "length": { "format": "double", "type": "number" }, - "node_id": { - "format": "default", - "type": "integer" + "manning_n": { + "format": "double", + "type": "number" + }, + "profile_width": { + "format": "double", + "type": "number" }, "profile_slope": { "format": "double", @@ -48,6 +46,12 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -56,9 +60,5 @@ "manning_n", "profile_width", "profile_slope" - ], - "$id": "https://deltares.github.io/Ribasim/schema/ManningResistanceStatic.schema.json", - "title": "ManningResistanceStatic", - "description": "A ManningResistanceStatic object based on Ribasim.ManningResistanceStaticV1", - "type": "object" + ] } diff --git a/docs/schema/Node.schema.json b/docs/schema/Node.schema.json index dfbf5f509..81a47a013 100644 --- a/docs/schema/Node.schema.json +++ b/docs/schema/Node.schema.json @@ -1,12 +1,10 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Node.schema.json", + "title": "Node", + "description": "A Node object based on Ribasim.NodeV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, "fid": { "format": "default", "type": "integer" @@ -14,14 +12,16 @@ "type": { "format": "default", "type": "string" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "fid", "type" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Node.schema.json", - "title": "Node", - "description": "A Node object based on Ribasim.NodeV1", - "type": "object" + ] } diff --git a/docs/schema/OutletStatic.schema.json b/docs/schema/OutletStatic.schema.json index d8feae988..de101f2d1 100644 --- a/docs/schema/OutletStatic.schema.json +++ b/docs/schema/OutletStatic.schema.json @@ -1,35 +1,41 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/OutletStatic.schema.json", + "title": "OutletStatic", + "description": "A OutletStatic object based on Ribasim.OutletStaticV1", + "type": "object", "properties": { - "max_flow_rate": { + "node_id": { + "format": "default", + "type": "integer" + }, + "active": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "number" + "type": "boolean" } ] }, - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "flow_rate": { + "format": "double", + "type": "number" }, - "active": { + "min_flow_rate": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "boolean" + "type": "number" } ] }, - "min_crest_level": { + "max_flow_rate": { "format": "default", "anyOf": [ { @@ -40,43 +46,37 @@ } ] }, - "flow_rate": { - "format": "double", - "type": "number" - }, - "node_id": { - "format": "default", - "type": "integer" - }, - "control_state": { + "min_crest_level": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "string" + "type": "number" } ] }, - "min_flow_rate": { + "control_state": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "number" + "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "flow_rate" - ], - "$id": "https://deltares.github.io/Ribasim/schema/OutletStatic.schema.json", - "title": "OutletStatic", - "description": "A OutletStatic object based on Ribasim.OutletStaticV1", - "type": "object" + ] } diff --git a/docs/schema/Output.schema.json b/docs/schema/Output.schema.json index 42fffb7e9..2b566470d 100644 --- a/docs/schema/Output.schema.json +++ b/docs/schema/Output.schema.json @@ -1,25 +1,24 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Output.schema.json", + "title": "Output", + "description": "A Output object based on Ribasim.config.Output", + "type": "object", "properties": { - "compression": { - "format": "default", - "default": "zstd", - "type": "string" - }, "basin": { "format": "default", - "default": "output/basin.arrow", - "type": "string" + "type": "string", + "default": "output/basin.arrow" }, "flow": { "format": "default", - "default": "output/flow.arrow", - "type": "string" + "type": "string", + "default": "output/flow.arrow" }, "control": { "format": "default", - "default": "output/control.arrow", - "type": "string" + "type": "string", + "default": "output/control.arrow" }, "outstate": { "format": "default", @@ -33,10 +32,15 @@ ], "default": null }, + "compression": { + "format": "default", + "type": "string", + "default": "zstd" + }, "compression_level": { "format": "default", - "default": 6, - "type": "integer" + "type": "integer", + "default": 6 } }, "required": [ @@ -45,9 +49,5 @@ "control", "compression", "compression_level" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Output.schema.json", - "title": "Output", - "description": "A Output object based on Ribasim.config.Output", - "type": "object" + ] } diff --git a/docs/schema/PIDControlStatic.schema.json b/docs/schema/PIDControlStatic.schema.json index df64576ee..293e7f0b8 100644 --- a/docs/schema/PIDControlStatic.schema.json +++ b/docs/schema/PIDControlStatic.schema.json @@ -1,17 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/PidControlStatic.schema.json", + "title": "PidControlStatic", + "description": "A PidControlStatic object based on Ribasim.PidControlStaticV1", + "type": "object", "properties": { - "integral": { - "format": "double", - "type": "number" - }, - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, - "listen_node_id": { + "node_id": { "format": "default", "type": "integer" }, @@ -26,11 +20,7 @@ } ] }, - "proportional": { - "format": "double", - "type": "number" - }, - "node_id": { + "listen_node_id": { "format": "default", "type": "integer" }, @@ -38,6 +28,14 @@ "format": "double", "type": "number" }, + "proportional": { + "format": "double", + "type": "number" + }, + "integral": { + "format": "double", + "type": "number" + }, "derivative": { "format": "double", "type": "number" @@ -52,6 +50,12 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -61,9 +65,5 @@ "proportional", "integral", "derivative" - ], - "$id": "https://deltares.github.io/Ribasim/schema/PidControlStatic.schema.json", - "title": "PidControlStatic", - "description": "A PidControlStatic object based on Ribasim.PidControlStaticV1", - "type": "object" + ] } diff --git a/docs/schema/PidControlTime.schema.json b/docs/schema/PidControlTime.schema.json index de34eaef8..6666066a5 100644 --- a/docs/schema/PidControlTime.schema.json +++ b/docs/schema/PidControlTime.schema.json @@ -1,15 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/PidControlTime.schema.json", + "title": "PidControlTime", + "description": "A PidControlTime object based on Ribasim.PidControlTimeV1", + "type": "object", "properties": { - "integral": { - "format": "double", - "type": "number" - }, - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "listen_node_id": { "format": "default", @@ -19,15 +17,15 @@ "format": "date-time", "type": "string" }, - "proportional": { + "target": { "format": "double", "type": "number" }, - "node_id": { - "format": "default", - "type": "integer" + "proportional": { + "format": "double", + "type": "number" }, - "target": { + "integral": { "format": "double", "type": "number" }, @@ -45,6 +43,12 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -55,9 +59,5 @@ "proportional", "integral", "derivative" - ], - "$id": "https://deltares.github.io/Ribasim/schema/PidControlTime.schema.json", - "title": "PidControlTime", - "description": "A PidControlTime object based on Ribasim.PidControlTimeV1", - "type": "object" + ] } diff --git a/docs/schema/PumpStatic.schema.json b/docs/schema/PumpStatic.schema.json index afe80e42c..100c3a922 100644 --- a/docs/schema/PumpStatic.schema.json +++ b/docs/schema/PumpStatic.schema.json @@ -1,22 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/PumpStatic.schema.json", + "title": "PumpStatic", + "description": "A PumpStatic object based on Ribasim.PumpStaticV1", + "type": "object", "properties": { - "max_flow_rate": { - "format": "default", - "anyOf": [ - { - "type": "null" - }, - { - "type": "number" - } - ] - }, - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -33,39 +24,48 @@ "format": "double", "type": "number" }, - "node_id": { + "min_flow_rate": { "format": "default", - "type": "integer" + "anyOf": [ + { + "type": "null" + }, + { + "type": "number" + } + ] }, - "control_state": { + "max_flow_rate": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "string" + "type": "number" } ] }, - "min_flow_rate": { + "control_state": { "format": "default", "anyOf": [ { "type": "null" }, { - "type": "number" + "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "flow_rate" - ], - "$id": "https://deltares.github.io/Ribasim/schema/PumpStatic.schema.json", - "title": "PumpStatic", - "description": "A PumpStatic object based on Ribasim.PumpStaticV1", - "type": "object" + ] } diff --git a/docs/schema/Solver.schema.json b/docs/schema/Solver.schema.json index fc95a4177..e10fa0894 100644 --- a/docs/schema/Solver.schema.json +++ b/docs/schema/Solver.schema.json @@ -1,20 +1,35 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/Solver.schema.json", + "title": "Solver", + "description": "A Solver object based on Ribasim.config.Solver", + "type": "object", "properties": { - "autodiff": { + "algorithm": { "format": "default", - "default": true, - "type": "boolean" + "type": "string", + "default": "QNDF" }, - "adaptive": { + "saveat": { "format": "default", - "default": true, - "type": "boolean" + "anyOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "number" + } + } + ], + "default": [ + ] }, - "force_dtmin": { + "adaptive": { "format": "default", - "default": false, - "type": "boolean" + "type": "boolean", + "default": true }, "dt": { "format": "default", @@ -28,28 +43,19 @@ ], "default": null }, - "saveat": { + "dtmin": { "format": "default", "anyOf": [ { - "items": { - "type": "number" - }, - "type": "array" + "type": "null" }, { "type": "number" } ], - "default": [ - ] - }, - "maxiters": { - "format": "default", - "default": 1000000000, - "type": "integer" + "default": null }, - "dtmin": { + "dtmax": { "format": "default", "anyOf": [ { @@ -61,37 +67,35 @@ ], "default": null }, - "sparse": { - "format": "default", - "default": true, - "type": "boolean" - }, - "algorithm": { + "force_dtmin": { "format": "default", - "default": "QNDF", - "type": "string" + "type": "boolean", + "default": false }, "abstol": { "format": "double", - "default": 1.0e-6, - "type": "number" + "type": "number", + "default": 1.0e-6 }, "reltol": { "format": "double", - "default": 0.001, - "type": "number" + "type": "number", + "default": 0.001 }, - "dtmax": { + "maxiters": { "format": "default", - "anyOf": [ - { - "type": "null" - }, - { - "type": "number" - } - ], - "default": null + "type": "integer", + "default": 1000000000 + }, + "sparse": { + "format": "default", + "type": "boolean", + "default": true + }, + "autodiff": { + "format": "default", + "type": "boolean", + "default": true } }, "required": [ @@ -104,9 +108,5 @@ "maxiters", "sparse", "autodiff" - ], - "$id": "https://deltares.github.io/Ribasim/schema/Solver.schema.json", - "title": "Solver", - "description": "A Solver object based on Ribasim.config.Solver", - "type": "object" + ] } diff --git a/docs/schema/TabulatedRatingCurveStatic.schema.json b/docs/schema/TabulatedRatingCurveStatic.schema.json index cb244575b..0e21b91f0 100644 --- a/docs/schema/TabulatedRatingCurveStatic.schema.json +++ b/docs/schema/TabulatedRatingCurveStatic.schema.json @@ -1,11 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/TabulatedRatingCurveStatic.schema.json", + "title": "TabulatedRatingCurveStatic", + "description": "A TabulatedRatingCurveStatic object based on Ribasim.TabulatedRatingCurveStaticV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "active": { "format": "default", @@ -18,15 +20,11 @@ } ] }, - "node_id": { - "format": "default", - "type": "integer" - }, - "discharge": { + "level": { "format": "double", "type": "number" }, - "level": { + "discharge": { "format": "double", "type": "number" }, @@ -40,15 +38,17 @@ "type": "string" } ] + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id", "level", "discharge" - ], - "$id": "https://deltares.github.io/Ribasim/schema/TabulatedRatingCurveStatic.schema.json", - "title": "TabulatedRatingCurveStatic", - "description": "A TabulatedRatingCurveStatic object based on Ribasim.TabulatedRatingCurveStaticV1", - "type": "object" + ] } diff --git a/docs/schema/TabulatedRatingCurveTime.schema.json b/docs/schema/TabulatedRatingCurveTime.schema.json index 47c2ddeb7..447df4100 100644 --- a/docs/schema/TabulatedRatingCurveTime.schema.json +++ b/docs/schema/TabulatedRatingCurveTime.schema.json @@ -1,27 +1,31 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/TabulatedRatingCurveTime.schema.json", + "title": "TabulatedRatingCurveTime", + "description": "A TabulatedRatingCurveTime object based on Ribasim.TabulatedRatingCurveTimeV1", + "type": "object", "properties": { - "remarks": { + "node_id": { "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" + "type": "integer" }, "time": { "format": "date-time", "type": "string" }, - "node_id": { - "format": "default", - "type": "integer" - }, - "discharge": { + "level": { "format": "double", "type": "number" }, - "level": { + "discharge": { "format": "double", "type": "number" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -29,9 +33,5 @@ "time", "level", "discharge" - ], - "$id": "https://deltares.github.io/Ribasim/schema/TabulatedRatingCurveTime.schema.json", - "title": "TabulatedRatingCurveTime", - "description": "A TabulatedRatingCurveTime object based on Ribasim.TabulatedRatingCurveTimeV1", - "type": "object" + ] } diff --git a/docs/schema/TerminalStatic.schema.json b/docs/schema/TerminalStatic.schema.json index 257433ed7..844d715c7 100644 --- a/docs/schema/TerminalStatic.schema.json +++ b/docs/schema/TerminalStatic.schema.json @@ -1,22 +1,22 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/TerminalStatic.schema.json", + "title": "TerminalStatic", + "description": "A TerminalStatic object based on Ribasim.TerminalStaticV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, "node_id": { "format": "default", "type": "integer" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ "node_id" - ], - "$id": "https://deltares.github.io/Ribasim/schema/TerminalStatic.schema.json", - "title": "TerminalStatic", - "description": "A TerminalStatic object based on Ribasim.TerminalStaticV1", - "type": "object" + ] } diff --git a/docs/schema/UserStatic.schema.json b/docs/schema/UserStatic.schema.json index c6a6ed0e4..35a22871a 100644 --- a/docs/schema/UserStatic.schema.json +++ b/docs/schema/UserStatic.schema.json @@ -1,13 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/UserStatic.schema.json", + "title": "UserStatic", + "description": "A UserStatic object based on Ribasim.UserStaticV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, - "priority": { + "node_id": { "format": "default", "type": "integer" }, @@ -34,9 +32,15 @@ "format": "double", "type": "number" }, - "node_id": { + "priority": { "format": "default", "type": "integer" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -45,9 +49,5 @@ "return_factor", "min_level", "priority" - ], - "$id": "https://deltares.github.io/Ribasim/schema/UserStatic.schema.json", - "title": "UserStatic", - "description": "A UserStatic object based on Ribasim.UserStaticV1", - "type": "object" + ] } diff --git a/docs/schema/UserTime.schema.json b/docs/schema/UserTime.schema.json index 0b930a790..a68256d4a 100644 --- a/docs/schema/UserTime.schema.json +++ b/docs/schema/UserTime.schema.json @@ -1,13 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/UserTime.schema.json", + "title": "UserTime", + "description": "A UserTime object based on Ribasim.UserTimeV1", + "type": "object", "properties": { - "remarks": { - "format": "default", - "default": "", - "description": "a hack for pandera", - "type": "string" - }, - "priority": { + "node_id": { "format": "default", "type": "integer" }, @@ -27,9 +25,15 @@ "format": "double", "type": "number" }, - "node_id": { + "priority": { "format": "default", "type": "integer" + }, + "remarks": { + "description": "a hack for pandera", + "type": "string", + "format": "default", + "default": "" } }, "required": [ @@ -39,9 +43,5 @@ "return_factor", "min_level", "priority" - ], - "$id": "https://deltares.github.io/Ribasim/schema/UserTime.schema.json", - "title": "UserTime", - "description": "A UserTime object based on Ribasim.UserTimeV1", - "type": "object" + ] } diff --git a/docs/schema/basin.schema.json b/docs/schema/basin.schema.json index ab13b0573..743b5ca8b 100644 --- a/docs/schema/basin.schema.json +++ b/docs/schema/basin.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/basin.schema.json", + "title": "basin", + "description": "A basin object based on Ribasim.config.basin", + "type": "object", "properties": { "profile": { "format": "default", @@ -13,7 +17,7 @@ ], "default": null }, - "time": { + "state": { "format": "default", "anyOf": [ { @@ -37,7 +41,7 @@ ], "default": null }, - "state": { + "time": { "format": "default", "anyOf": [ { @@ -51,9 +55,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/basin.schema.json", - "title": "basin", - "description": "A basin object based on Ribasim.config.basin", - "type": "object" + ] } diff --git a/docs/schema/discrete_control.schema.json b/docs/schema/discrete_control.schema.json index 22a244703..5dad798e4 100644 --- a/docs/schema/discrete_control.schema.json +++ b/docs/schema/discrete_control.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/discrete_control.schema.json", + "title": "discrete_control", + "description": "A discrete_control object based on Ribasim.config.discrete_control", + "type": "object", "properties": { - "logic": { + "condition": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "condition": { + "logic": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/discrete_control.schema.json", - "title": "discrete_control", - "description": "A discrete_control object based on Ribasim.config.discrete_control", - "type": "object" + ] } diff --git a/docs/schema/flow_boundary.schema.json b/docs/schema/flow_boundary.schema.json index 29f922f9a..fb14390c2 100644 --- a/docs/schema/flow_boundary.schema.json +++ b/docs/schema/flow_boundary.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/flow_boundary.schema.json", + "title": "flow_boundary", + "description": "A flow_boundary object based on Ribasim.config.flow_boundary", + "type": "object", "properties": { - "time": { + "static": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "static": { + "time": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/flow_boundary.schema.json", - "title": "flow_boundary", - "description": "A flow_boundary object based on Ribasim.config.flow_boundary", - "type": "object" + ] } diff --git a/docs/schema/fractional_flow.schema.json b/docs/schema/fractional_flow.schema.json index 940b2977d..fb3846df0 100644 --- a/docs/schema/fractional_flow.schema.json +++ b/docs/schema/fractional_flow.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/fractional_flow.schema.json", + "title": "fractional_flow", + "description": "A fractional_flow object based on Ribasim.config.fractional_flow", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/fractional_flow.schema.json", - "title": "fractional_flow", - "description": "A fractional_flow object based on Ribasim.config.fractional_flow", - "type": "object" + ] } diff --git a/docs/schema/level_boundary.schema.json b/docs/schema/level_boundary.schema.json index f4c2d70c8..f90b610e7 100644 --- a/docs/schema/level_boundary.schema.json +++ b/docs/schema/level_boundary.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/level_boundary.schema.json", + "title": "level_boundary", + "description": "A level_boundary object based on Ribasim.config.level_boundary", + "type": "object", "properties": { - "time": { + "static": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "static": { + "time": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/level_boundary.schema.json", - "title": "level_boundary", - "description": "A level_boundary object based on Ribasim.config.level_boundary", - "type": "object" + ] } diff --git a/docs/schema/linear_resistance.schema.json b/docs/schema/linear_resistance.schema.json index 96565c7b3..8aefd274f 100644 --- a/docs/schema/linear_resistance.schema.json +++ b/docs/schema/linear_resistance.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/linear_resistance.schema.json", + "title": "linear_resistance", + "description": "A linear_resistance object based on Ribasim.config.linear_resistance", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/linear_resistance.schema.json", - "title": "linear_resistance", - "description": "A linear_resistance object based on Ribasim.config.linear_resistance", - "type": "object" + ] } diff --git a/docs/schema/manning_resistance.schema.json b/docs/schema/manning_resistance.schema.json index aef075138..03bba823d 100644 --- a/docs/schema/manning_resistance.schema.json +++ b/docs/schema/manning_resistance.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/manning_resistance.schema.json", + "title": "manning_resistance", + "description": "A manning_resistance object based on Ribasim.config.manning_resistance", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/manning_resistance.schema.json", - "title": "manning_resistance", - "description": "A manning_resistance object based on Ribasim.config.manning_resistance", - "type": "object" + ] } diff --git a/docs/schema/outlet.schema.json b/docs/schema/outlet.schema.json index 1e6e2efd5..137d0a6d4 100644 --- a/docs/schema/outlet.schema.json +++ b/docs/schema/outlet.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/outlet.schema.json", + "title": "outlet", + "description": "A outlet object based on Ribasim.config.outlet", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/outlet.schema.json", - "title": "outlet", - "description": "A outlet object based on Ribasim.config.outlet", - "type": "object" + ] } diff --git a/docs/schema/pid_control.schema.json b/docs/schema/pid_control.schema.json index 5e7eb7024..75e6763c6 100644 --- a/docs/schema/pid_control.schema.json +++ b/docs/schema/pid_control.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/pid_control.schema.json", + "title": "pid_control", + "description": "A pid_control object based on Ribasim.config.pid_control", + "type": "object", "properties": { - "time": { + "static": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "static": { + "time": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/pid_control.schema.json", - "title": "pid_control", - "description": "A pid_control object based on Ribasim.config.pid_control", - "type": "object" + ] } diff --git a/docs/schema/pump.schema.json b/docs/schema/pump.schema.json index 2679991b2..d1851de89 100644 --- a/docs/schema/pump.schema.json +++ b/docs/schema/pump.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/pump.schema.json", + "title": "pump", + "description": "A pump object based on Ribasim.config.pump", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/pump.schema.json", - "title": "pump", - "description": "A pump object based on Ribasim.config.pump", - "type": "object" + ] } diff --git a/docs/schema/root.schema.json b/docs/schema/root.schema.json index 078a2a82c..ad7a55499 100644 --- a/docs/schema/root.schema.json +++ b/docs/schema/root.schema.json @@ -1,77 +1,77 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { + "BasinProfile": { + "$ref": "BasinProfile.schema.json" + }, + "BasinState": { + "$ref": "BasinState.schema.json" + }, + "BasinStatic": { + "$ref": "BasinStatic.schema.json" + }, "BasinTime": { "$ref": "BasinTime.schema.json" }, + "DiscreteControlCondition": { + "$ref": "DiscreteControlCondition.schema.json" + }, "DiscreteControlLogic": { "$ref": "DiscreteControlLogic.schema.json" }, "Edge": { "$ref": "Edge.schema.json" }, + "FlowBoundaryStatic": { + "$ref": "FlowBoundaryStatic.schema.json" + }, "FlowBoundaryTime": { "$ref": "FlowBoundaryTime.schema.json" }, - "UserStatic": { - "$ref": "UserStatic.schema.json" - }, - "PumpStatic": { - "$ref": "PumpStatic.schema.json" + "FractionalFlowStatic": { + "$ref": "FractionalFlowStatic.schema.json" }, "LevelBoundaryStatic": { "$ref": "LevelBoundaryStatic.schema.json" }, - "UserTime": { - "$ref": "UserTime.schema.json" - }, - "DiscreteControlCondition": { - "$ref": "DiscreteControlCondition.schema.json" + "LevelBoundaryTime": { + "$ref": "LevelBoundaryTime.schema.json" }, "LinearResistanceStatic": { "$ref": "LinearResistanceStatic.schema.json" }, - "FractionalFlowStatic": { - "$ref": "FractionalFlowStatic.schema.json" - }, - "PidControlStatic": { - "$ref": "PidControlStatic.schema.json" - }, - "PidControlTime": { - "$ref": "PidControlTime.schema.json" - }, "ManningResistanceStatic": { "$ref": "ManningResistanceStatic.schema.json" }, - "FlowBoundaryStatic": { - "$ref": "FlowBoundaryStatic.schema.json" + "Node": { + "$ref": "Node.schema.json" }, "OutletStatic": { "$ref": "OutletStatic.schema.json" }, - "Node": { - "$ref": "Node.schema.json" + "PidControlStatic": { + "$ref": "PidControlStatic.schema.json" }, - "TabulatedRatingCurveTime": { - "$ref": "TabulatedRatingCurveTime.schema.json" + "PidControlTime": { + "$ref": "PidControlTime.schema.json" + }, + "PumpStatic": { + "$ref": "PumpStatic.schema.json" }, "TabulatedRatingCurveStatic": { "$ref": "TabulatedRatingCurveStatic.schema.json" }, - "LevelBoundaryTime": { - "$ref": "LevelBoundaryTime.schema.json" - }, - "BasinState": { - "$ref": "BasinState.schema.json" - }, - "BasinProfile": { - "$ref": "BasinProfile.schema.json" + "TabulatedRatingCurveTime": { + "$ref": "TabulatedRatingCurveTime.schema.json" }, "TerminalStatic": { "$ref": "TerminalStatic.schema.json" }, - "BasinStatic": { - "$ref": "BasinStatic.schema.json" + "UserStatic": { + "$ref": "UserStatic.schema.json" + }, + "UserTime": { + "$ref": "UserTime.schema.json" } }, "$id": "https://deltares.github.io/Ribasim/schema/root.schema.json", diff --git a/docs/schema/tabulated_rating_curve.schema.json b/docs/schema/tabulated_rating_curve.schema.json index 2d1beff66..efbb836dd 100644 --- a/docs/schema/tabulated_rating_curve.schema.json +++ b/docs/schema/tabulated_rating_curve.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/tabulated_rating_curve.schema.json", + "title": "tabulated_rating_curve", + "description": "A tabulated_rating_curve object based on Ribasim.config.tabulated_rating_curve", + "type": "object", "properties": { - "time": { + "static": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "static": { + "time": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/tabulated_rating_curve.schema.json", - "title": "tabulated_rating_curve", - "description": "A tabulated_rating_curve object based on Ribasim.config.tabulated_rating_curve", - "type": "object" + ] } diff --git a/docs/schema/terminal.schema.json b/docs/schema/terminal.schema.json index c6ca4c650..b889f7f4d 100644 --- a/docs/schema/terminal.schema.json +++ b/docs/schema/terminal.schema.json @@ -1,5 +1,9 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/terminal.schema.json", + "title": "terminal", + "description": "A terminal object based on Ribasim.config.terminal", + "type": "object", "properties": { "static": { "format": "default", @@ -15,9 +19,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/terminal.schema.json", - "title": "terminal", - "description": "A terminal object based on Ribasim.config.terminal", - "type": "object" + ] } diff --git a/docs/schema/user.schema.json b/docs/schema/user.schema.json index 6fcacadf3..911f49214 100644 --- a/docs/schema/user.schema.json +++ b/docs/schema/user.schema.json @@ -1,7 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://deltares.github.io/Ribasim/schema/user.schema.json", + "title": "user", + "description": "A user object based on Ribasim.config.user", + "type": "object", "properties": { - "time": { + "static": { "format": "default", "anyOf": [ { @@ -13,7 +17,7 @@ ], "default": null }, - "static": { + "time": { "format": "default", "anyOf": [ { @@ -27,9 +31,5 @@ } }, "required": [ - ], - "$id": "https://deltares.github.io/Ribasim/schema/user.schema.json", - "title": "user", - "description": "A user object based on Ribasim.config.user", - "type": "object" + ] } diff --git a/python/ribasim/ribasim/config.py b/python/ribasim/ribasim/config.py index 3ee4ff0a9..cc12c951d 100644 --- a/python/ribasim/ribasim/config.py +++ b/python/ribasim/ribasim/config.py @@ -10,96 +10,103 @@ class Output(BaseModel): - compression: str = "zstd" basin: str = "output/basin.arrow" flow: str = "output/flow.arrow" control: str = "output/control.arrow" outstate: Optional[str] = None + compression: str = "zstd" compression_level: int = 6 -class LevelBoundary(BaseModel): - time: Optional[str] = None - static: Optional[str] = None - - -class User(BaseModel): - time: Optional[str] = None - static: Optional[str] = None - - -class Pump(BaseModel): - static: Optional[str] = None - - -class DiscreteControl(BaseModel): - logic: Optional[str] = None - condition: Optional[str] = None - - class Solver(BaseModel): - autodiff: bool = True + algorithm: str = "QNDF" + saveat: Union[float, List[float]] = [] adaptive: bool = True - force_dtmin: bool = False dt: Optional[float] = None - saveat: Union[List[float], float] = [] - maxiters: int = 1000000000 dtmin: Optional[float] = None - sparse: bool = True - algorithm: str = "QNDF" + dtmax: Optional[float] = None + force_dtmin: bool = False abstol: float = 1e-06 reltol: float = 0.001 - dtmax: Optional[float] = None + maxiters: int = 1000000000 + sparse: bool = True + autodiff: bool = True -class FlowBoundary(BaseModel): - time: Optional[str] = None +class Logging(BaseModel): + verbosity: str = "info" + timing: bool = False + + +class Terminal(BaseModel): static: Optional[str] = None class PidControl(BaseModel): - time: Optional[str] = None static: Optional[str] = None + time: Optional[str] = None -class FractionalFlow(BaseModel): +class LevelBoundary(BaseModel): static: Optional[str] = None + time: Optional[str] = None -class ManningResistance(BaseModel): +class Pump(BaseModel): static: Optional[str] = None class TabulatedRatingCurve(BaseModel): - time: Optional[str] = None static: Optional[str] = None + time: Optional[str] = None -class Logging(BaseModel): - timing: bool = False - verbosity: str = "info" - - -class Outlet(BaseModel): +class User(BaseModel): static: Optional[str] = None + time: Optional[str] = None -class Terminal(BaseModel): +class FlowBoundary(BaseModel): static: Optional[str] = None + time: Optional[str] = None class Basin(BaseModel): profile: Optional[str] = None + state: Optional[str] = None + static: Optional[str] = None time: Optional[str] = None + + +class ManningResistance(BaseModel): + static: Optional[str] = None + + +class DiscreteControl(BaseModel): + condition: Optional[str] = None + logic: Optional[str] = None + + +class Outlet(BaseModel): static: Optional[str] = None - state: Optional[str] = None class LinearResistance(BaseModel): static: Optional[str] = None +class FractionalFlow(BaseModel): + static: Optional[str] = None + + class Config(BaseModel): + starttime: datetime + endtime: datetime + update_timestep: float = 86400 + relative_dir: str = "." + input_dir: str = "." + output_dir: str = "." + geopackage: str output: Output = Field( default_factory=lambda: Output.parse_obj( { @@ -112,22 +119,6 @@ class Config(BaseModel): } ) ) - starttime: datetime - update_timestep: float = 86400 - input_dir: str = "." - output_dir: str = "." - level_boundary: LevelBoundary = Field( - default_factory=lambda: LevelBoundary.parse_obj({"static": None, "time": None}) - ) - user: User = Field( - default_factory=lambda: User.parse_obj({"static": None, "time": None}) - ) - pump: Pump = Field(default_factory=lambda: Pump.parse_obj({"static": None})) - discrete_control: DiscreteControl = Field( - default_factory=lambda: DiscreteControl.parse_obj( - {"condition": None, "logic": None} - ) - ) solver: Solver = Field( default_factory=lambda: Solver.parse_obj( { @@ -146,40 +137,49 @@ class Config(BaseModel): } ) ) - flow_boundary: FlowBoundary = Field( - default_factory=lambda: FlowBoundary.parse_obj({"static": None, "time": None}) + logging: Logging = Field( + default_factory=lambda: Logging.parse_obj( + {"verbosity": {"level": 0}, "timing": False} + ) + ) + terminal: Terminal = Field( + default_factory=lambda: Terminal.parse_obj({"static": None}) ) pid_control: PidControl = Field( default_factory=lambda: PidControl.parse_obj({"static": None, "time": None}) ) - fractional_flow: FractionalFlow = Field( - default_factory=lambda: FractionalFlow.parse_obj({"static": None}) - ) - relative_dir: str = "." - endtime: datetime - manning_resistance: ManningResistance = Field( - default_factory=lambda: ManningResistance.parse_obj({"static": None}) + level_boundary: LevelBoundary = Field( + default_factory=lambda: LevelBoundary.parse_obj({"static": None, "time": None}) ) + pump: Pump = Field(default_factory=lambda: Pump.parse_obj({"static": None})) tabulated_rating_curve: TabulatedRatingCurve = Field( default_factory=lambda: TabulatedRatingCurve.parse_obj( {"static": None, "time": None} ) ) - logging: Logging = Field( - default_factory=lambda: Logging.parse_obj( - {"verbosity": {"level": 0}, "timing": False} - ) + user: User = Field( + default_factory=lambda: User.parse_obj({"static": None, "time": None}) ) - outlet: Outlet = Field(default_factory=lambda: Outlet.parse_obj({"static": None})) - geopackage: str - terminal: Terminal = Field( - default_factory=lambda: Terminal.parse_obj({"static": None}) + flow_boundary: FlowBoundary = Field( + default_factory=lambda: FlowBoundary.parse_obj({"static": None, "time": None}) ) basin: Basin = Field( default_factory=lambda: Basin.parse_obj( {"profile": None, "state": None, "static": None, "time": None} ) ) + manning_resistance: ManningResistance = Field( + default_factory=lambda: ManningResistance.parse_obj({"static": None}) + ) + discrete_control: DiscreteControl = Field( + default_factory=lambda: DiscreteControl.parse_obj( + {"condition": None, "logic": None} + ) + ) + outlet: Outlet = Field(default_factory=lambda: Outlet.parse_obj({"static": None})) linear_resistance: LinearResistance = Field( default_factory=lambda: LinearResistance.parse_obj({"static": None}) ) + fractional_flow: FractionalFlow = Field( + default_factory=lambda: FractionalFlow.parse_obj({"static": None}) + ) diff --git a/python/ribasim/ribasim/models.py b/python/ribasim/ribasim/models.py index f1a157823..e68def42d 100644 --- a/python/ribasim/ribasim/models.py +++ b/python/ribasim/ribasim/models.py @@ -9,233 +9,233 @@ from pydantic import BaseModel, Field -class BasinTime(BaseModel): +class BasinProfile(BaseModel): + node_id: int + area: float + level: float remarks: str = Field("", description="a hack for pandera") - time: datetime - precipitation: float + + +class BasinState(BaseModel): + node_id: int + level: float + remarks: str = Field("", description="a hack for pandera") + + +class BasinStatic(BaseModel): + node_id: int + drainage: float + potential_evaporation: float infiltration: float + precipitation: float urban_runoff: float + remarks: str = Field("", description="a hack for pandera") + + +class BasinTime(BaseModel): node_id: int - potential_evaporation: float + time: datetime drainage: float + potential_evaporation: float + infiltration: float + precipitation: float + urban_runoff: float + remarks: str = Field("", description="a hack for pandera") -class DiscreteControlLogic(BaseModel): +class DiscreteControlCondition(BaseModel): + node_id: int + listen_feature_id: int + variable: str + greater_than: float + look_ahead: Optional[float] = None remarks: str = Field("", description="a hack for pandera") - truth_state: str + + +class DiscreteControlLogic(BaseModel): node_id: int + truth_state: str control_state: str + remarks: str = Field("", description="a hack for pandera") class Edge(BaseModel): - remarks: str = Field("", description="a hack for pandera") - edge_type: str fid: int - to_node_id: int from_node_id: int + to_node_id: int + edge_type: str + remarks: str = Field("", description="a hack for pandera") -class FlowBoundaryTime(BaseModel): - remarks: str = Field("", description="a hack for pandera") - time: datetime - flow_rate: float +class FlowBoundaryStatic(BaseModel): node_id: int + active: Optional[bool] = None + flow_rate: float + remarks: str = Field("", description="a hack for pandera") -class UserStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") - priority: int - active: Optional[bool] = None - demand: float - return_factor: float - min_level: float +class FlowBoundaryTime(BaseModel): node_id: int + time: datetime + flow_rate: float + remarks: str = Field("", description="a hack for pandera") -class PumpStatic(BaseModel): - max_flow_rate: Optional[float] = None - remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None - flow_rate: float +class FractionalFlowStatic(BaseModel): node_id: int + fraction: float control_state: Optional[str] = None - min_flow_rate: Optional[float] = None + remarks: str = Field("", description="a hack for pandera") class LevelBoundaryStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None node_id: int + active: Optional[bool] = None level: float - - -class UserTime(BaseModel): remarks: str = Field("", description="a hack for pandera") - priority: int - time: datetime - demand: float - return_factor: float - min_level: float - node_id: int -class DiscreteControlCondition(BaseModel): - remarks: str = Field("", description="a hack for pandera") - greater_than: float - listen_feature_id: int +class LevelBoundaryTime(BaseModel): node_id: int - variable: str - look_ahead: Optional[float] = None + time: datetime + level: float + remarks: str = Field("", description="a hack for pandera") class LinearResistanceStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None node_id: int + active: Optional[bool] = None resistance: float control_state: Optional[str] = None + remarks: str = Field("", description="a hack for pandera") -class FractionalFlowStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") +class ManningResistanceStatic(BaseModel): node_id: int - fraction: float + active: Optional[bool] = None + length: float + manning_n: float + profile_width: float + profile_slope: float control_state: Optional[str] = None + remarks: str = Field("", description="a hack for pandera") -class PidControlStatic(BaseModel): - integral: float +class Node(BaseModel): + fid: int + type: str remarks: str = Field("", description="a hack for pandera") - listen_node_id: int + + +class OutletStatic(BaseModel): + node_id: int active: Optional[bool] = None - proportional: float + flow_rate: float + min_flow_rate: Optional[float] = None + max_flow_rate: Optional[float] = None + min_crest_level: Optional[float] = None + control_state: Optional[str] = None + remarks: str = Field("", description="a hack for pandera") + + +class PidControlStatic(BaseModel): node_id: int + active: Optional[bool] = None + listen_node_id: int target: float + proportional: float + integral: float derivative: float control_state: Optional[str] = None + remarks: str = Field("", description="a hack for pandera") class PidControlTime(BaseModel): - integral: float - remarks: str = Field("", description="a hack for pandera") + node_id: int listen_node_id: int time: datetime - proportional: float - node_id: int target: float + proportional: float + integral: float derivative: float control_state: Optional[str] = None - - -class ManningResistanceStatic(BaseModel): - length: float - manning_n: float remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None - profile_width: float - node_id: int - profile_slope: float - control_state: Optional[str] = None -class FlowBoundaryStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None - flow_rate: float +class PumpStatic(BaseModel): node_id: int - - -class OutletStatic(BaseModel): - max_flow_rate: Optional[float] = None - remarks: str = Field("", description="a hack for pandera") active: Optional[bool] = None - min_crest_level: Optional[float] = None flow_rate: float - node_id: int - control_state: Optional[str] = None min_flow_rate: Optional[float] = None - - -class Node(BaseModel): - remarks: str = Field("", description="a hack for pandera") - fid: int - type: str - - -class TabulatedRatingCurveTime(BaseModel): + max_flow_rate: Optional[float] = None + control_state: Optional[str] = None remarks: str = Field("", description="a hack for pandera") - time: datetime - node_id: int - discharge: float - level: float class TabulatedRatingCurveStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") - active: Optional[bool] = None node_id: int - discharge: float + active: Optional[bool] = None level: float + discharge: float control_state: Optional[str] = None - - -class LevelBoundaryTime(BaseModel): remarks: str = Field("", description="a hack for pandera") - time: datetime - node_id: int - level: float -class BasinState(BaseModel): - remarks: str = Field("", description="a hack for pandera") +class TabulatedRatingCurveTime(BaseModel): node_id: int + time: datetime level: float - - -class BasinProfile(BaseModel): + discharge: float remarks: str = Field("", description="a hack for pandera") - area: float - node_id: int - level: float class TerminalStatic(BaseModel): - remarks: str = Field("", description="a hack for pandera") node_id: int + remarks: str = Field("", description="a hack for pandera") -class BasinStatic(BaseModel): +class UserStatic(BaseModel): + node_id: int + active: Optional[bool] = None + demand: float + return_factor: float + min_level: float + priority: int remarks: str = Field("", description="a hack for pandera") - precipitation: float - infiltration: float - urban_runoff: float + + +class UserTime(BaseModel): node_id: int - potential_evaporation: float - drainage: float + time: datetime + demand: float + return_factor: float + min_level: float + priority: int + remarks: str = Field("", description="a hack for pandera") class Root(BaseModel): + BasinProfile: Optional[BasinProfile] = None + BasinState: Optional[BasinState] = None + BasinStatic: Optional[BasinStatic] = None BasinTime: Optional[BasinTime] = None + DiscreteControlCondition: Optional[DiscreteControlCondition] = None DiscreteControlLogic: Optional[DiscreteControlLogic] = None Edge: Optional[Edge] = None + FlowBoundaryStatic: Optional[FlowBoundaryStatic] = None FlowBoundaryTime: Optional[FlowBoundaryTime] = None - UserStatic: Optional[UserStatic] = None - PumpStatic: Optional[PumpStatic] = None + FractionalFlowStatic: Optional[FractionalFlowStatic] = None LevelBoundaryStatic: Optional[LevelBoundaryStatic] = None - UserTime: Optional[UserTime] = None - DiscreteControlCondition: Optional[DiscreteControlCondition] = None + LevelBoundaryTime: Optional[LevelBoundaryTime] = None LinearResistanceStatic: Optional[LinearResistanceStatic] = None - FractionalFlowStatic: Optional[FractionalFlowStatic] = None - PidControlStatic: Optional[PidControlStatic] = None - PidControlTime: Optional[PidControlTime] = None ManningResistanceStatic: Optional[ManningResistanceStatic] = None - FlowBoundaryStatic: Optional[FlowBoundaryStatic] = None - OutletStatic: Optional[OutletStatic] = None Node: Optional[Node] = None - TabulatedRatingCurveTime: Optional[TabulatedRatingCurveTime] = None + OutletStatic: Optional[OutletStatic] = None + PidControlStatic: Optional[PidControlStatic] = None + PidControlTime: Optional[PidControlTime] = None + PumpStatic: Optional[PumpStatic] = None TabulatedRatingCurveStatic: Optional[TabulatedRatingCurveStatic] = None - LevelBoundaryTime: Optional[LevelBoundaryTime] = None - BasinState: Optional[BasinState] = None - BasinProfile: Optional[BasinProfile] = None + TabulatedRatingCurveTime: Optional[TabulatedRatingCurveTime] = None TerminalStatic: Optional[TerminalStatic] = None - BasinStatic: Optional[BasinStatic] = None + UserStatic: Optional[UserStatic] = None + UserTime: Optional[UserTime] = None