From a140316ea9c8d0cfe70d6d19004fa175fc513cf9 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 16 Apr 2024 19:24:01 +0200 Subject: [PATCH] Comments adressed --- core/src/validation.jl | 2 -- docs/core/usage.qmd | 4 ++-- python/ribasim/ribasim/model.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/src/validation.jl b/core/src/validation.jl index cf42c6a4c..ae039a561 100644 --- a/core/src/validation.jl +++ b/core/src/validation.jl @@ -574,8 +574,6 @@ function valid_discrete_control(p::Parameters, config::Config)::Bool for (Δt, var, node_id) in zip(look_aheads, variables, listen_node_ids) if !iszero(Δt) node_type = node_id.type - # TODO: If more transient listen variables must be supported, this validation must be more specific - # (e.g. for some node some variables are transient, some not). if node_type ∉ [NodeType.FlowBoundary, NodeType.LevelBoundary] errors = true @error "Look ahead supplied for non-timeseries listen variable '$var' from listen node $node_id." diff --git a/docs/core/usage.qmd b/docs/core/usage.qmd index a736c41cd..88374f8ef 100644 --- a/docs/core/usage.qmd +++ b/docs/core/usage.qmd @@ -639,7 +639,7 @@ which can be for instance an average or a difference of variables. If a variable column | type | unit | restriction -------------------- | -------- | ------- | ----------- node_id | Int32 | - | sorted -compound_variable_id | String | - | sorted per node_id +compound_variable_id | Int32 | - | sorted per node_id listen_node_type | String | - | known node type listen_node_id | Int32 | - | sorted per node_id variable | String | - | must be "level" or "flow_rate", sorted per listen_node_id @@ -648,7 +648,7 @@ look_ahead | Float64 | $s$ | Only on transient boundary condition ## DiscreteControl / condition -The condition schema defines conditions of the form 'the `discrete_control` node with this `node_id`listens to whether the variable given by the `node_id` and `compound_variable_id` is greater than `greater_than`'. If the condition variable comes from a time-series, a look ahead $\Delta t$ can be supplied. Multiple conditions with different `greater_than` values can be defined on the same compound_variable. +The condition schema defines conditions of the form 'the `discrete_control` node with this `node_id`listens to whether the variable given by the `node_id` and `compound_variable_id` is greater than `greater_than`'. Multiple conditions with different `greater_than` values can be defined on the same compound_variable. column | type | unit | restriction -------------------- | -------- | ------- | ----------- diff --git a/python/ribasim/ribasim/model.py b/python/ribasim/ribasim/model.py index 966a65888..2b4f195ef 100644 --- a/python/ribasim/ribasim/model.py +++ b/python/ribasim/ribasim/model.py @@ -326,7 +326,6 @@ def plot_control_listen(self, ax): to_add = df_variable[ ["node_id", "listen_node_id", "listen_node_type"] ].drop_duplicates() - to_add = to_add[to_add["listen_node_type"] != "compound"] to_add.columns = ["control_node_id", "listen_node_id", "listen_node_type"] to_add["control_node_type"] = "DiscreteControl" df_listen_edge = pd.concat([df_listen_edge, to_add])