From ef0e0b127d8085fc972c319246a3b546a7c7297d Mon Sep 17 00:00:00 2001 From: dialecticDolt Date: Fri, 16 Feb 2024 19:55:21 -0600 Subject: [PATCH] Update usage of deprecated NetworkX adjacency matrix to graph conversion function. --- hypernetx/classes/hypergraph.py | 8 ++++---- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hypernetx/classes/hypergraph.py b/hypernetx/classes/hypergraph.py index 2a3c3037..4583fa98 100644 --- a/hypernetx/classes/hypergraph.py +++ b/hypernetx/classes/hypergraph.py @@ -1858,7 +1858,7 @@ def node_diameters(self, s=1): list of the s-component nodes """ A, coldict = self.adjacency_matrix(s=s, index=True) - G = nx.from_scipy_sparse_matrix(A) + G = nx.from_scipy_sparse_array(A) diams = [] comps = [] for c in nx.connected_components(G): @@ -1892,7 +1892,7 @@ def edge_diameters(self, s=1): """ A, coldict = self.edge_adjacency_matrix(s=s, index=True) - G = nx.from_scipy_sparse_matrix(A) + G = nx.from_scipy_sparse_array(A) diams = [] comps = [] for c in nx.connected_components(G): @@ -1933,7 +1933,7 @@ def diameter(self, s=1): """ A = self.adjacency_matrix(s=s) - G = nx.from_scipy_sparse_matrix(A) + G = nx.from_scipy_sparse_array(A) if nx.is_connected(G): return nx.diameter(G) @@ -1967,7 +1967,7 @@ def edge_diameter(self, s=1): """ A = self.edge_adjacency_matrix(s=s) - G = nx.from_scipy_sparse_matrix(A) + G = nx.from_scipy_sparse_array(A) if nx.is_connected(G): return nx.diameter(G) diff --git a/setup.cfg b/setup.cfg index c195f0e7..900b2fa9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -60,7 +60,7 @@ packages = hypernetx.utils hypernetx.utils.toys install_requires = - networkx>=2.2,<3.0 + networkx>=2.2,<4.0 numpy>=1.24.0,<2.0 scipy>=1.1.0,<2.0 matplotlib>3.0