Skip to content

Commit

Permalink
Update graph_utilities.py
Browse files Browse the repository at this point in the history
fix function
  • Loading branch information
barneydobson committed Mar 11, 2024
1 parent 5320980 commit 71ff158
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions swmmanywhere/graph_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,14 @@ def __call__(self, G: nx.Graph, **kwargs) -> nx.Graph:
weights = [1, 0, 0, 1]

# Calculate weights
chahinian_weights = [
{(u,v): np.interp(d['surface_slope'] * 100,
chahinian_weights = {
(u,v): np.interp(d['surface_slope'] * 100,
angle_points,
weights,
left=1.0,
right=1.0)}
for u, v, d in G.edges(data=True)]
right=1.0)
for u, v, d in G.edges(data=True)}


# Update graph
nx.set_edge_attributes(G, chahinian_weights, 'chahinian_slope')
Expand Down

0 comments on commit 71ff158

Please sign in to comment.