Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QGIS 'LevelDemand / static' schema #1489

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/core/usage.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -858,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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

control might be a confusing word here

visr marked this conversation as resolved.
Show resolved Hide resolved
:::

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.

Expand Down
3 changes: 2 additions & 1 deletion ribasim_qgis/core/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]

Expand Down