Skip to content

Commit

Permalink
Update graph_utilities.py
Browse files Browse the repository at this point in the history
remove old change
  • Loading branch information
Dobson committed May 8, 2024
1 parent 830ed7f commit b347dbf
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions swmmanywhere/graph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,28 +913,6 @@ def __call__(self,
# Copy graph to run shortest path on
G_ = G.copy()

if not matched_outlets:
# In cases of e.g., an area with no rivers to discharge into or too
# small a buffer

# Identify the lowest elevation node
lowest_elevation_node = min(G.nodes,
key = lambda x: G.nodes[x]['surface_elevation'])

# Create a dummy river to discharge into
dummy_river = {'id' : 'dummy_river',
'x' : G.nodes[lowest_elevation_node]['x'] + 1,
'y' : G.nodes[lowest_elevation_node]['y'] + 1}
G_.add_node('dummy_river')
nx.set_node_attributes(G_, {'dummy_river' : dummy_river})

# Update function's dicts
matched_outlets = {'dummy_river' : lowest_elevation_node}
river_points['dummy_river'] = shapely.Point(dummy_river['x'],
dummy_river['y'])

logger.warning('No outlets found, using lowest elevation node as outlet')

# Add edges between the paired river and street nodes
for river_id, street_id in matched_outlets.items():
# TODO instead use a weight based on the distance between the two nodes
Expand Down

0 comments on commit b347dbf

Please sign in to comment.