From 649e538bee48baf0289b0da31ea6a970e39488a9 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Tue, 21 May 2024 13:02:21 +0200 Subject: [PATCH 1/4] Fix QGIS 'LevelDemand / static' schema --- ribasim_qgis/core/nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ribasim_qgis/core/nodes.py b/ribasim_qgis/core/nodes.py index 97682e780..bcf3f4544 100644 --- a/ribasim_qgis/core/nodes.py +++ b/ribasim_qgis/core/nodes.py @@ -848,7 +848,8 @@ def geometry_type(cls) -> str: def attributes(cls) -> list[QgsField]: return [ QgsField("node_id", QVariant.Int), - QgsField("level_demand", QVariant.Double), + QgsField("min_level", QVariant.Double), + QgsField("max_level", QVariant.Double), QgsField("priority", QVariant.Int), ] From 39d15cad3ff22923588362b7f3b1bf187a1b2b9c Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Tue, 21 May 2024 13:08:12 +0200 Subject: [PATCH 2/4] Clarify edge type --- docs/core/usage.qmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/core/usage.qmd b/docs/core/usage.qmd index df5fa605c..9ba74e271 100644 --- a/docs/core/usage.qmd +++ b/docs/core/usage.qmd @@ -514,7 +514,8 @@ min_level | Float64 | $m$ | - # LevelDemand {#sec-level_demand} -A `LevelDemand` node associates a minimum and a maximum level with connected basins to be used by the allocation algorithm. +A `LevelDemand` node associates a minimum and a maximum level with connected Basins to be used by the allocation algorithm. +Since this connection conveys information rather than flow, an outgoing control edge must be used. Below the minimum level the basin has a demand of the supplied priority, above the maximum level the basin has a surplus and acts as a source, used by all nodes with demands in order of priority. The same `LevelDemand` node can be used for Basins in different subnetworks. From 1c756d78da7efb45155835613e8c2affd53e0da4 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Tue, 21 May 2024 13:39:28 +0200 Subject: [PATCH 3/4] Add allocation.arrow clarification --- docs/core/usage.qmd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/core/usage.qmd b/docs/core/usage.qmd index 9ba74e271..a45948df6 100644 --- a/docs/core/usage.qmd +++ b/docs/core/usage.qmd @@ -859,6 +859,11 @@ demand | Float64 allocated | Float64 realized | Float64 +::: {.callout-note} +The LevelDemand node allocations are listed as node type Basin. +This is because one LevelDemand node can control multiple Basins, and doesn't receive flow by itself. +::: + For Basins the values `demand`, `allocated` and `realized` are positive if the Basin level is below the minimum level given by a `LevelDemand` node. The values are negative if the Basin supplies due to a surplus of water. From 7b6468c699faaed35ac19b23f0c7364a32cc3600 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Tue, 21 May 2024 15:09:42 +0200 Subject: [PATCH 4/4] Update docs/core/usage.qmd --- docs/core/usage.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/usage.qmd b/docs/core/usage.qmd index a45948df6..a76f603ab 100644 --- a/docs/core/usage.qmd +++ b/docs/core/usage.qmd @@ -861,7 +861,7 @@ realized | Float64 ::: {.callout-note} The LevelDemand node allocations are listed as node type Basin. -This is because one LevelDemand node can control multiple Basins, and doesn't receive flow by itself. +This is because one LevelDemand node can link to multiple Basins, and doesn't receive flow by itself. ::: For Basins the values `demand`, `allocated` and `realized` are positive if the Basin level is below the minimum level given by a `LevelDemand` node.