From 4481046dcfb411417f8cd85f494b25b062008500 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Fri, 17 Nov 2023 14:57:42 +0100 Subject: [PATCH] Update docs --- docs/contribute/addnode.qmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/contribute/addnode.qmd b/docs/contribute/addnode.qmd index 755aea615..df21af083 100644 --- a/docs/contribute/addnode.qmd +++ b/docs/contribute/addnode.qmd @@ -12,7 +12,7 @@ The parameters object (defined in `solve.jl`) passed to the ODE solver must be m ```julia struct NewNodeType - node_id::Vector{Int} + node_id::Vector{NodeID} # Other fields end ``` @@ -57,7 +57,7 @@ function NewNodeType(db::DB, config::Config)::NewNodeType # Unpack the fields of static as inputs for the NewNodeType constructor return NewNodeType( - parsed_parameters.node_id, + NodeID.(parsed_parameters.node_id), parsed_parameters.some_property, parsed_parameters.control_mapping) end @@ -189,13 +189,13 @@ class NewNodeTypeStatic: The new node type might have associated restrictions for a model with the new node type so that it behaves properly. Basic node ID and node type validation happens in `Model.validate_model` in `python/ribasim/ribasim/model.py`, which automatically considers all node types in the `node_types` module. -Connectivity validation happens in `valid_edges` and `valid_n_flow_neighbors` in `core/src/solve.jl`. Connectivity rules are specified in `core/src/validation.jl`. Allowed upstream and downstream neighbor types for `NewNodeType` in are specified as follows: +Connectivity validation happens in `valid_edges` and `valid_n_flow_neighbors` in `core/src/solve.jl`. Connectivity rules are specified in `core/src/validation.jl`. Allowed upstream and downstream neighbor types for `new_node_type` (the snake case version of `NewNodeType`) are specified as follows: ```julia # set allowed downstream types -neighbortypes(::Val{:NewNodeType}) = Set((:Basin,)) +neighbortypes(::Val{:new_node_type}) = Set((:basin,)) # add your newnodetype as acceptable downstream connection of other types -neighbortypes(::Val{:Pump}) = Set((:Basin, :NewNodeType)) +neighbortypes(::Val{:pump}) = Set((:basin, :new_node_type)) ``` The minimum and maximum allowed number of inneighbors and outneighbors for `NewNodeType` are specified as follows: