Ribasim icon indicating copy to clipboard operation
Ribasim copied to clipboard

Validate uniqueness of Node table in core

Open visr opened this issue 1 year ago • 2 comments

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.

visr avatar Mar 13 '24 20:03 visr

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

SouthEndMusic avatar Mar 14 '24 07:03 SouthEndMusic

Great, I updated the issue to just cover the Node case.

visr avatar Mar 14 '24 08:03 visr