Ribasim
Ribasim copied to clipboard
Validate uniqueness of Node table in core
Having a duplicate edge (#1255), results in a late error while writing results. We should add validation code to check for duplicates in the Node and Edge tables.
For Node this means the combination of node_type and node_id must be unique.
For Edge this means the combination of from_node_type, from_node_id, to_node_type and to_node_id must be unique.
I noticed that this gave problems in the core, so I added this in my flow_demand branch for duplicate edges:
https://github.com/Deltares/Ribasim/blob/d6ff7af2ee6e46e6ae96d709a5411e608d9548f7/core/src/graph.jl#L81C1-L84C12
Great, I updated the issue to just cover the Node case.