-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bump networkx to 3.2.1 #11336
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
Bump networkx to 3.2.1 #11336
Changes from 9 commits
ff1acec
51664ba
8064f5f
65c275d
51dcebb
8598451
fb561be
86dcb6d
d97a4e4
5f2e6fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# overloading a class-decorated method crashes stubtest | ||
networkx\.(algorithms\.)?(boundary\.)?edge_boundary | ||
networkx\.(algorithms\.)?(bridges\.)?local_bridges | ||
networkx\.(algorithms\.)?(clique\.)?node_clique_number | ||
networkx\.(algorithms\.)?(shortest_paths\.)?(generic\.)?shortest_path | ||
networkx\.(convert_matrix\.)?from_numpy_array | ||
networkx\.(convert_matrix\.)?from_pandas_adjacency | ||
networkx\.(convert_matrix\.)?from_pandas_edgelist | ||
networkx\.(generators\.)?(random_clustered\.)?random_clustered_graph | ||
networkx\.(relabel\.)?relabel_nodes | ||
|
||
# Stubtest doesn't understand aliases of class-decorated methods | ||
Avasam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
networkx\.(algorithms\.)?(centrality\.)?(current_flow_closeness\.)?information_centrality | ||
networkx\.(generators\.)?(random_graphs\.)?binomial_graph | ||
networkx\.(generators\.)?(random_graphs\.)?erdos_renyi_graph | ||
|
||
# Stubtest says: "runtime argument "backend" has a default value of type None, which is | ||
# incompatible with stub argument type builtins.str. This is often caused by overloads | ||
# failing to account for explicitly passing in the default value." | ||
# Which is true, but would require some way of concatenating `backend` to ParamSpec.kwargs | ||
networkx\.(utils\.backends\.)?_dispatch\.__call__ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing_extensions import assert_type | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
|
||
@_dispatch | ||
def some_method(int_p: int, str_p: str) -> float: | ||
return 0.0 | ||
|
||
|
||
# Wrong param / order | ||
some_method("", 0) # type: ignore | ||
# backend is kw-only | ||
some_method(0, "", None) # type: ignore | ||
# No backend means no **backend_kwargs allowed | ||
some_method(0, "", backend_specific_kwarg="") # type: ignore | ||
some_method(0, "", backend=None, backend_specific_kwarg="") # type: ignore | ||
|
||
# Correct usage | ||
assert_type(some_method(0, ""), float) | ||
# type system doesn't allow this yet (see comment in networkx/utils/backends.pyi) | ||
# assert_type(some_method(0, "", backend=None), float) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would require some way of concatenating |
||
assert_type(some_method(0, "", backend="custom backend", backend_specific_kwarg=""), float) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,11 @@ from networkx.convert_matrix import * | |
from networkx.drawing import * | ||
from networkx.exception import * | ||
from networkx.generators import * | ||
from networkx.lazy_imports import _lazy_import as _lazy_import | ||
from networkx.linalg import * | ||
from networkx.readwrite import * | ||
from networkx.relabel import * | ||
from networkx.utils.backends import _dispatch as _dispatch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New re-exports (but they're also private, could be omitted) |
||
|
||
from . import ( | ||
algorithms as algorithms, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def maximum_independent_set(G): ... | ||
@_dispatch | ||
def max_clique(G): ... | ||
@_dispatch | ||
def clique_removal(G): ... | ||
@_dispatch | ||
def large_clique_size(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def average_clustering(G, trials: int = 1000, seed: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def local_node_connectivity(G, source, target, cutoff: Incomplete | None = None): ... | ||
@_dispatch | ||
def node_connectivity(G, s: Incomplete | None = None, t: Incomplete | None = None): ... | ||
@_dispatch | ||
def all_pairs_node_connectivity(G, nbunch: Incomplete | None = None, cutoff: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def diameter(G, seed: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def min_weighted_dominating_set(G, weight: Incomplete | None = None): ... | ||
@_dispatch | ||
def min_edge_dominating_set(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def k_components(G, min_density: float = 0.95): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def min_maximal_matching(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def randomized_partitioning(G, seed: Incomplete | None = None, p: float = 0.5, weight: Incomplete | None = None): ... | ||
@_dispatch | ||
def one_exchange(G, initial_cut: Incomplete | None = None, seed: Incomplete | None = None, weight: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def ramsey_R2(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def metric_closure(G, weight: str = "weight"): ... | ||
@_dispatch | ||
def steiner_tree(G, terminal_nodes, weight: str = "weight", method: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def min_weighted_vertex_cover(G, weight: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def average_degree_connectivity( | ||
G, source: str = "in+out", target: str = "in+out", nodes: Incomplete | None = None, weight: Incomplete | None = None | ||
): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def degree_assortativity_coefficient( | ||
G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None | ||
): ... | ||
@_dispatch | ||
def degree_pearson_correlation_coefficient( | ||
G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None | ||
): ... | ||
@_dispatch | ||
def attribute_assortativity_coefficient(G, attribute, nodes: Incomplete | None = None): ... | ||
@_dispatch | ||
def numeric_assortativity_coefficient(G, attribute, nodes: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def average_neighbor_degree( | ||
G, source: str = "out", target: str = "out", nodes: Incomplete | None = None, weight: Incomplete | None = None | ||
): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
from _typeshed import Incomplete | ||
from collections.abc import Generator | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def node_attribute_xy(G, attribute, nodes: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... | ||
@_dispatch | ||
def node_degree_xy( | ||
G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None | ||
) -> Generator[Incomplete, None, None]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def find_asteroidal_triple(G): ... | ||
@_dispatch | ||
def is_at_free(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def color(G): ... | ||
@_dispatch | ||
def is_bipartite(G): ... | ||
@_dispatch | ||
def is_bipartite_node_set(G, nodes): ... | ||
@_dispatch | ||
def sets(G, top_nodes: Incomplete | None = None): ... | ||
@_dispatch | ||
def density(B, nodes): ... | ||
@_dispatch | ||
def degrees(B, nodes, weight: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def degree_centrality(G, nodes): ... | ||
@_dispatch | ||
def betweenness_centrality(G, nodes): ... | ||
@_dispatch | ||
def closeness_centrality(G, nodes, normalized: bool = True): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def latapy_clustering(G, nodes: Incomplete | None = None, mode: str = "dot"): ... | ||
|
||
clustering = latapy_clustering | ||
|
||
@_dispatch | ||
def average_clustering(G, nodes: Incomplete | None = None, mode: str = "dot"): ... | ||
@_dispatch | ||
def robins_alexander_clustering(G): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def min_edge_cover(G, matching_algorithm: Incomplete | None = None): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def complete_bipartite_graph(n1, n2, create_using: Incomplete | None = None): ... | ||
@_dispatch | ||
def configuration_model(aseq, bseq, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... | ||
@_dispatch | ||
def havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... | ||
@_dispatch | ||
def reverse_havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... | ||
@_dispatch | ||
def alternating_havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... | ||
@_dispatch | ||
def preferential_attachment_graph(aseq, p, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... | ||
@_dispatch | ||
def random_graph(n, m, p, seed: Incomplete | None = None, directed: bool = False): ... | ||
@_dispatch | ||
def gnmk_random_graph(n, m, k, seed: Incomplete | None = None, directed: bool = False): ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
from _typeshed import Incomplete | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
@_dispatch | ||
def hopcroft_karp_matching(G, top_nodes: Incomplete | None = None): ... | ||
@_dispatch | ||
def eppstein_matching(G, top_nodes: Incomplete | None = None): ... | ||
@_dispatch | ||
def to_vertex_cover(G, matching, top_nodes: Incomplete | None = None): ... | ||
|
||
maximum_matching = hopcroft_karp_matching | ||
|
||
@_dispatch | ||
def minimum_weight_full_matching(G, top_nodes: Incomplete | None = None, weight: str = "weight"): ... |
Uh oh!
There was an error while loading. Please reload this page.