Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future-proofing and improve tests #7209

Merged
merged 4 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions networkx/algorithms/centrality/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,15 @@ def _heuristic(k, root, DF_tree, D, nodes, greedy):
/ root_node["sigma"][added_node][y]
)
DF_tree.nodes[node_p]["sigma"][x][y] = root_node["sigma"][x][y] * (1 - dxvy)
DF_tree.nodes[node_p]["betweenness"][x][y] = (
DF_tree.nodes[node_p]["betweenness"].loc[y, x] = (
root_node["betweenness"][x][y] - root_node["betweenness"][x][y] * dxvy
)
if y != added_node:
DF_tree.nodes[node_p]["betweenness"][x][y] -= (
DF_tree.nodes[node_p]["betweenness"].loc[y, x] -= (
root_node["betweenness"][x][added_node] * dxyv
)
if x != added_node:
DF_tree.nodes[node_p]["betweenness"][x][y] -= (
DF_tree.nodes[node_p]["betweenness"].loc[y, x] -= (
root_node["betweenness"][added_node][y] * dvxy
)

Expand Down
4 changes: 3 additions & 1 deletion networkx/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def set_warnings():
"ignore", category=DeprecationWarning, message="\n\nThe `normalized`"
)
warnings.filterwarnings(
"ignore", category=DeprecationWarning, message="function `join` is deprecated"
"ignore",
category=DeprecationWarning,
message="The function `join` is deprecated",
)
warnings.filterwarnings(
"ignore",
Expand Down
6 changes: 3 additions & 3 deletions networkx/generators/expanders.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def maybe_regular_expander(n, d, *, create_using=None, max_tries=100, seed=None)

Examples
--------
>>> G = nx.maybe_regular_expander(n=200, d=6)
>>> G = nx.maybe_regular_expander(n=200, d=6, seed=8020)

Returns
-------
Expand Down Expand Up @@ -387,8 +387,8 @@ def is_regular_expander(G, *, epsilon=0):

_, d = nx.utils.arbitrary_element(G.degree)

A = nx.adjacency_matrix(G)
lams = eigsh(A.asfptype(), which="LM", k=2, return_eigenvectors=False)
A = nx.adjacency_matrix(G, dtype=float)
lams = eigsh(A, which="LM", k=2, return_eigenvectors=False)

# lambda2 is the second biggest eigenvalue
lambda2 = min(lams)
Expand Down