From 4a4fd85841179b7ff42f04ba18f1e7a952b30911 Mon Sep 17 00:00:00 2001 From: Uros Rapajic Date: Fri, 13 Jan 2023 17:06:40 +0000 Subject: [PATCH] to_scipy_sparse_matrix -> to_scipy_sparse_array --- fa2/forceatlas2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fa2/forceatlas2.py b/fa2/forceatlas2.py index 5436e64..a5d94f4 100644 --- a/fa2/forceatlas2.py +++ b/fa2/forceatlas2.py @@ -245,7 +245,7 @@ def forceatlas2_networkx_layout(self, G, pos=None, iterations=100, weight_attr=N or (cynetworkx and isinstance(G, cynetworkx.classes.graph.Graph)) ), "Not a networkx graph" assert isinstance(pos, dict) or (pos is None), "pos must be specified as a dictionary, as in networkx" - M = networkx.to_scipy_sparse_matrix(G, dtype='f', format='lil', weight=weight_attr) + M = networkx.to_scipy_sparse_array(G, dtype='f', format='lil', weight=weight_attr) if pos is None: l = self.forceatlas2(M, pos=None, iterations=iterations) else: @@ -258,8 +258,8 @@ def forceatlas2_networkx_layout(self, G, pos=None, iterations=100, weight_attr=N # This function returns an igraph layout def forceatlas2_igraph_layout(self, G, pos=None, iterations=100, weight_attr=None): - from scipy.sparse import csr_matrix import igraph + from scipy.sparse import csr_matrix def to_sparse(graph, weight_attr=None): edges = graph.get_edgelist()