Commit 8dfafc58 authored by Runar Borge's avatar Runar Borge
Browse files

Update networkx to version 2.4

This removes functions deprecated in networkx 2.1
parent 559cddf5
......@@ -85,8 +85,8 @@ class MetricShell(Cmd):
difflen = nx.average_shortest_path_length(self.simulation.graph)\
- nx.average_shortest_path_length(self.model.G)
components = list(nx.connected_component_subgraphs(
self.simulation.graph.to_undirected()))
components = list(self.model.G.subgraph(c) for c in nx.connected_components(
self.model.graph.to_undirected()))
cnodes = 0
if len(components) > 1:
cnodes = sum([len(g.nodes()) for g in components[1:]])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment