Skip to content

Commit

Permalink
Comments adressed
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Apr 16, 2024
1 parent 3707f50 commit a140316
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions core/src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions docs/core/usage.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-------------------- | -------- | ------- | -----------
Expand Down
1 change: 0 additions & 1 deletion python/ribasim/ribasim/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit a140316

Please sign in to comment.