Skip to content

Commit

Permalink
resolve pandas deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklise committed May 7, 2024
1 parent ea7d97a commit de198fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wntr/metrics/topographic.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def valve_segments(G, valve_layer):
# and label link and unvalved node together
if link_valves.shape[0] == 1:
both_node_names = [node1_name, node2_name]
valved_node_name = link_valves.iloc[0][1]
valved_node_name = link_valves.iloc[0]['node']
both_node_names.remove(valved_node_name)
unvalved_node_name = both_node_names[0]
unvalved_node_index = all_names.index('N_'+unvalved_node_name)
Expand All @@ -281,7 +281,7 @@ def valve_segments(G, valve_layer):
seg_label[link_index] = seg_label[unvalved_node_index]

# Links with link_valves.size == 2 are already labelled (isolated link)
elif link_valves.shape[0] ==2:
elif link_valves.shape[0] == 2:
continue
else:
raise Exception("Each link should have a maximum of two valves.")
Expand Down

0 comments on commit de198fa

Please sign in to comment.