Skip to content

Commit

Permalink
Update usage of deprecated NetworkX adjacency matrix to graph convers…
Browse files Browse the repository at this point in the history
…ion function.
  • Loading branch information
wlruys committed Feb 17, 2024
1 parent 3ced286 commit ef0e0b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions hypernetx/classes/hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef0e0b1

Please sign in to comment.