Skip to content

Commit

Permalink
Remove deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Heidi Tong committed May 14, 2021
1 parent 24c5339 commit 2386fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def set_up_scenario(w, h, num_poi, num_cs):
""" Build scenario set up with specified parameters. """

G = nx.grid_2d_graph(w, h)
nodes = G.nodes()
nodes = list(G.nodes)

# Identify a fixed set of points of interest
pois = random.sample(nodes, k=num_poi)
Expand All @@ -76,7 +76,7 @@ def set_up_scenario(w, h, num_poi, num_cs):
charging_stations = random.sample(nodes, k=num_cs)

# Identify potential new charging locations
potential_new_cs_nodes = list(nodes - charging_stations)
potential_new_cs_nodes = list(G.nodes() - charging_stations)

return G, pois, charging_stations, potential_new_cs_nodes

Expand Down

0 comments on commit 2386fb1

Please sign in to comment.