Skip to content

Commit

Permalink
fix issue in _igraph_to_sparse with Scipy>=1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Apr 7, 2024
1 parent 99e4eda commit 534ecd7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions navis/graph/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1770,8 +1770,11 @@ def _igraph_to_sparse(graph, weight_attr=None):
if not graph.is_directed():
edges.extend([(v, u) for u, v in edges])
weights.extend(weights)
return csr_matrix((weights, zip(*edges)),
shape=(len(graph.vs), len(graph.vs)))
# Note: previously, we used a generator (weights, zip(*egdes)) as input to
# csr_matrix but with Scipy 1.13.0 this has stopped working
edges = np.array(edges)
return csr_matrix((weights, (edges[:,0], edges[:,1])),
shape=(len(graph.vs), len(graph.vs)))


def connected_subgraph(x: Union['core.TreeNeuron', nx.DiGraph],
Expand Down

0 comments on commit 534ecd7

Please sign in to comment.