Skip to content

Commit

Permalink
Merge pull request #61 from nens/out_code_check
Browse files Browse the repository at this point in the history
Added check whether outlet code exists in connection nodes.
  • Loading branch information
benvanbasten-ns authored Nov 11, 2024
2 parents 5f00805 + 4465330 commit b6ed7f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog of hydxlib
1.5.3 (unreleased)
------------------

- Nothing changed yet.
- Added check whether outlet code exists in connection nodes.


1.5.2 (2024-03-21)
Expand Down
6 changes: 5 additions & 1 deletion hydxlib/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ def write_threedi_to_db(threedi, threedi_db_settings):
# because of constraints) TO DO: bounds aan meerdere leidingen overslaan
outlet_list = []
for outlet in threedi.outlets:
outlet["connection_node_id"] = connection_node_dict[outlet["node.code"]]
if outlet["node.code"] in connection_node_dict:
outlet["connection_node_id"] = connection_node_dict[outlet["node.code"]]
else:
outlet["connection_node_id"] = None
logger.error("Node of outlet not found in connection nodes")
del outlet["node.code"]
outlet_list.append(BoundaryCondition1D(**outlet))

Expand Down

0 comments on commit b6ed7f4

Please sign in to comment.