Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check whether outlet code exists in connection nodes. #61

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading