diff --git a/stubs/networkx/@tests/stubtest_allowlist.txt b/stubs/networkx/@tests/stubtest_allowlist.txt index 99e031efd7af..7db1c45f949a 100644 --- a/stubs/networkx/@tests/stubtest_allowlist.txt +++ b/stubs/networkx/@tests/stubtest_allowlist.txt @@ -11,16 +11,25 @@ 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 (possibly https://github.com/python/mypy/issues/6700 ) +# Stubtest doesn't understand aliases of class-decorated functions (possibly https://github.com/python/mypy/issues/6700 ) networkx\.(algorithms\.)?(centrality\.)?(current_flow_closeness\.)?information_centrality networkx\.(generators\.)?(random_graphs\.)?binomial_graph networkx\.(generators\.)?(random_graphs\.)?erdos_renyi_graph +networkx\.(algorithms\.(minors\.(contraction\.)?)?)?identified_nodes +networkx\.algorithms\.isomorphism\.isomorph\.faster_graph_could_be_isomorphic +networkx\.algorithms\.isomorphism\.isomorph\.fast_graph_could_be_isomorphic +networkx\.algorithms\.isomorphism\.isomorph\.graph_could_be_isomorphic +networkx\.algorithms\.flow\.maxflow\.default_flow_func +networkx\.algorithms\.[a-z_\.]+\.default_flow_func +networkx\.(algorithms\.(centrality\.(load\.)?)?)?load_centrality +networkx\.algorithms\.bipartite\.(matching\.)?maximum_matching +networkx\.algorithms\.bipartite\.(cluster\.)?clustering # 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__ +networkx\.(utils\.)?(backends\.)?_dispatchable\.__call__ # TODO: stubtest does not like @cached_property https://github.com/python/mypy/issues/17625 # "is inconsistent, cannot reconcile @property on stub with runtime object" diff --git a/stubs/networkx/@tests/test_cases/check_dispatch_decorator.py b/stubs/networkx/@tests/test_cases/check_dispatch_decorator.py index a408396ec4f5..c4bb02d2026e 100644 --- a/stubs/networkx/@tests/test_cases/check_dispatch_decorator.py +++ b/stubs/networkx/@tests/test_cases/check_dispatch_decorator.py @@ -1,9 +1,9 @@ from typing_extensions import assert_type -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def some_method(int_p: int, str_p: str) -> float: return 0.0 diff --git a/stubs/networkx/METADATA.toml b/stubs/networkx/METADATA.toml index ace417a7f4e0..ceb9213e979c 100644 --- a/stubs/networkx/METADATA.toml +++ b/stubs/networkx/METADATA.toml @@ -1,4 +1,4 @@ -version = "3.2.1" +version = "3.3" upstream_repository = "https://github.com/networkx/networkx" # requires a version of numpy with a `py.typed` file # see https://github.com/python/typeshed/issues/12551 diff --git a/stubs/networkx/networkx/__init__.pyi b/stubs/networkx/networkx/__init__.pyi index 86bd7edf3f2f..7e5d6b1ec86a 100644 --- a/stubs/networkx/networkx/__init__.pyi +++ b/stubs/networkx/networkx/__init__.pyi @@ -10,7 +10,7 @@ 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 +from networkx.utils import _clear_cache as _clear_cache, _dispatchable as _dispatchable, config as config from . import ( algorithms as algorithms, diff --git a/stubs/networkx/networkx/algorithms/approximation/clique.pyi b/stubs/networkx/networkx/algorithms/approximation/clique.pyi index 1ea7793c4264..886ec93f7c02 100644 --- a/stubs/networkx/networkx/algorithms/approximation/clique.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/clique.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def maximum_independent_set(G): ... -@_dispatch +@_dispatchable def max_clique(G): ... -@_dispatch +@_dispatchable def clique_removal(G): ... -@_dispatch +@_dispatchable def large_clique_size(G): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/clustering_coefficient.pyi b/stubs/networkx/networkx/algorithms/approximation/clustering_coefficient.pyi index eb18de1188dc..b18a813d1192 100644 --- a/stubs/networkx/networkx/algorithms/approximation/clustering_coefficient.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/clustering_coefficient.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def average_clustering(G, trials: int = 1000, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi b/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi index 886607817517..8a431a9acb00 100644 --- a/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def local_node_connectivity(G, source, target, cutoff: Incomplete | None = None): ... -@_dispatch +@_dispatchable def node_connectivity(G, s: Incomplete | None = None, t: Incomplete | None = None): ... -@_dispatch +@_dispatchable def all_pairs_node_connectivity(G, nbunch: Incomplete | None = None, cutoff: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/distance_measures.pyi b/stubs/networkx/networkx/algorithms/approximation/distance_measures.pyi index 136d0b8d133d..75b45b52003e 100644 --- a/stubs/networkx/networkx/algorithms/approximation/distance_measures.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/distance_measures.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def diameter(G, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/dominating_set.pyi b/stubs/networkx/networkx/algorithms/approximation/dominating_set.pyi index d7ecd98b5c61..b08dc451db96 100644 --- a/stubs/networkx/networkx/algorithms/approximation/dominating_set.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/dominating_set.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_weighted_dominating_set(G, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def min_edge_dominating_set(G): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi index 7ede5c764063..46d89ff537d3 100644 --- a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def k_components(G, min_density: float = 0.95): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/matching.pyi b/stubs/networkx/networkx/algorithms/approximation/matching.pyi index d4c8b8a8bd0b..310ef31b91bf 100644 --- a/stubs/networkx/networkx/algorithms/approximation/matching.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/matching.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_maximal_matching(G): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi index b3a63ccca690..760c114b4a41 100644 --- a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def randomized_partitioning(G, seed: Incomplete | None = None, p: float = 0.5, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def one_exchange(G, initial_cut: Incomplete | None = None, seed: Incomplete | None = None, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/ramsey.pyi b/stubs/networkx/networkx/algorithms/approximation/ramsey.pyi index e94877bea1a8..5b85df65d7bb 100644 --- a/stubs/networkx/networkx/algorithms/approximation/ramsey.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/ramsey.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def ramsey_R2(G): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/steinertree.pyi b/stubs/networkx/networkx/algorithms/approximation/steinertree.pyi index 8ade9c0e5209..03d0f6742be6 100644 --- a/stubs/networkx/networkx/algorithms/approximation/steinertree.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/steinertree.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def metric_closure(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def steiner_tree(G, terminal_nodes, weight: str = "weight", method: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi index 9ceb4349d7c5..e44e31519d14 100644 --- a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def christofides(G, weight: str = "weight", tree: Incomplete | None = None): ... -@_dispatch +@_dispatchable def traveling_salesman_problem( - G, weight: str = "weight", nodes: Incomplete | None = None, cycle: bool = True, method: Incomplete | None = None + G, weight: str = "weight", nodes: Incomplete | None = None, cycle: bool = True, method: Incomplete | None = None, **kwargs ): ... -@_dispatch +@_dispatchable def asadpour_atsp(G, weight: str = "weight", seed: Incomplete | None = None, source: Incomplete | None = None): ... -@_dispatch +@_dispatchable def greedy_tsp(G, weight: str = "weight", source: Incomplete | None = None): ... -@_dispatch +@_dispatchable def simulated_annealing_tsp( G, init_cycle, @@ -26,7 +26,7 @@ def simulated_annealing_tsp( alpha: float = 0.01, seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def threshold_accepting_tsp( G, init_cycle, diff --git a/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi b/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi index 689661866911..5a68247f5b49 100644 --- a/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["treewidth_min_degree", "treewidth_min_fill_in"] -@_dispatch +@_dispatchable def treewidth_min_degree(G): ... -@_dispatch +@_dispatchable def treewidth_min_fill_in(G): ... class MinDegreeHeuristic: diff --git a/stubs/networkx/networkx/algorithms/approximation/vertex_cover.pyi b/stubs/networkx/networkx/algorithms/approximation/vertex_cover.pyi index 1e903f20611a..22c5787bf983 100644 --- a/stubs/networkx/networkx/algorithms/approximation/vertex_cover.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/vertex_cover.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_weighted_vertex_cover(G, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/assortativity/connectivity.pyi b/stubs/networkx/networkx/algorithms/assortativity/connectivity.pyi index f317998a9cf9..36c7f64e46e2 100644 --- a/stubs/networkx/networkx/algorithms/assortativity/connectivity.pyi +++ b/stubs/networkx/networkx/algorithms/assortativity/connectivity.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def average_degree_connectivity( G, source: str = "in+out", target: str = "in+out", nodes: Incomplete | None = None, weight: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/assortativity/correlation.pyi b/stubs/networkx/networkx/algorithms/assortativity/correlation.pyi index 8904cc1560a4..dec6b0595556 100644 --- a/stubs/networkx/networkx/algorithms/assortativity/correlation.pyi +++ b/stubs/networkx/networkx/algorithms/assortativity/correlation.pyi @@ -1,16 +1,16 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def degree_assortativity_coefficient( G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def degree_pearson_correlation_coefficient( G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def attribute_assortativity_coefficient(G, attribute, nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def numeric_assortativity_coefficient(G, attribute, nodes: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/assortativity/mixing.pyi b/stubs/networkx/networkx/algorithms/assortativity/mixing.pyi index 95402642c66c..06e19e1f68d5 100644 --- a/stubs/networkx/networkx/algorithms/assortativity/mixing.pyi +++ b/stubs/networkx/networkx/algorithms/assortativity/mixing.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def attribute_mixing_dict(G, attribute, nodes: Incomplete | None = None, normalized: bool = False): ... -@_dispatch +@_dispatchable def attribute_mixing_matrix( G, attribute, nodes: Incomplete | None = None, mapping: Incomplete | None = None, normalized: bool = True ): ... -@_dispatch +@_dispatchable def degree_mixing_dict( G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None, normalized: bool = False ): ... -@_dispatch +@_dispatchable def degree_mixing_matrix( G, x: str = "out", @@ -22,5 +22,5 @@ def degree_mixing_matrix( normalized: bool = True, mapping: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def mixing_dict(xy, normalized: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/assortativity/neighbor_degree.pyi b/stubs/networkx/networkx/algorithms/assortativity/neighbor_degree.pyi index 7f0e945ff696..6cc1b1322d2a 100644 --- a/stubs/networkx/networkx/algorithms/assortativity/neighbor_degree.pyi +++ b/stubs/networkx/networkx/algorithms/assortativity/neighbor_degree.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def average_neighbor_degree( G, source: str = "out", target: str = "out", nodes: Incomplete | None = None, weight: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi b/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi index d73234043145..569d52653ee5 100644 --- a/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi +++ b/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def node_attribute_xy(G, attribute, nodes: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def node_degree_xy( G, x: str = "out", y: str = "in", weight: Incomplete | None = None, nodes: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/asteroidal.pyi b/stubs/networkx/networkx/algorithms/asteroidal.pyi index 07fa9c4a91ad..4d12ecadaecd 100644 --- a/stubs/networkx/networkx/algorithms/asteroidal.pyi +++ b/stubs/networkx/networkx/algorithms/asteroidal.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def find_asteroidal_triple(G): ... -@_dispatch +@_dispatchable def is_at_free(G): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/basic.pyi b/stubs/networkx/networkx/algorithms/bipartite/basic.pyi index cf30841b617c..f7fd955bb524 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/basic.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/basic.pyi @@ -1,16 +1,16 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def color(G): ... -@_dispatch +@_dispatchable def is_bipartite(G): ... -@_dispatch +@_dispatchable def is_bipartite_node_set(G, nodes): ... -@_dispatch +@_dispatchable def sets(G, top_nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def density(B, nodes): ... -@_dispatch +@_dispatchable def degrees(B, nodes, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/centrality.pyi b/stubs/networkx/networkx/algorithms/bipartite/centrality.pyi index 9008090200c5..9d011ac139c2 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/centrality.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/centrality.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def degree_centrality(G, nodes): ... -@_dispatch +@_dispatchable def betweenness_centrality(G, nodes): ... -@_dispatch +@_dispatchable def closeness_centrality(G, nodes, normalized: bool = True): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/cluster.pyi b/stubs/networkx/networkx/algorithms/bipartite/cluster.pyi index e8f427123ebc..e6d15445c985 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/cluster.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/cluster.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def latapy_clustering(G, nodes: Incomplete | None = None, mode: str = "dot"): ... clustering = latapy_clustering -@_dispatch +@_dispatchable def average_clustering(G, nodes: Incomplete | None = None, mode: str = "dot"): ... -@_dispatch +@_dispatchable def robins_alexander_clustering(G): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/covering.pyi b/stubs/networkx/networkx/algorithms/bipartite/covering.pyi index 1c07f6ee0c5f..521e6d4956af 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/covering.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/covering.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_edge_cover(G, matching_algorithm: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi b/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi index 04d79f515a8d..009222121126 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def write_edgelist(G, path, comments: str = "#", delimiter: str = " ", data: bool = True, encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def parse_edgelist( lines, comments: str = "#", @@ -16,7 +16,7 @@ def parse_edgelist( nodetype: Incomplete | None = None, data: bool = True, ): ... -@_dispatch +@_dispatchable def read_edgelist( path, comments: str = "#", diff --git a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi index d422ac358d0f..9e1914567a50 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def complete_bipartite_graph(n1, n2, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def configuration_model(aseq, bseq, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def reverse_havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def alternating_havel_hakimi_graph(aseq, bseq, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def preferential_attachment_graph(aseq, p, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_graph(n, m, p, seed: Incomplete | None = None, directed: bool = False): ... -@_dispatch +@_dispatchable def gnmk_random_graph(n, m, k, seed: Incomplete | None = None, directed: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/matching.pyi b/stubs/networkx/networkx/algorithms/bipartite/matching.pyi index b6a2852651d0..a731c33b88d2 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/matching.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/matching.pyi @@ -1,15 +1,15 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def hopcroft_karp_matching(G, top_nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def eppstein_matching(G, top_nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def to_vertex_cover(G, matching, top_nodes: Incomplete | None = None): ... maximum_matching = hopcroft_karp_matching -@_dispatch +@_dispatchable def minimum_weight_full_matching(G, top_nodes: Incomplete | None = None, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/matrix.pyi b/stubs/networkx/networkx/algorithms/bipartite/matrix.pyi index e7d8e399f40f..51a032fff0d8 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/matrix.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/matrix.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def biadjacency_matrix( G, row_order, @@ -11,5 +11,5 @@ def biadjacency_matrix( weight: str = "weight", format: str = "csr", ): ... -@_dispatch +@_dispatchable def from_biadjacency_matrix(A, create_using: Incomplete | None = None, edge_attribute: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/projection.pyi b/stubs/networkx/networkx/algorithms/bipartite/projection.pyi index 73f12dc57843..37712b7840a4 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/projection.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/projection.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def projected_graph(B, nodes, multigraph: bool = False): ... -@_dispatch +@_dispatchable def weighted_projected_graph(B, nodes, ratio: bool = False): ... -@_dispatch +@_dispatchable def collaboration_weighted_projected_graph(B, nodes): ... -@_dispatch +@_dispatchable def overlap_weighted_projected_graph(B, nodes, jaccard: bool = True): ... -@_dispatch +@_dispatchable def generic_weighted_projected_graph(B, nodes, weight_function: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/redundancy.pyi b/stubs/networkx/networkx/algorithms/bipartite/redundancy.pyi index 5501fd2d8d25..8c66512fc95a 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/redundancy.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/redundancy.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def node_redundancy(G, nodes: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/spectral.pyi b/stubs/networkx/networkx/algorithms/bipartite/spectral.pyi index 435a1795cff7..4a81f118acbf 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/spectral.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/spectral.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def spectral_bipartivity(G, nodes: Incomplete | None = None, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/boundary.pyi b/stubs/networkx/networkx/algorithms/boundary.pyi index 51c8c9031608..3b5cfa511a38 100644 --- a/stubs/networkx/networkx/algorithms/boundary.pyi +++ b/stubs/networkx/networkx/algorithms/boundary.pyi @@ -3,7 +3,7 @@ from collections.abc import Generator, Iterable from typing import Literal, TypeVar, overload from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable _U = TypeVar("_U") @@ -111,5 +111,5 @@ def edge_boundary( keys: Literal[True], default: _U | None = None, ) -> Generator[tuple[_Node, _Node, int, dict[str, _U]], None, None]: ... -@_dispatch +@_dispatchable def node_boundary(G: Graph[_Node], nbunch1: Iterable[_Node], nbunch2: Iterable[_Node] | None = None) -> set[_Node]: ... diff --git a/stubs/networkx/networkx/algorithms/bridges.pyi b/stubs/networkx/networkx/algorithms/bridges.pyi index 2d94a35f4925..35fa914d6f90 100644 --- a/stubs/networkx/networkx/algorithms/bridges.pyi +++ b/stubs/networkx/networkx/algorithms/bridges.pyi @@ -3,11 +3,11 @@ from collections.abc import Callable, Generator from typing import Literal, overload from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def bridges(G: Graph[_Node], root: _Node | None = None) -> Generator[_Node, None, None]: ... -@_dispatch +@_dispatchable def has_bridges(G: Graph[_Node], root: Incomplete | None = None) -> bool: ... @overload def local_bridges( diff --git a/stubs/networkx/networkx/algorithms/broadcasting.pyi b/stubs/networkx/networkx/algorithms/broadcasting.pyi new file mode 100644 index 000000000000..e61d77b28e7c --- /dev/null +++ b/stubs/networkx/networkx/algorithms/broadcasting.pyi @@ -0,0 +1,9 @@ +import networkx as nx +from networkx.classes.graph import Graph, _Node + +__all__ = ["tree_broadcast_center", "tree_broadcast_time"] + +@nx._dispatchable +def tree_broadcast_center(G: Graph[_Node]) -> tuple[int, set[_Node]]: ... +@nx._dispatchable +def tree_broadcast_time(G: Graph[_Node], node: int | None = None) -> int: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/betweenness.pyi b/stubs/networkx/networkx/algorithms/centrality/betweenness.pyi index d69156f653be..5475cfecb789 100644 --- a/stubs/networkx/networkx/algorithms/centrality/betweenness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/betweenness.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete from networkx.classes.graph import Graph, _Edge, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable from numpy.random import RandomState -@_dispatch +@_dispatchable def betweenness_centrality( G: Graph[_Node], k: int | None = None, @@ -13,7 +13,7 @@ def betweenness_centrality( endpoints: bool = False, seed: int | RandomState | None = None, ) -> dict[_Node, float]: ... -@_dispatch +@_dispatchable def edge_betweenness_centrality( G: Graph[_Node], k: int | None = None, normalized: bool = True, weight: str | None = None, seed: Incomplete | None = None ) -> dict[_Edge[_Node], float]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/betweenness_subset.pyi b/stubs/networkx/networkx/algorithms/centrality/betweenness_subset.pyi index d1c012c8eb4e..66abb8533ad4 100644 --- a/stubs/networkx/networkx/algorithms/centrality/betweenness_subset.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/betweenness_subset.pyi @@ -1,13 +1,13 @@ from collections.abc import Iterable from networkx.classes.graph import Graph, _Edge, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def betweenness_centrality_subset( G: Graph[_Node], sources: Iterable[_Node], targets: Iterable[_Node], normalized: bool = False, weight: str | None = None ) -> dict[_Node, float]: ... -@_dispatch +@_dispatchable def edge_betweenness_centrality_subset( G: Graph[_Node], sources: Iterable[_Node], targets: Iterable[_Node], normalized: bool = False, weight: str | None = None ) -> dict[_Edge[_Node], float]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/closeness.pyi b/stubs/networkx/networkx/algorithms/centrality/closeness.pyi index e682d7ce8afc..210e88bc7218 100644 --- a/stubs/networkx/networkx/algorithms/centrality/closeness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/closeness.pyi @@ -1,13 +1,13 @@ from _typeshed import SupportsKeysAndGetItem from networkx.classes.graph import Graph, _Edge, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def closeness_centrality( G: Graph[_Node], u: _Node | None = None, distance: str | None = None, wf_improved: bool = True ) -> dict[_Node, float]: ... -@_dispatch +@_dispatchable def incremental_closeness_centrality( G: Graph[_Node], edge: _Edge[_Node], diff --git a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi index ec6506d563d2..612702be5b69 100644 --- a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def approximate_current_flow_betweenness_centrality( G, normalized: bool = True, @@ -13,11 +13,11 @@ def approximate_current_flow_betweenness_centrality( kmax: int = 10000, seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def current_flow_betweenness_centrality( G, normalized: bool = True, weight: Incomplete | None = None, dtype=..., solver: str = "full" ): ... -@_dispatch +@_dispatchable def edge_current_flow_betweenness_centrality( G, normalized: bool = True, weight: Incomplete | None = None, dtype=..., solver: str = "full" ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi index 65eaa77652f1..a34c8461d5c4 100644 --- a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def current_flow_betweenness_centrality_subset( G, sources, targets, normalized: bool = True, weight: Incomplete | None = None, dtype=..., solver: str = "lu" ): ... -@_dispatch +@_dispatchable def edge_current_flow_betweenness_centrality_subset( G, sources, targets, normalized: bool = True, weight: Incomplete | None = None, dtype=..., solver: str = "lu" ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/current_flow_closeness.pyi b/stubs/networkx/networkx/algorithms/centrality/current_flow_closeness.pyi index 0269117b26e1..81587a748915 100644 --- a/stubs/networkx/networkx/algorithms/centrality/current_flow_closeness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/current_flow_closeness.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def current_flow_closeness_centrality(G, weight: Incomplete | None = None, dtype=..., solver: str = "lu"): ... information_centrality = current_flow_closeness_centrality diff --git a/stubs/networkx/networkx/algorithms/centrality/degree_alg.pyi b/stubs/networkx/networkx/algorithms/centrality/degree_alg.pyi index 94013e3182d2..30618e780bfe 100644 --- a/stubs/networkx/networkx/algorithms/centrality/degree_alg.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/degree_alg.pyi @@ -1,9 +1,9 @@ from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def degree_centrality(G: Graph[_Node]) -> dict[_Node, float]: ... -@_dispatch +@_dispatchable def in_degree_centrality(G: Graph[_Node]) -> dict[_Node, float]: ... -@_dispatch +@_dispatchable def out_degree_centrality(G: Graph[_Node]) -> dict[_Node, float]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi index c0550d148ee3..b673beb8778b 100644 --- a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi @@ -1,7 +1,7 @@ from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def dispersion( G: Graph[_Node], u: _Node | None = None, diff --git a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi index f74d25fb6fc0..cb0736e69f93 100644 --- a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def eigenvector_centrality( G, max_iter: int = 100, tol: float = 1e-06, nstart: Incomplete | None = None, weight: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def eigenvector_centrality_numpy(G, weight: Incomplete | None = None, max_iter: int = 50, tol: float = 0): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi b/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi index f1e49b1787de..12a98580dbde 100644 --- a/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi @@ -1,9 +1,9 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def flow_matrix_row(G, weight: Incomplete | None = None, dtype=..., solver: str = "lu") -> Generator[Incomplete, None, None]: ... class InverseLaplacian: diff --git a/stubs/networkx/networkx/algorithms/centrality/group.pyi b/stubs/networkx/networkx/algorithms/centrality/group.pyi index 8431e09540e9..a7cfa7a7c58a 100644 --- a/stubs/networkx/networkx/algorithms/centrality/group.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/group.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def group_betweenness_centrality(G, C, normalized: bool = True, weight: Incomplete | None = None, endpoints: bool = False): ... -@_dispatch +@_dispatchable def prominent_group( G, k, @@ -14,11 +14,11 @@ def prominent_group( normalized: bool = True, greedy: bool = False, ): ... -@_dispatch +@_dispatchable def group_closeness_centrality(G, S, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def group_degree_centrality(G, S): ... -@_dispatch +@_dispatchable def group_in_degree_centrality(G, S): ... -@_dispatch +@_dispatchable def group_out_degree_centrality(G, S): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/harmonic.pyi b/stubs/networkx/networkx/algorithms/centrality/harmonic.pyi index 22b1b8458aaa..cd2aa8ca1747 100644 --- a/stubs/networkx/networkx/algorithms/centrality/harmonic.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/harmonic.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def harmonic_centrality( G, nbunch: Incomplete | None = None, distance: Incomplete | None = None, sources: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/katz.pyi b/stubs/networkx/networkx/algorithms/centrality/katz.pyi index 7ad4c1ed9e41..509456ff0ef9 100644 --- a/stubs/networkx/networkx/algorithms/centrality/katz.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/katz.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def katz_centrality( G, alpha: float = 0.1, @@ -13,7 +13,7 @@ def katz_centrality( normalized: bool = True, weight: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def katz_centrality_numpy( G, alpha: float = 0.1, beta: float = 1.0, normalized: bool = True, weight: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi index 1d29b3c99ab3..a1a79318dcb2 100644 --- a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def laplacian_centrality( G, normalized: bool = True, diff --git a/stubs/networkx/networkx/algorithms/centrality/load.pyi b/stubs/networkx/networkx/algorithms/centrality/load.pyi index 66508d057057..a3cb20b97eae 100644 --- a/stubs/networkx/networkx/algorithms/centrality/load.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/load.pyi @@ -1,15 +1,15 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["load_centrality", "edge_load_centrality"] -@_dispatch +@_dispatchable def newman_betweenness_centrality( G, v: Incomplete | None = None, cutoff: Incomplete | None = None, normalized: bool = True, weight: Incomplete | None = None ): ... load_centrality = newman_betweenness_centrality -@_dispatch +@_dispatchable def edge_load_centrality(G, cutoff: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/percolation.pyi b/stubs/networkx/networkx/algorithms/centrality/percolation.pyi index 42431fed2524..b64230f68108 100644 --- a/stubs/networkx/networkx/algorithms/centrality/percolation.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/percolation.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def percolation_centrality( G, attribute: str = "percolation", states: Incomplete | None = None, weight: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/reaching.pyi b/stubs/networkx/networkx/algorithms/centrality/reaching.pyi index 69d2017c1251..4cb0a9ef7a59 100644 --- a/stubs/networkx/networkx/algorithms/centrality/reaching.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/reaching.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def global_reaching_centrality(G, weight: Incomplete | None = None, normalized: bool = True): ... -@_dispatch +@_dispatchable def local_reaching_centrality( G, v, paths: Incomplete | None = None, weight: Incomplete | None = None, normalized: bool = True ): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/second_order.pyi b/stubs/networkx/networkx/algorithms/centrality/second_order.pyi index 3bbf8e2e66f2..32f37fabeabf 100644 --- a/stubs/networkx/networkx/algorithms/centrality/second_order.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/second_order.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def second_order_centrality(G): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi b/stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi index e7969b808888..f826a0b38022 100644 --- a/stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def subgraph_centrality_exp(G): ... -@_dispatch +@_dispatchable def subgraph_centrality(G): ... -@_dispatch +@_dispatchable def communicability_betweenness_centrality(G): ... -@_dispatch +@_dispatchable def estrada_index(G): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/trophic.pyi b/stubs/networkx/networkx/algorithms/centrality/trophic.pyi index 64e801df8f9c..efbd8e54f2a6 100644 --- a/stubs/networkx/networkx/algorithms/centrality/trophic.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/trophic.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def trophic_levels(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def trophic_differences(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def trophic_incoherence_parameter(G, weight: str = "weight", cannibalism: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/centrality/voterank_alg.pyi b/stubs/networkx/networkx/algorithms/centrality/voterank_alg.pyi index 3b529cee2603..c25d90ce7ea2 100644 --- a/stubs/networkx/networkx/algorithms/centrality/voterank_alg.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/voterank_alg.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def voterank(G, number_of_nodes: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/chains.pyi b/stubs/networkx/networkx/algorithms/chains.pyi index 90cd6fe607f1..e7f99119c9d4 100644 --- a/stubs/networkx/networkx/algorithms/chains.pyi +++ b/stubs/networkx/networkx/algorithms/chains.pyi @@ -1,7 +1,7 @@ from collections.abc import Generator from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def chain_decomposition(G: Graph[_Node], root: _Node | None = None) -> Generator[list[tuple[_Node, _Node]], None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/chordal.pyi b/stubs/networkx/networkx/algorithms/chordal.pyi index c14b405387ce..ba37c5b35b58 100644 --- a/stubs/networkx/networkx/algorithms/chordal.pyi +++ b/stubs/networkx/networkx/algorithms/chordal.pyi @@ -3,15 +3,15 @@ from collections.abc import Generator, Hashable from networkx.classes.graph import Graph, _Node from networkx.exception import NetworkXException -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class NetworkXTreewidthBoundExceeded(NetworkXException): ... -@_dispatch +@_dispatchable def is_chordal(G: Graph[Hashable]) -> bool: ... -@_dispatch +@_dispatchable def find_induced_nodes(G: Graph[_Node], s: _Node, t: _Node, treewidth_bound: float = sys.maxsize) -> set[_Node]: ... -@_dispatch +@_dispatchable def chordal_graph_cliques(G: Graph[_Node]) -> Generator[frozenset[_Node], None, None]: ... -@_dispatch +@_dispatchable def chordal_graph_treewidth(G: Graph[Hashable]) -> int: ... diff --git a/stubs/networkx/networkx/algorithms/clique.pyi b/stubs/networkx/networkx/algorithms/clique.pyi index 3bae47633ac4..e7409ca915d8 100644 --- a/stubs/networkx/networkx/algorithms/clique.pyi +++ b/stubs/networkx/networkx/algorithms/clique.pyi @@ -3,17 +3,17 @@ from collections.abc import Generator, Iterable, Iterator, Sized from typing import overload from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def enumerate_all_cliques(G: Graph[_Node]) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def find_cliques(G: Graph[_Node], nodes: SupportsGetItem[slice, _Node] | None = None) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def find_cliques_recursive(G: Graph[_Node], nodes: SupportsGetItem[slice, _Node] | None = None) -> Iterator[list[_Node]]: ... -@_dispatch +@_dispatchable def make_max_clique_graph(G: Graph[_Node], create_using: type[Graph[_Node]] | None = None) -> Graph[_Node]: ... -@_dispatch +@_dispatchable def make_clique_bipartite( G: Graph[_Node], fpos: Unused = None, create_using: type[Graph[_Node]] | None = None, name: Unused = None ) -> Graph[_Node]: ... diff --git a/stubs/networkx/networkx/algorithms/cluster.pyi b/stubs/networkx/networkx/algorithms/cluster.pyi index fc4e1fb632a4..d0dc06de3ce9 100644 --- a/stubs/networkx/networkx/algorithms/cluster.pyi +++ b/stubs/networkx/networkx/algorithms/cluster.pyi @@ -1,16 +1,16 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def triangles(G, nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def average_clustering(G, nodes: Incomplete | None = None, weight: Incomplete | None = None, count_zeros: bool = True): ... -@_dispatch +@_dispatchable def clustering(G, nodes: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def transitivity(G): ... -@_dispatch +@_dispatchable def square_clustering(G, nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def generalized_degree(G, nodes: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/coloring/equitable_coloring.pyi b/stubs/networkx/networkx/algorithms/coloring/equitable_coloring.pyi index 866e127d9b5b..94f61af53c5b 100644 --- a/stubs/networkx/networkx/algorithms/coloring/equitable_coloring.pyi +++ b/stubs/networkx/networkx/algorithms/coloring/equitable_coloring.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def equitable_color(G, num_colors): ... diff --git a/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi b/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi index aaaac626f5fb..26b8767083d0 100644 --- a/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi +++ b/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "greedy_color", @@ -15,23 +15,23 @@ __all__ = [ "strategy_smallest_last", ] -@_dispatch +@_dispatchable def strategy_largest_first(G, colors): ... -@_dispatch +@_dispatchable def strategy_random_sequential(G, colors, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def strategy_smallest_last(G, colors): ... -@_dispatch +@_dispatchable def strategy_independent_set(G, colors) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def strategy_connected_sequential_bfs(G, colors): ... -@_dispatch +@_dispatchable def strategy_connected_sequential_dfs(G, colors): ... -@_dispatch +@_dispatchable def strategy_connected_sequential(G, colors, traversal: str = "bfs") -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def strategy_saturation_largest_first(G, colors) -> Generator[Incomplete, None, Incomplete]: ... -@_dispatch +@_dispatchable def greedy_color(G, strategy: str = "largest_first", interchange: bool = False): ... class _Node: diff --git a/stubs/networkx/networkx/algorithms/communicability_alg.pyi b/stubs/networkx/networkx/algorithms/communicability_alg.pyi index 55ab8cd05c8e..9eede08f8535 100644 --- a/stubs/networkx/networkx/algorithms/communicability_alg.pyi +++ b/stubs/networkx/networkx/algorithms/communicability_alg.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def communicability(G): ... -@_dispatch +@_dispatchable def communicability_exp(G): ... diff --git a/stubs/networkx/networkx/algorithms/community/__init__.pyi b/stubs/networkx/networkx/algorithms/community/__init__.pyi index 88597e70592d..fd1d0c644e3f 100644 --- a/stubs/networkx/networkx/algorithms/community/__init__.pyi +++ b/stubs/networkx/networkx/algorithms/community/__init__.pyi @@ -1,6 +1,7 @@ from networkx.algorithms.community.asyn_fluid import * from networkx.algorithms.community.centrality import * from networkx.algorithms.community.community_utils import * +from networkx.algorithms.community.divisive import * from networkx.algorithms.community.kclique import * from networkx.algorithms.community.kernighan_lin import * from networkx.algorithms.community.label_propagation import * diff --git a/stubs/networkx/networkx/algorithms/community/asyn_fluid.pyi b/stubs/networkx/networkx/algorithms/community/asyn_fluid.pyi index 2604518ddf19..d78fdc2db5e5 100644 --- a/stubs/networkx/networkx/algorithms/community/asyn_fluid.pyi +++ b/stubs/networkx/networkx/algorithms/community/asyn_fluid.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def asyn_fluidc(G, k, max_iter: int = 100, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/community/centrality.pyi b/stubs/networkx/networkx/algorithms/community/centrality.pyi index 715fa70134ef..b6b2712c1f62 100644 --- a/stubs/networkx/networkx/algorithms/community/centrality.pyi +++ b/stubs/networkx/networkx/algorithms/community/centrality.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def girvan_newman(G, most_valuable_edge: Incomplete | None = None) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/community/community_utils.pyi b/stubs/networkx/networkx/algorithms/community/community_utils.pyi index dc011e9a775b..882dbf8ab1bf 100644 --- a/stubs/networkx/networkx/algorithms/community/community_utils.pyi +++ b/stubs/networkx/networkx/algorithms/community/community_utils.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_partition(G, communities): ... diff --git a/stubs/networkx/networkx/algorithms/community/divisive.pyi b/stubs/networkx/networkx/algorithms/community/divisive.pyi new file mode 100644 index 000000000000..6eeed32d21ab --- /dev/null +++ b/stubs/networkx/networkx/algorithms/community/divisive.pyi @@ -0,0 +1,10 @@ +from _typeshed import Incomplete + +import networkx as nx + +__all__ = ["edge_betweenness_partition", "edge_current_flow_betweenness_partition"] + +@nx._dispatchable +def edge_betweenness_partition(G, number_of_sets: int, *, weight: Incomplete | None = None) -> list[Incomplete]: ... +@nx._dispatchable +def edge_current_flow_betweenness_partition(G, number_of_sets: int, *, weight: Incomplete | None = None) -> list[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/community/kclique.pyi b/stubs/networkx/networkx/algorithms/community/kclique.pyi index aebf35222a79..39bc56a86fad 100644 --- a/stubs/networkx/networkx/algorithms/community/kclique.pyi +++ b/stubs/networkx/networkx/algorithms/community/kclique.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def k_clique_communities(G, k, cliques: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi b/stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi index e8a0ad899c67..cd15c6541079 100644 --- a/stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi +++ b/stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def kernighan_lin_bisection( G, partition: Incomplete | None = None, max_iter: int = 10, weight: str = "weight", seed: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/community/label_propagation.pyi b/stubs/networkx/networkx/algorithms/community/label_propagation.pyi index b3db6ac4cb2b..c79a95fd2829 100644 --- a/stubs/networkx/networkx/algorithms/community/label_propagation.pyi +++ b/stubs/networkx/networkx/algorithms/community/label_propagation.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def asyn_lpa_communities( G, weight: Incomplete | None = None, seed: Incomplete | None = None ) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def label_propagation_communities(G): ... diff --git a/stubs/networkx/networkx/algorithms/community/louvain.pyi b/stubs/networkx/networkx/algorithms/community/louvain.pyi index 0155ccd71ea0..e086829b451e 100644 --- a/stubs/networkx/networkx/algorithms/community/louvain.pyi +++ b/stubs/networkx/networkx/algorithms/community/louvain.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def louvain_communities( G, weight: str = "weight", resolution: float = 1, threshold: float = 1e-07, seed: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def louvain_partitions( G, weight: str = "weight", resolution: float = 1, threshold: float = 1e-07, seed: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/community/lukes.pyi b/stubs/networkx/networkx/algorithms/community/lukes.pyi index f748adb811c0..0044043faf7c 100644 --- a/stubs/networkx/networkx/algorithms/community/lukes.pyi +++ b/stubs/networkx/networkx/algorithms/community/lukes.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def lukes_partitioning(G, max_size, node_weight: Incomplete | None = None, edge_weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi index 1ac861d8a004..9842451eaba9 100644 --- a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi +++ b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def greedy_modularity_communities( G, weight: Incomplete | None = None, resolution: float = 1, cutoff: int = 1, best_n: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def naive_greedy_modularity_communities(G, resolution: float = 1, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/community/quality.pyi b/stubs/networkx/networkx/algorithms/community/quality.pyi index 2ffecb7b32e5..12f9e93f2f50 100644 --- a/stubs/networkx/networkx/algorithms/community/quality.pyi +++ b/stubs/networkx/networkx/algorithms/community/quality.pyi @@ -1,12 +1,12 @@ from networkx.exception import NetworkXError -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["modularity", "partition_quality"] class NotAPartition(NetworkXError): def __init__(self, G, collection) -> None: ... -@_dispatch +@_dispatchable def modularity(G, communities, weight: str = "weight", resolution: float = 1): ... -@_dispatch +@_dispatchable def partition_quality(G, partition): ... diff --git a/stubs/networkx/networkx/algorithms/components/attracting.pyi b/stubs/networkx/networkx/algorithms/components/attracting.pyi index 8a6dd93e342d..93e97a4fb04d 100644 --- a/stubs/networkx/networkx/algorithms/components/attracting.pyi +++ b/stubs/networkx/networkx/algorithms/components/attracting.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def attracting_components(G) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def number_attracting_components(G): ... -@_dispatch +@_dispatchable def is_attracting_component(G): ... diff --git a/stubs/networkx/networkx/algorithms/components/biconnected.pyi b/stubs/networkx/networkx/algorithms/components/biconnected.pyi index b7dc97487d77..1f58e5d23192 100644 --- a/stubs/networkx/networkx/algorithms/components/biconnected.pyi +++ b/stubs/networkx/networkx/algorithms/components/biconnected.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_biconnected(G): ... -@_dispatch +@_dispatchable def biconnected_component_edges(G) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def biconnected_components(G) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def articulation_points(G) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/components/connected.pyi b/stubs/networkx/networkx/algorithms/components/connected.pyi index 1e1024471c82..240517110407 100644 --- a/stubs/networkx/networkx/algorithms/components/connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/connected.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def connected_components(G) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def number_connected_components(G): ... -@_dispatch +@_dispatchable def is_connected(G): ... -@_dispatch +@_dispatchable def node_connected_component(G, n): ... diff --git a/stubs/networkx/networkx/algorithms/components/semiconnected.pyi b/stubs/networkx/networkx/algorithms/components/semiconnected.pyi index 179784032d95..2a65d32221aa 100644 --- a/stubs/networkx/networkx/algorithms/components/semiconnected.pyi +++ b/stubs/networkx/networkx/algorithms/components/semiconnected.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_semiconnected(G, topo_order: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi b/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi index 41b77c125ddf..d510d8c03574 100644 --- a/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi @@ -2,17 +2,17 @@ from collections.abc import Generator, Hashable, Iterable from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def strongly_connected_components(G: Graph[_Node]) -> Generator[set[_Node], None, None]: ... -@_dispatch +@_dispatchable def kosaraju_strongly_connected_components(G: Graph[_Node], source: _Node | None = None) -> Generator[set[_Node], None, None]: ... -@_dispatch +@_dispatchable def strongly_connected_components_recursive(G: Graph[_Node]) -> Generator[set[_Node], None, None]: ... -@_dispatch +@_dispatchable def number_strongly_connected_components(G: Graph[Hashable]) -> int: ... -@_dispatch +@_dispatchable def is_strongly_connected(G: Graph[Hashable]) -> bool: ... -@_dispatch +@_dispatchable def condensation(G: DiGraph[_Node], scc: Iterable[Iterable[_Node]] | None = None) -> DiGraph[int]: ... diff --git a/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi b/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi index 95283d2bd83c..66c4f7b61dfe 100644 --- a/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi @@ -1,11 +1,11 @@ from collections.abc import Generator, Hashable from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def weakly_connected_components(G: Graph[_Node]) -> Generator[set[_Node], None, None]: ... -@_dispatch +@_dispatchable def number_weakly_connected_components(G: Graph[Hashable]) -> int: ... -@_dispatch +@_dispatchable def is_weakly_connected(G: Graph[Hashable]) -> bool: ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi b/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi index 75c14803d3ed..a13069989845 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from networkx.algorithms.flow import edmonds_karp -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "average_node_connectivity", @@ -14,7 +14,7 @@ __all__ = [ default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def local_node_connectivity( G, s, @@ -24,13 +24,13 @@ def local_node_connectivity( residual: Incomplete | None = None, cutoff: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def node_connectivity(G, s: Incomplete | None = None, t: Incomplete | None = None, flow_func: Incomplete | None = None): ... -@_dispatch +@_dispatchable def average_node_connectivity(G, flow_func: Incomplete | None = None): ... -@_dispatch +@_dispatchable def all_pairs_node_connectivity(G, nbunch: Incomplete | None = None, flow_func: Incomplete | None = None): ... -@_dispatch +@_dispatchable def local_edge_connectivity( G, s, @@ -40,7 +40,7 @@ def local_edge_connectivity( residual: Incomplete | None = None, cutoff: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def edge_connectivity( G, s: Incomplete | None = None, diff --git a/stubs/networkx/networkx/algorithms/connectivity/cuts.pyi b/stubs/networkx/networkx/algorithms/connectivity/cuts.pyi index 7c930100213b..44372c2d915c 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/cuts.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/cuts.pyi @@ -1,21 +1,21 @@ from _typeshed import Incomplete from networkx.algorithms.flow import edmonds_karp -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["minimum_st_node_cut", "minimum_node_cut", "minimum_st_edge_cut", "minimum_edge_cut"] default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def minimum_st_edge_cut( G, s, t, flow_func: Incomplete | None = None, auxiliary: Incomplete | None = None, residual: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def minimum_st_node_cut( G, s, t, flow_func: Incomplete | None = None, auxiliary: Incomplete | None = None, residual: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def minimum_node_cut(G, s: Incomplete | None = None, t: Incomplete | None = None, flow_func: Incomplete | None = None): ... -@_dispatch +@_dispatchable def minimum_edge_cut(G, s: Incomplete | None = None, t: Incomplete | None = None, flow_func: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi b/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi index 6cca9ca6ca31..2f8fc3abe242 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi @@ -2,13 +2,13 @@ from _typeshed import Incomplete from collections.abc import Generator from networkx.algorithms.flow import edmonds_karp -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["edge_disjoint_paths", "node_disjoint_paths"] default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def edge_disjoint_paths( G, s, @@ -18,7 +18,7 @@ def edge_disjoint_paths( auxiliary: Incomplete | None = None, residual: Incomplete | None = None, ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def node_disjoint_paths( G, s, diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi index 133ab4460411..fe32ff99d112 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi @@ -1,13 +1,13 @@ from collections.abc import Generator, Hashable from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_k_edge_connected(G: Graph[Hashable], k: int): ... -@_dispatch +@_dispatchable def is_locally_k_edge_connected(G, s, t, k): ... -@_dispatch +@_dispatchable def k_edge_augmentation( G: Graph[_Node], k: int, diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi index f0d92cc638ce..2578606fb13f 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def k_edge_components(G, k): ... -@_dispatch +@_dispatchable def k_edge_subgraphs(G, k): ... -@_dispatch +@_dispatchable def bridge_components(G) -> Generator[Incomplete, Incomplete, None]: ... class EdgeComponentAuxGraph: diff --git a/stubs/networkx/networkx/algorithms/connectivity/kcomponents.pyi b/stubs/networkx/networkx/algorithms/connectivity/kcomponents.pyi index 967df857c7c9..ee074a6a682d 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/kcomponents.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from networkx.algorithms.flow import edmonds_karp -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["k_components"] default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def k_components(G, flow_func: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi b/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi index 20a19670600a..8f527058659c 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi @@ -2,11 +2,11 @@ from _typeshed import Incomplete from collections.abc import Generator from networkx.algorithms.flow import edmonds_karp -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["all_node_cuts"] default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def all_node_cuts(G, k: Incomplete | None = None, flow_func: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/stoerwagner.pyi b/stubs/networkx/networkx/algorithms/connectivity/stoerwagner.pyi index e8125730f977..1bd01705dec3 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/stoerwagner.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/stoerwagner.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def stoer_wagner(G, weight: str = "weight", heap=...): ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/utils.pyi b/stubs/networkx/networkx/algorithms/connectivity/utils.pyi index 12872bab7e7b..b43489088325 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/utils.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/utils.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def build_auxiliary_node_connectivity(G): ... -@_dispatch +@_dispatchable def build_auxiliary_edge_connectivity(G): ... diff --git a/stubs/networkx/networkx/algorithms/core.pyi b/stubs/networkx/networkx/algorithms/core.pyi index 65ba651473dd..44bde570425a 100644 --- a/stubs/networkx/networkx/algorithms/core.pyi +++ b/stubs/networkx/networkx/algorithms/core.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def core_number(G): ... -@_dispatch +@_dispatchable def k_core(G, k: Incomplete | None = None, core_number: Incomplete | None = None): ... -@_dispatch +@_dispatchable def k_shell(G, k: Incomplete | None = None, core_number: Incomplete | None = None): ... -@_dispatch +@_dispatchable def k_crust(G, k: Incomplete | None = None, core_number: Incomplete | None = None): ... -@_dispatch +@_dispatchable def k_corona(G, k, core_number: Incomplete | None = None): ... -@_dispatch +@_dispatchable def k_truss(G, k): ... -@_dispatch +@_dispatchable def onion_layers(G): ... diff --git a/stubs/networkx/networkx/algorithms/covering.pyi b/stubs/networkx/networkx/algorithms/covering.pyi index 67304950359e..8b50c52a1b37 100644 --- a/stubs/networkx/networkx/algorithms/covering.pyi +++ b/stubs/networkx/networkx/algorithms/covering.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_edge_cover(G, matching_algorithm: Incomplete | None = None): ... -@_dispatch +@_dispatchable def is_edge_cover(G, cover): ... diff --git a/stubs/networkx/networkx/algorithms/cuts.pyi b/stubs/networkx/networkx/algorithms/cuts.pyi index 2f6d488e2727..11ef7637a259 100644 --- a/stubs/networkx/networkx/algorithms/cuts.pyi +++ b/stubs/networkx/networkx/algorithms/cuts.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def cut_size(G, S, T: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def volume(G, S, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def normalized_cut_size(G, S, T: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def conductance(G, S, T: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def edge_expansion(G, S, T: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def mixing_expansion(G, S, T: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def node_expansion(G, S): ... -@_dispatch +@_dispatchable def boundary_expansion(G, S): ... diff --git a/stubs/networkx/networkx/algorithms/cycles.pyi b/stubs/networkx/networkx/algorithms/cycles.pyi index a4b09797b966..8236680f3f05 100644 --- a/stubs/networkx/networkx/algorithms/cycles.pyi +++ b/stubs/networkx/networkx/algorithms/cycles.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def cycle_basis(G, root: Incomplete | None = None): ... -@_dispatch +@_dispatchable def simple_cycles(G, length_bound: Incomplete | None = None) -> Generator[Incomplete, Incomplete, None]: ... class _NeighborhoodCache(dict[Incomplete, Incomplete]): @@ -13,11 +13,11 @@ class _NeighborhoodCache(dict[Incomplete, Incomplete]): def __init__(self, G) -> None: ... def __missing__(self, v): ... -@_dispatch +@_dispatchable def chordless_cycles(G, length_bound: Incomplete | None = None) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def recursive_simple_cycles(G): ... -@_dispatch +@_dispatchable def find_cycle(G, source: Incomplete | None = None, orientation: Incomplete | None = None): ... -@_dispatch +@_dispatchable def minimum_cycle_basis(G, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/d_separation.pyi b/stubs/networkx/networkx/algorithms/d_separation.pyi index 8ee16cec2003..c672127feb42 100644 --- a/stubs/networkx/networkx/algorithms/d_separation.pyi +++ b/stubs/networkx/networkx/algorithms/d_separation.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def d_separated(G, x, y, z): ... -@_dispatch +@_dispatchable def minimal_d_separator(G, u, v): ... -@_dispatch +@_dispatchable def is_minimal_d_separator(G, u, v, z): ... diff --git a/stubs/networkx/networkx/algorithms/dag.pyi b/stubs/networkx/networkx/algorithms/dag.pyi index 6f894e7a1e60..b85fff5cb09b 100644 --- a/stubs/networkx/networkx/algorithms/dag.pyi +++ b/stubs/networkx/networkx/algorithms/dag.pyi @@ -3,39 +3,39 @@ from collections.abc import Callable, Generator, Iterable, Reversible from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def descendants(G: Graph[_Node], source: _Node) -> set[_Node]: ... -@_dispatch +@_dispatchable def ancestors(G: Graph[_Node], source: _Node) -> set[_Node]: ... -@_dispatch +@_dispatchable def is_directed_acyclic_graph(G: Graph[_Node]) -> bool: ... -@_dispatch +@_dispatchable def topological_generations(G: DiGraph[_Node]) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def topological_sort(G: DiGraph[_Node]) -> Generator[_Node, None, None]: ... -@_dispatch +@_dispatchable def lexicographical_topological_sort( G: DiGraph[_Node], key: Callable[[_Node], SupportsRichComparison] | None = None ) -> Generator[_Node, None, None]: ... -@_dispatch +@_dispatchable def all_topological_sorts(G: DiGraph[_Node]) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def is_aperiodic(G: DiGraph[_Node]) -> bool: ... -@_dispatch +@_dispatchable def transitive_closure(G: Graph[_Node], reflexive: bool = False) -> Graph[_Node]: ... -@_dispatch +@_dispatchable def transitive_closure_dag(G: DiGraph[_Node], reflexive: bool = False) -> DiGraph[_Node]: ... -@_dispatch +@_dispatchable def transitive_reduction(G: DiGraph[_Node]) -> DiGraph[_Node]: ... -@_dispatch +@_dispatchable def antichains(G: DiGraph[_Node], topo_order: Reversible[_Node] | None = None) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def dag_longest_path( G: DiGraph[_Node], weight: str = "weight", default_weight: int = 1, topo_order: Iterable[_Node] | None = None ) -> list[_Node]: ... -@_dispatch +@_dispatchable def dag_longest_path_length(G: DiGraph[_Node], weight: str = "weight", default_weight: int = 1) -> int: ... -@_dispatch +@_dispatchable def dag_to_branching(G: Graph[_Node]) -> Graph[_Node]: ... diff --git a/stubs/networkx/networkx/algorithms/distance_measures.pyi b/stubs/networkx/networkx/algorithms/distance_measures.pyi index 6949c26695fb..35e356e71cb7 100644 --- a/stubs/networkx/networkx/algorithms/distance_measures.pyi +++ b/stubs/networkx/networkx/algorithms/distance_measures.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def eccentricity(G, v: Incomplete | None = None, sp: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def diameter(G, e: Incomplete | None = None, usebounds: bool = False, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def periphery(G, e: Incomplete | None = None, usebounds: bool = False, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def radius(G, e: Incomplete | None = None, usebounds: bool = False, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def center(G, e: Incomplete | None = None, usebounds: bool = False, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def barycenter(G, weight: Incomplete | None = None, attr: Incomplete | None = None, sp: Incomplete | None = None): ... -@_dispatch +@_dispatchable def resistance_distance(G, nodeA, nodeB, weight: Incomplete | None = None, invert_weight: bool = True): ... diff --git a/stubs/networkx/networkx/algorithms/distance_regular.pyi b/stubs/networkx/networkx/algorithms/distance_regular.pyi index 4b3b23e02616..e477deb4a0cb 100644 --- a/stubs/networkx/networkx/algorithms/distance_regular.pyi +++ b/stubs/networkx/networkx/algorithms/distance_regular.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_distance_regular(G): ... -@_dispatch +@_dispatchable def global_parameters(b, c): ... -@_dispatch +@_dispatchable def intersection_array(G): ... -@_dispatch +@_dispatchable def is_strongly_regular(G): ... diff --git a/stubs/networkx/networkx/algorithms/dominance.pyi b/stubs/networkx/networkx/algorithms/dominance.pyi index 37d5ab6e59ca..a87b0172e7da 100644 --- a/stubs/networkx/networkx/algorithms/dominance.pyi +++ b/stubs/networkx/networkx/algorithms/dominance.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def immediate_dominators(G, start): ... -@_dispatch +@_dispatchable def dominance_frontiers(G, start): ... diff --git a/stubs/networkx/networkx/algorithms/dominating.pyi b/stubs/networkx/networkx/algorithms/dominating.pyi index 03dae96b882f..0f9535464f32 100644 --- a/stubs/networkx/networkx/algorithms/dominating.pyi +++ b/stubs/networkx/networkx/algorithms/dominating.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def dominating_set(G, start_with: Incomplete | None = None): ... -@_dispatch +@_dispatchable def is_dominating_set(G, nbunch): ... diff --git a/stubs/networkx/networkx/algorithms/efficiency_measures.pyi b/stubs/networkx/networkx/algorithms/efficiency_measures.pyi index c3eb6064721d..a0083616a943 100644 --- a/stubs/networkx/networkx/algorithms/efficiency_measures.pyi +++ b/stubs/networkx/networkx/algorithms/efficiency_measures.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def efficiency(G, u, v): ... -@_dispatch +@_dispatchable def global_efficiency(G): ... -@_dispatch +@_dispatchable def local_efficiency(G): ... diff --git a/stubs/networkx/networkx/algorithms/euler.pyi b/stubs/networkx/networkx/algorithms/euler.pyi index f63b1337d624..b88b278cc30e 100644 --- a/stubs/networkx/networkx/algorithms/euler.pyi +++ b/stubs/networkx/networkx/algorithms/euler.pyi @@ -1,17 +1,17 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_eulerian(G): ... -@_dispatch +@_dispatchable def is_semieulerian(G): ... -@_dispatch +@_dispatchable def eulerian_circuit(G, source: Incomplete | None = None, keys: bool = False) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def has_eulerian_path(G, source: Incomplete | None = None): ... -@_dispatch +@_dispatchable def eulerian_path(G, source: Incomplete | None = None, keys: bool = False) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def eulerize(G): ... diff --git a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi index 94e7ad790fbd..f5a6c21b3f23 100644 --- a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi +++ b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def boykov_kolmogorov( G, s, diff --git a/stubs/networkx/networkx/algorithms/flow/capacityscaling.pyi b/stubs/networkx/networkx/algorithms/flow/capacityscaling.pyi index bdcad0ee8e28..36918442e80e 100644 --- a/stubs/networkx/networkx/algorithms/flow/capacityscaling.pyi +++ b/stubs/networkx/networkx/algorithms/flow/capacityscaling.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def capacity_scaling(G, demand: str = "demand", capacity: str = "capacity", weight: str = "weight", heap=...): ... diff --git a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi index bf85ca8f542b..2a37c2973077 100644 --- a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi +++ b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def dinitz( G, s, diff --git a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi index f6c43c5f0d71..0989f90f39d3 100644 --- a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi +++ b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def edmonds_karp( G, s, diff --git a/stubs/networkx/networkx/algorithms/flow/gomory_hu.pyi b/stubs/networkx/networkx/algorithms/flow/gomory_hu.pyi index a72af8b9f54b..5c7f878564d1 100644 --- a/stubs/networkx/networkx/algorithms/flow/gomory_hu.pyi +++ b/stubs/networkx/networkx/algorithms/flow/gomory_hu.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable from .edmondskarp import edmonds_karp @@ -8,5 +8,5 @@ __all__ = ["gomory_hu_tree"] default_flow_func = edmonds_karp -@_dispatch +@_dispatchable def gomory_hu_tree(G, capacity: str = "capacity", flow_func: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/flow/maxflow.pyi b/stubs/networkx/networkx/algorithms/flow/maxflow.pyi index ef3e7acc33d7..f64d48aa8cdb 100644 --- a/stubs/networkx/networkx/algorithms/flow/maxflow.pyi +++ b/stubs/networkx/networkx/algorithms/flow/maxflow.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable from .preflowpush import preflow_push @@ -8,11 +8,11 @@ __all__ = ["maximum_flow", "maximum_flow_value", "minimum_cut", "minimum_cut_val default_flow_func = preflow_push -@_dispatch +@_dispatchable def maximum_flow(flowG, _s, _t, capacity: str = "capacity", flow_func: Incomplete | None = None, **kwargs): ... -@_dispatch +@_dispatchable def maximum_flow_value(flowG, _s, _t, capacity: str = "capacity", flow_func: Incomplete | None = None, **kwargs): ... -@_dispatch +@_dispatchable def minimum_cut(flowG, _s, _t, capacity: str = "capacity", flow_func: Incomplete | None = None, **kwargs): ... -@_dispatch +@_dispatchable def minimum_cut_value(flowG, _s, _t, capacity: str = "capacity", flow_func: Incomplete | None = None, **kwargs): ... diff --git a/stubs/networkx/networkx/algorithms/flow/mincost.pyi b/stubs/networkx/networkx/algorithms/flow/mincost.pyi index d1bed62bb8af..41f70569369b 100644 --- a/stubs/networkx/networkx/algorithms/flow/mincost.pyi +++ b/stubs/networkx/networkx/algorithms/flow/mincost.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def min_cost_flow_cost(G, demand: str = "demand", capacity: str = "capacity", weight: str = "weight"): ... -@_dispatch +@_dispatchable def min_cost_flow(G, demand: str = "demand", capacity: str = "capacity", weight: str = "weight"): ... -@_dispatch +@_dispatchable def cost_of_flow(G, flowDict, weight: str = "weight"): ... -@_dispatch +@_dispatchable def max_flow_min_cost(G, s, t, capacity: str = "capacity", weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi b/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi index 662b663594d2..dcbc88ac35c6 100644 --- a/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi +++ b/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class _DataEssentialsAndFunctions: node_list: Incomplete @@ -38,5 +38,5 @@ class _DataEssentialsAndFunctions: def residual_capacity(self, i, p): ... def find_leaving_edge(self, Wn, We): ... -@_dispatch +@_dispatchable def network_simplex(G, demand: str = "demand", capacity: str = "capacity", weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi index 97ce358a1524..51547a1c03a1 100644 --- a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi +++ b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def preflow_push( G, s, diff --git a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi index 2d700002750e..93fdf09f637c 100644 --- a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi +++ b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def shortest_augmenting_path( G, s, diff --git a/stubs/networkx/networkx/algorithms/flow/utils.pyi b/stubs/networkx/networkx/algorithms/flow/utils.pyi index 41b7bb9455b0..04c99b4ed081 100644 --- a/stubs/networkx/networkx/algorithms/flow/utils.pyi +++ b/stubs/networkx/networkx/algorithms/flow/utils.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class CurrentEdge: def __init__(self, edges) -> None: ... @@ -18,9 +18,9 @@ class GlobalRelabelThreshold: def is_reached(self): ... def clear_work(self) -> None: ... -@_dispatch +@_dispatchable def build_residual_network(G, capacity): ... -@_dispatch +@_dispatchable def detect_unboundedness(R, s, t) -> None: ... -@_dispatch +@_dispatchable def build_flow_dict(G, R): ... diff --git a/stubs/networkx/networkx/algorithms/graph_hashing.pyi b/stubs/networkx/networkx/algorithms/graph_hashing.pyi index 50d4c672189e..218bf2f6a0d5 100644 --- a/stubs/networkx/networkx/algorithms/graph_hashing.pyi +++ b/stubs/networkx/networkx/algorithms/graph_hashing.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def weisfeiler_lehman_graph_hash( G, edge_attr: Incomplete | None = None, node_attr: Incomplete | None = None, iterations: int = 3, digest_size: int = 16 ): ... -@_dispatch +@_dispatchable def weisfeiler_lehman_subgraph_hashes( G, edge_attr: Incomplete | None = None, node_attr: Incomplete | None = None, iterations: int = 3, digest_size: int = 16 ): ... diff --git a/stubs/networkx/networkx/algorithms/graphical.pyi b/stubs/networkx/networkx/algorithms/graphical.pyi index 02b44c455553..5f886377b9b7 100644 --- a/stubs/networkx/networkx/algorithms/graphical.pyi +++ b/stubs/networkx/networkx/algorithms/graphical.pyi @@ -1,14 +1,14 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_graphical(sequence, method: str = "eg"): ... -@_dispatch +@_dispatchable def is_valid_degree_sequence_havel_hakimi(deg_sequence): ... -@_dispatch +@_dispatchable def is_valid_degree_sequence_erdos_gallai(deg_sequence): ... -@_dispatch +@_dispatchable def is_multigraphical(sequence): ... -@_dispatch +@_dispatchable def is_pseudographical(sequence): ... -@_dispatch +@_dispatchable def is_digraphical(in_sequence, out_sequence): ... diff --git a/stubs/networkx/networkx/algorithms/hierarchy.pyi b/stubs/networkx/networkx/algorithms/hierarchy.pyi index 6cecb2b2649a..09f4dc139b70 100644 --- a/stubs/networkx/networkx/algorithms/hierarchy.pyi +++ b/stubs/networkx/networkx/algorithms/hierarchy.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def flow_hierarchy(G, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/hybrid.pyi b/stubs/networkx/networkx/algorithms/hybrid.pyi index efb3a27eb677..3bbc857d1feb 100644 --- a/stubs/networkx/networkx/algorithms/hybrid.pyi +++ b/stubs/networkx/networkx/algorithms/hybrid.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def kl_connected_subgraph(G, k, l, low_memory: bool = False, same_as_graph: bool = False): ... -@_dispatch +@_dispatchable def is_kl_connected(G, k, l, low_memory: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/isolate.pyi b/stubs/networkx/networkx/algorithms/isolate.pyi index f620e5e62d2f..1030cb1c5bb4 100644 --- a/stubs/networkx/networkx/algorithms/isolate.pyi +++ b/stubs/networkx/networkx/algorithms/isolate.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_isolate(G, n): ... -@_dispatch +@_dispatchable def isolates(G): ... -@_dispatch +@_dispatchable def number_of_isolates(G): ... diff --git a/stubs/networkx/networkx/algorithms/isomorphism/isomorph.pyi b/stubs/networkx/networkx/algorithms/isomorphism/isomorph.pyi index 7d2fa069c6fc..895b71cb59af 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/isomorph.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/isomorph.pyi @@ -1,23 +1,23 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["could_be_isomorphic", "fast_could_be_isomorphic", "faster_could_be_isomorphic", "is_isomorphic"] -@_dispatch +@_dispatchable def could_be_isomorphic(G1, G2): ... graph_could_be_isomorphic = could_be_isomorphic -@_dispatch +@_dispatchable def fast_could_be_isomorphic(G1, G2): ... fast_graph_could_be_isomorphic = fast_could_be_isomorphic -@_dispatch +@_dispatchable def faster_could_be_isomorphic(G1, G2): ... faster_graph_could_be_isomorphic = faster_could_be_isomorphic -@_dispatch +@_dispatchable def is_isomorphic(G1, G2, node_match: Incomplete | None = None, edge_match: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi index 74cb0f8846e6..aab135be0fda 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi @@ -1,25 +1,25 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def categorical_node_match(attr, default): ... categorical_edge_match: Incomplete -@_dispatch +@_dispatchable def categorical_multiedge_match(attr, default): ... -@_dispatch +@_dispatchable def numerical_node_match(attr, default, rtol: float = 1e-05, atol: float = 1e-08): ... numerical_edge_match: Incomplete -@_dispatch +@_dispatchable def numerical_multiedge_match(attr, default, rtol: float = 1e-05, atol: float = 1e-08): ... -@_dispatch +@_dispatchable def generic_node_match(attr, default, op): ... generic_edge_match: Incomplete -@_dispatch +@_dispatchable def generic_multiedge_match(attr, default, op): ... diff --git a/stubs/networkx/networkx/algorithms/isomorphism/tree_isomorphism.pyi b/stubs/networkx/networkx/algorithms/isomorphism/tree_isomorphism.pyi index 7919706169a9..8c56107e1774 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/tree_isomorphism.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/tree_isomorphism.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def rooted_tree_isomorphism(t1, root1, t2, root2): ... -@_dispatch +@_dispatchable def tree_isomorphism(t1, t2): ... diff --git a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi index 8cfa42a4357d..d8916fbadba8 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from collections.abc import Generator from typing import NamedTuple -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class _GraphParameters(NamedTuple): G1: Incomplete @@ -25,11 +25,11 @@ class _StateParameters(NamedTuple): T2_tilde: Incomplete T2_tilde_in: Incomplete -@_dispatch +@_dispatchable def vf2pp_isomorphism(G1, G2, node_label: Incomplete | None = None, default_label: Incomplete | None = None): ... -@_dispatch +@_dispatchable def vf2pp_is_isomorphic(G1, G2, node_label: Incomplete | None = None, default_label: Incomplete | None = None): ... -@_dispatch +@_dispatchable def vf2pp_all_isomorphisms( G1, G2, node_label: Incomplete | None = None, default_label: Incomplete | None = None ) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi b/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi index 46b3f7099315..d2dba97399b5 100644 --- a/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi +++ b/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def hits(G, max_iter: int = 100, tol: float = 1e-08, nstart: Incomplete | None = None, normalized: bool = True): ... diff --git a/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi b/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi index c283f0e66492..2ed3765aecce 100644 --- a/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi +++ b/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def pagerank( G, alpha: float = 0.85, @@ -13,7 +13,7 @@ def pagerank( weight: str = "weight", dangling: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def google_matrix( G, alpha: float = 0.85, diff --git a/stubs/networkx/networkx/algorithms/link_prediction.pyi b/stubs/networkx/networkx/algorithms/link_prediction.pyi index aa0a530fbd77..1ef94518386e 100644 --- a/stubs/networkx/networkx/algorithms/link_prediction.pyi +++ b/stubs/networkx/networkx/algorithms/link_prediction.pyi @@ -1,20 +1,20 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def resource_allocation_index(G, ebunch: Incomplete | None = None): ... -@_dispatch +@_dispatchable def jaccard_coefficient(G, ebunch: Incomplete | None = None): ... -@_dispatch +@_dispatchable def adamic_adar_index(G, ebunch: Incomplete | None = None): ... -@_dispatch +@_dispatchable def common_neighbor_centrality(G, ebunch: Incomplete | None = None, alpha: float = 0.8): ... -@_dispatch +@_dispatchable def preferential_attachment(G, ebunch: Incomplete | None = None): ... -@_dispatch +@_dispatchable def cn_soundarajan_hopcroft(G, ebunch: Incomplete | None = None, community: str = "community"): ... -@_dispatch +@_dispatchable def ra_index_soundarajan_hopcroft(G, ebunch: Incomplete | None = None, community: str = "community"): ... -@_dispatch +@_dispatchable def within_inter_cluster(G, ebunch: Incomplete | None = None, delta: float = 0.001, community: str = "community"): ... diff --git a/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi b/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi index f9e16cfc4ffc..700a7fce8c73 100644 --- a/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi +++ b/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def all_pairs_lowest_common_ancestor(G, pairs: Incomplete | None = None): ... -@_dispatch +@_dispatchable def lowest_common_ancestor(G, node1, node2, default: Incomplete | None = None): ... -@_dispatch +@_dispatchable def tree_all_pairs_lowest_common_ancestor( G, root: Incomplete | None = None, pairs: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/matching.pyi b/stubs/networkx/networkx/algorithms/matching.pyi index 3873396af248..ba797a5a12b3 100644 --- a/stubs/networkx/networkx/algorithms/matching.pyi +++ b/stubs/networkx/networkx/algorithms/matching.pyi @@ -1,14 +1,14 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def maximal_matching(G): ... -@_dispatch +@_dispatchable def is_matching(G, matching): ... -@_dispatch +@_dispatchable def is_maximal_matching(G, matching): ... -@_dispatch +@_dispatchable def is_perfect_matching(G, matching): ... -@_dispatch +@_dispatchable def min_weight_matching(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def max_weight_matching(G, maxcardinality: bool = False, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/minors/contraction.pyi b/stubs/networkx/networkx/algorithms/minors/contraction.pyi index 1a1a1fdc21ba..c76c1b1b5d48 100644 --- a/stubs/networkx/networkx/algorithms/minors/contraction.pyi +++ b/stubs/networkx/networkx/algorithms/minors/contraction.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def equivalence_classes(iterable, relation): ... -@_dispatch +@_dispatchable def quotient_graph( G, partition, @@ -14,10 +14,10 @@ def quotient_graph( relabel: bool = False, create_using: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def contracted_nodes(G, u, v, self_loops: bool = True, copy: bool = True): ... identified_nodes = contracted_nodes -@_dispatch +@_dispatchable def contracted_edge(G, edge, self_loops: bool = True, copy: bool = True): ... diff --git a/stubs/networkx/networkx/algorithms/mis.pyi b/stubs/networkx/networkx/algorithms/mis.pyi index 4172e5faba15..1d4b262dde29 100644 --- a/stubs/networkx/networkx/algorithms/mis.pyi +++ b/stubs/networkx/networkx/algorithms/mis.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def maximal_independent_set(G, nodes: Incomplete | None = None, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/moral.pyi b/stubs/networkx/networkx/algorithms/moral.pyi index e333ac5e21ae..570061651f86 100644 --- a/stubs/networkx/networkx/algorithms/moral.pyi +++ b/stubs/networkx/networkx/algorithms/moral.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def moral_graph(G): ... diff --git a/stubs/networkx/networkx/algorithms/node_classification.pyi b/stubs/networkx/networkx/algorithms/node_classification.pyi index bec0e815a189..510c72a25e3d 100644 --- a/stubs/networkx/networkx/algorithms/node_classification.pyi +++ b/stubs/networkx/networkx/algorithms/node_classification.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def harmonic_function(G, max_iter: int = 30, label_name: str = "label"): ... -@_dispatch +@_dispatchable def local_and_global_consistency(G, alpha: float = 0.99, max_iter: int = 30, label_name: str = "label"): ... diff --git a/stubs/networkx/networkx/algorithms/non_randomness.pyi b/stubs/networkx/networkx/algorithms/non_randomness.pyi index 82459492d3ae..5e0941436883 100644 --- a/stubs/networkx/networkx/algorithms/non_randomness.pyi +++ b/stubs/networkx/networkx/algorithms/non_randomness.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def non_randomness(G, k: Incomplete | None = None, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/operators/all.pyi b/stubs/networkx/networkx/algorithms/operators/all.pyi index c14667101088..a595296a7853 100644 --- a/stubs/networkx/networkx/algorithms/operators/all.pyi +++ b/stubs/networkx/networkx/algorithms/operators/all.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def union_all(graphs, rename=()): ... -@_dispatch +@_dispatchable def disjoint_union_all(graphs): ... -@_dispatch +@_dispatchable def compose_all(graphs): ... -@_dispatch +@_dispatchable def intersection_all(graphs): ... diff --git a/stubs/networkx/networkx/algorithms/operators/binary.pyi b/stubs/networkx/networkx/algorithms/operators/binary.pyi index 8c45b4aa9fc8..ef7f4943ca52 100644 --- a/stubs/networkx/networkx/algorithms/operators/binary.pyi +++ b/stubs/networkx/networkx/algorithms/operators/binary.pyi @@ -2,15 +2,15 @@ from collections.abc import Hashable from typing import TypeVar from networkx.classes.digraph import DiGraph -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def disjoint_union(G, H): ... -@_dispatch +@_dispatchable def intersection(G, H): ... -@_dispatch +@_dispatchable def difference(G, H): ... -@_dispatch +@_dispatchable def symmetric_difference(G, H): ... _X = TypeVar("_X", bound=Hashable, covariant=True) @@ -18,7 +18,7 @@ _Y = TypeVar("_Y", bound=Hashable, covariant=True) # GT = TypeVar('GT', bound=Graph[_Node]) # TODO: This does not handle the cases when graphs of different types are passed which is allowed -@_dispatch +@_dispatchable def compose(G: DiGraph[_X], H: DiGraph[_Y]) -> DiGraph[_X | _Y]: ... -@_dispatch +@_dispatchable def union(G: DiGraph[_X], H: DiGraph[_Y], rename=()) -> DiGraph[_X | _Y]: ... diff --git a/stubs/networkx/networkx/algorithms/operators/product.pyi b/stubs/networkx/networkx/algorithms/operators/product.pyi index e7dc28a4e179..96b54b2d4275 100644 --- a/stubs/networkx/networkx/algorithms/operators/product.pyi +++ b/stubs/networkx/networkx/algorithms/operators/product.pyi @@ -1,16 +1,16 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def tensor_product(G, H): ... -@_dispatch +@_dispatchable def cartesian_product(G, H): ... -@_dispatch +@_dispatchable def lexicographic_product(G, H): ... -@_dispatch +@_dispatchable def strong_product(G, H): ... -@_dispatch +@_dispatchable def power(G, k): ... -@_dispatch +@_dispatchable def rooted_product(G, H, root): ... -@_dispatch +@_dispatchable def corona_product(G, H): ... diff --git a/stubs/networkx/networkx/algorithms/operators/unary.pyi b/stubs/networkx/networkx/algorithms/operators/unary.pyi index 9fe98be94ce3..b17f988839b3 100644 --- a/stubs/networkx/networkx/algorithms/operators/unary.pyi +++ b/stubs/networkx/networkx/algorithms/operators/unary.pyi @@ -2,11 +2,11 @@ from collections.abc import Hashable from typing import TypeVar from networkx.classes.graph import Graph -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable _G = TypeVar("_G", bound=Graph[Hashable]) -@_dispatch +@_dispatchable def complement(G): ... -@_dispatch +@_dispatchable def reverse(G: _G, copy: bool = True) -> _G: ... diff --git a/stubs/networkx/networkx/algorithms/planar_drawing.pyi b/stubs/networkx/networkx/algorithms/planar_drawing.pyi index 315cc41d1935..028c7aec2520 100644 --- a/stubs/networkx/networkx/algorithms/planar_drawing.pyi +++ b/stubs/networkx/networkx/algorithms/planar_drawing.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def combinatorial_embedding_to_pos(embedding, fully_triangulate: bool = False): ... diff --git a/stubs/networkx/networkx/algorithms/planarity.pyi b/stubs/networkx/networkx/algorithms/planarity.pyi index 03f951d108d5..5df3c945c7c4 100644 --- a/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/stubs/networkx/networkx/algorithms/planarity.pyi @@ -3,13 +3,13 @@ from collections.abc import Generator, Mapping, MutableSet, Reversible from networkx.classes.digraph import DiGraph from networkx.classes.graph import _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["check_planarity", "is_planar", "PlanarEmbedding"] -@_dispatch +@_dispatchable def is_planar(G) -> bool: ... -@_dispatch +@_dispatchable def check_planarity(G, counterexample: bool = False): ... class Interval: diff --git a/stubs/networkx/networkx/algorithms/polynomials.pyi b/stubs/networkx/networkx/algorithms/polynomials.pyi index d6f4cb06673e..805beff63985 100644 --- a/stubs/networkx/networkx/algorithms/polynomials.pyi +++ b/stubs/networkx/networkx/algorithms/polynomials.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def tutte_polynomial(G): ... -@_dispatch +@_dispatchable def chromatic_polynomial(G): ... diff --git a/stubs/networkx/networkx/algorithms/reciprocity.pyi b/stubs/networkx/networkx/algorithms/reciprocity.pyi index 56195c75279f..3af842628188 100644 --- a/stubs/networkx/networkx/algorithms/reciprocity.pyi +++ b/stubs/networkx/networkx/algorithms/reciprocity.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def reciprocity(G, nodes: Incomplete | None = None): ... -@_dispatch +@_dispatchable def overall_reciprocity(G): ... diff --git a/stubs/networkx/networkx/algorithms/regular.pyi b/stubs/networkx/networkx/algorithms/regular.pyi index 7a0be21305d7..1e66cfe1c92d 100644 --- a/stubs/networkx/networkx/algorithms/regular.pyi +++ b/stubs/networkx/networkx/algorithms/regular.pyi @@ -1,8 +1,8 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_regular(G): ... -@_dispatch +@_dispatchable def is_k_regular(G, k): ... -@_dispatch +@_dispatchable def k_factor(G, k, matching_weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/richclub.pyi b/stubs/networkx/networkx/algorithms/richclub.pyi index b7da6c2db4b6..fa8f1f06df26 100644 --- a/stubs/networkx/networkx/algorithms/richclub.pyi +++ b/stubs/networkx/networkx/algorithms/richclub.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def rich_club_coefficient(G, normalized: bool = True, Q: float = 100, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi index 28a07a518a35..6b5160269014 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def astar_path(G, source, target, heuristic: Incomplete | None = None, weight: str = "weight"): ... -@_dispatch +@_dispatchable def astar_path_length(G, source, target, heuristic: Incomplete | None = None, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/dense.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/dense.pyi index fc7b12cb88aa..355782732342 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/dense.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/dense.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def floyd_warshall_numpy(G, nodelist: Incomplete | None = None, weight: str = "weight"): ... -@_dispatch +@_dispatchable def floyd_warshall_predecessor_and_distance(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def reconstruct_path(source, target, predecessors): ... -@_dispatch +@_dispatchable def floyd_warshall(G, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi index 2aefd6903c57..82723d3eb9e8 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi @@ -3,9 +3,9 @@ from collections.abc import Generator from typing import overload from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def has_path(G: Graph[_Node], source: _Node, target: _Node) -> bool: ... @overload def shortest_path( @@ -15,7 +15,7 @@ def shortest_path( def shortest_path(G: Graph[_Node], target: _Node, method: str = "dijkstra") -> dict[_Node, list[_Node]]: ... @overload def shortest_path(G: Graph[_Node], source: _Node, method: str = "dijkstra") -> dict[_Node, list[_Node]]: ... -@_dispatch +@_dispatchable def shortest_path_length( G, source: Incomplete | None = None, @@ -23,9 +23,9 @@ def shortest_path_length( weight: Incomplete | None = None, method: str = "dijkstra", ): ... -@_dispatch +@_dispatchable def average_shortest_path_length(G, weight: Incomplete | None = None, method: str | None = None): ... -@_dispatch +@_dispatchable def all_shortest_paths( G: Graph[_Node], source: _Node, target: _Node, weight: Incomplete | None = None, method: str = "dijkstra" ) -> Generator[list[_Node], None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi index b9505baa86da..cb4eeab99d23 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi @@ -1,23 +1,23 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def single_source_shortest_path_length(G, source, cutoff: Incomplete | None = None): ... -@_dispatch +@_dispatchable def single_target_shortest_path_length(G, target, cutoff: Incomplete | None = None): ... -@_dispatch +@_dispatchable def all_pairs_shortest_path_length(G, cutoff: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def bidirectional_shortest_path(G, source, target): ... -@_dispatch +@_dispatchable def single_source_shortest_path(G, source, cutoff: Incomplete | None = None): ... -@_dispatch +@_dispatchable def single_target_shortest_path(G, target, cutoff: Incomplete | None = None): ... -@_dispatch +@_dispatchable def all_pairs_shortest_path(G, cutoff: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def predecessor( G, source, target: Incomplete | None = None, cutoff: Incomplete | None = None, return_seen: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi index ad3d0d0c3879..2716cbfbc84c 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi @@ -3,70 +3,70 @@ from collections.abc import Callable, Generator from typing import Any from typing_extensions import TypeAlias -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable # type alias for the weight function _WeightFunction: TypeAlias = Callable[[Any, Any, dict[str, Any]], float | None] -@_dispatch +@_dispatchable def dijkstra_path(G, source, target, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def dijkstra_path_length(G, source, target, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_dijkstra_path(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_dijkstra_path_length(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_dijkstra( G, source, target: Incomplete | None = None, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" ): ... -@_dispatch +@_dispatchable def multi_source_dijkstra_path(G, sources, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def multi_source_dijkstra_path_length(G, sources, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def multi_source_dijkstra( G, sources, target: Incomplete | None = None, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" ): ... -@_dispatch +@_dispatchable def dijkstra_predecessor_and_distance(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def all_pairs_dijkstra( G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def all_pairs_dijkstra_path_length( G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def all_pairs_dijkstra_path( G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def bellman_ford_predecessor_and_distance( G, source, target: Incomplete | None = None, weight: str | _WeightFunction = "weight", heuristic: bool = False ): ... -@_dispatch +@_dispatchable def bellman_ford_path(G, source, target, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def bellman_ford_path_length(G, source, target, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_bellman_ford_path(G, source, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_bellman_ford_path_length(G, source, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def single_source_bellman_ford(G, source, target: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def all_pairs_bellman_ford_path_length(G, weight: str | _WeightFunction = "weight") -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def all_pairs_bellman_ford_path(G, weight: str | _WeightFunction = "weight") -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def goldberg_radzik(G, source, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def negative_edge_cycle(G, weight: str | _WeightFunction = "weight", heuristic: bool = True): ... -@_dispatch +@_dispatchable def find_negative_cycle(G, source, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def bidirectional_dijkstra(G, source, target, weight: str | _WeightFunction = "weight"): ... -@_dispatch +@_dispatchable def johnson(G, weight: str | _WeightFunction = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/similarity.pyi b/stubs/networkx/networkx/algorithms/similarity.pyi index dbd0e036dd4e..bec692662f97 100644 --- a/stubs/networkx/networkx/algorithms/similarity.pyi +++ b/stubs/networkx/networkx/algorithms/similarity.pyi @@ -1,9 +1,9 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def graph_edit_distance( G1, G2, @@ -19,7 +19,7 @@ def graph_edit_distance( upper_bound: Incomplete | None = None, timeout: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def optimal_edit_paths( G1, G2, @@ -33,7 +33,7 @@ def optimal_edit_paths( edge_ins_cost: Incomplete | None = None, upper_bound: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def optimize_graph_edit_distance( G1, G2, @@ -47,7 +47,7 @@ def optimize_graph_edit_distance( edge_ins_cost: Incomplete | None = None, upper_bound: Incomplete | None = None, ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def optimize_edit_paths( G1, G2, @@ -64,7 +64,7 @@ def optimize_edit_paths( roots: Incomplete | None = None, timeout: Incomplete | None = None, ) -> Generator[Incomplete, None, Incomplete]: ... -@_dispatch +@_dispatchable def simrank_similarity( G, source: Incomplete | None = None, @@ -73,11 +73,11 @@ def simrank_similarity( max_iterations: int = 1000, tolerance: float = 0.0001, ): ... -@_dispatch +@_dispatchable def panther_similarity( G, source, k: int = 5, path_length: int = 5, c: float = 0.5, delta: float = 0.1, eps: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def generate_random_paths( G, sample_size, path_length: int = 5, index_map: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/simple_paths.pyi b/stubs/networkx/networkx/algorithms/simple_paths.pyi index 292bf9d57b01..6e69d1d1386e 100644 --- a/stubs/networkx/networkx/algorithms/simple_paths.pyi +++ b/stubs/networkx/networkx/algorithms/simple_paths.pyi @@ -2,21 +2,21 @@ from _typeshed import Incomplete from collections.abc import Generator, Sequence from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["all_simple_paths", "is_simple_path", "shortest_simple_paths", "all_simple_edge_paths"] -@_dispatch +@_dispatchable def is_simple_path(G: Graph[_Node], nodes: Sequence[_Node]): ... -@_dispatch +@_dispatchable def all_simple_paths( G: Graph[_Node], source: _Node, target: _Node, cutoff: Incomplete | None = None ) -> Generator[list[_Node], None, None]: ... -@_dispatch +@_dispatchable def all_simple_edge_paths( G: Graph[_Node], source: _Node, target: _Node, cutoff: Incomplete | None = None ) -> Generator[list[_Node] | list[tuple[_Node, _Node]], None, list[_Node] | None]: ... -@_dispatch +@_dispatchable def shortest_simple_paths( G: Graph[_Node], source: _Node, target: _Node, weight: Incomplete | None = None ) -> Generator[list[_Node], None, None]: ... diff --git a/stubs/networkx/networkx/algorithms/smallworld.pyi b/stubs/networkx/networkx/algorithms/smallworld.pyi index eb1a8c653ea4..cb9c7b252e04 100644 --- a/stubs/networkx/networkx/algorithms/smallworld.pyi +++ b/stubs/networkx/networkx/algorithms/smallworld.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def random_reference(G, niter: int = 1, connectivity: bool = True, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def lattice_reference( G, niter: int = 5, D: Incomplete | None = None, connectivity: bool = True, seed: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def sigma(G, niter: int = 100, nrand: int = 10, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def omega(G, niter: int = 5, nrand: int = 10, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/smetric.pyi b/stubs/networkx/networkx/algorithms/smetric.pyi index c1104f53209b..61eb1aebdb14 100644 --- a/stubs/networkx/networkx/algorithms/smetric.pyi +++ b/stubs/networkx/networkx/algorithms/smetric.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def s_metric(G, normalized: bool = True): ... diff --git a/stubs/networkx/networkx/algorithms/sparsifiers.pyi b/stubs/networkx/networkx/algorithms/sparsifiers.pyi index b03b832f4b45..e556626f172a 100644 --- a/stubs/networkx/networkx/algorithms/sparsifiers.pyi +++ b/stubs/networkx/networkx/algorithms/sparsifiers.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def spanner(G, stretch, weight: Incomplete | None = None, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/structuralholes.pyi b/stubs/networkx/networkx/algorithms/structuralholes.pyi index 30edb0f2cbab..bc396853a637 100644 --- a/stubs/networkx/networkx/algorithms/structuralholes.pyi +++ b/stubs/networkx/networkx/algorithms/structuralholes.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def effective_size(G, nodes: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def constraint(G, nodes: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def local_constraint(G, u, v, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/summarization.pyi b/stubs/networkx/networkx/algorithms/summarization.pyi index c871b7efd6a6..e1a359b8c72d 100644 --- a/stubs/networkx/networkx/algorithms/summarization.pyi +++ b/stubs/networkx/networkx/algorithms/summarization.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def dedensify(G, threshold, prefix: Incomplete | None = None, copy: bool = True): ... -@_dispatch +@_dispatchable def snap_aggregation( G, node_attributes, diff --git a/stubs/networkx/networkx/algorithms/swap.pyi b/stubs/networkx/networkx/algorithms/swap.pyi index f11235573f2f..be15bb2236fd 100644 --- a/stubs/networkx/networkx/algorithms/swap.pyi +++ b/stubs/networkx/networkx/algorithms/swap.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def directed_edge_swap(G, *, nswap: int = 1, max_tries: int = 100, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def double_edge_swap(G, nswap: int = 1, max_tries: int = 100, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def connected_double_edge_swap(G, nswap: int = 1, _window_threshold: int = 3, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/threshold.pyi b/stubs/networkx/networkx/algorithms/threshold.pyi index f1fb06058e35..4649c6638d33 100644 --- a/stubs/networkx/networkx/algorithms/threshold.pyi +++ b/stubs/networkx/networkx/algorithms/threshold.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_threshold_graph(G): ... -@_dispatch +@_dispatchable def find_threshold_graph(G, create_using: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/tournament.pyi b/stubs/networkx/networkx/algorithms/tournament.pyi index 21eb5721ae70..a8f06989d1a2 100644 --- a/stubs/networkx/networkx/algorithms/tournament.pyi +++ b/stubs/networkx/networkx/algorithms/tournament.pyi @@ -1,16 +1,16 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_tournament(G): ... -@_dispatch +@_dispatchable def hamiltonian_path(G): ... -@_dispatch +@_dispatchable def random_tournament(n, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def score_sequence(G): ... -@_dispatch +@_dispatchable def is_reachable(G, s, t): ... -@_dispatch +@_dispatchable def is_strongly_connected(G): ... diff --git a/stubs/networkx/networkx/algorithms/traversal/beamsearch.pyi b/stubs/networkx/networkx/algorithms/traversal/beamsearch.pyi index 4db534c6d921..057bc9e8972d 100644 --- a/stubs/networkx/networkx/algorithms/traversal/beamsearch.pyi +++ b/stubs/networkx/networkx/algorithms/traversal/beamsearch.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def bfs_beam_edges(G, source, value, width: Incomplete | None = None) -> Generator[Incomplete, Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/traversal/breadth_first_search.pyi b/stubs/networkx/networkx/algorithms/traversal/breadth_first_search.pyi index e02ce7e7c779..dbcf268d599c 100644 --- a/stubs/networkx/networkx/algorithms/traversal/breadth_first_search.pyi +++ b/stubs/networkx/networkx/algorithms/traversal/breadth_first_search.pyi @@ -1,25 +1,25 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def bfs_edges( G, source, reverse: bool = False, depth_limit: Incomplete | None = None, sort_neighbors: Incomplete | None = None ) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def bfs_tree( G, source, reverse: bool = False, depth_limit: Incomplete | None = None, sort_neighbors: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def bfs_predecessors( G, source, depth_limit: Incomplete | None = None, sort_neighbors: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def bfs_successors( G, source, depth_limit: Incomplete | None = None, sort_neighbors: Incomplete | None = None ) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def bfs_layers(G, sources) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def descendants_at_distance(G, source, distance): ... diff --git a/stubs/networkx/networkx/algorithms/traversal/depth_first_search.pyi b/stubs/networkx/networkx/algorithms/traversal/depth_first_search.pyi index 7a45dcd3819f..0b1abaedf280 100644 --- a/stubs/networkx/networkx/algorithms/traversal/depth_first_search.pyi +++ b/stubs/networkx/networkx/algorithms/traversal/depth_first_search.pyi @@ -2,21 +2,21 @@ from _typeshed import Incomplete from collections.abc import Generator from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def dfs_edges( G: Graph[_Node], source: _Node | None = None, depth_limit: int | None = None ) -> Generator[tuple[_Node, _Node], None, None]: ... -@_dispatch +@_dispatchable def dfs_tree(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dfs_predecessors(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dfs_successors(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dfs_postorder_nodes(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dfs_preorder_nodes(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dfs_labeled_edges(G, source: Incomplete | None = None, depth_limit: Incomplete | None = None) -> None: ... diff --git a/stubs/networkx/networkx/algorithms/traversal/edgebfs.pyi b/stubs/networkx/networkx/algorithms/traversal/edgebfs.pyi index 91992a617089..4999e56ee880 100644 --- a/stubs/networkx/networkx/algorithms/traversal/edgebfs.pyi +++ b/stubs/networkx/networkx/algorithms/traversal/edgebfs.pyi @@ -1,9 +1,9 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def edge_bfs( G, source: Incomplete | None = None, orientation: Incomplete | None = None ) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/traversal/edgedfs.pyi b/stubs/networkx/networkx/algorithms/traversal/edgedfs.pyi index 8d4ad7ec1d90..f2b11d4736f2 100644 --- a/stubs/networkx/networkx/algorithms/traversal/edgedfs.pyi +++ b/stubs/networkx/networkx/algorithms/traversal/edgedfs.pyi @@ -1,9 +1,9 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def edge_dfs( G, source: Incomplete | None = None, orientation: Incomplete | None = None ) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/networkx/algorithms/tree/branchings.pyi index e60469f9db78..8131ff2ce3ba 100644 --- a/stubs/networkx/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/networkx/algorithms/tree/branchings.pyi @@ -4,7 +4,7 @@ from dataclasses import dataclass from networkx.classes.graph import _Node from networkx.classes.multidigraph import MultiDiGraph -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "branching_weight", @@ -17,9 +17,9 @@ __all__ = [ "Edmonds", ] -@_dispatch +@_dispatchable def branching_weight(G, attr: str = "weight", default: float = 1): ... -@_dispatch +@_dispatchable def greedy_branching(G, attr: str = "weight", default: float = 1, kind: str = "max", seed: Incomplete | None = None): ... class MultiDiGraph_EdgeKey(MultiDiGraph[_Node]): @@ -49,19 +49,19 @@ class Edmonds: seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def maximum_branching( G, attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def minimum_branching( G, attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def maximum_spanning_arborescence( G, attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def minimum_spanning_arborescence( G, attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/tree/coding.pyi b/stubs/networkx/networkx/algorithms/tree/coding.pyi index aaf585c35f9b..180a04a7c1ac 100644 --- a/stubs/networkx/networkx/algorithms/tree/coding.pyi +++ b/stubs/networkx/networkx/algorithms/tree/coding.pyi @@ -1,13 +1,13 @@ from networkx.exception import NetworkXException -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class NotATree(NetworkXException): ... -@_dispatch +@_dispatchable def to_nested_tuple(T, root, canonical_form: bool = False): ... -@_dispatch +@_dispatchable def from_nested_tuple(sequence, sensible_relabeling: bool = False): ... -@_dispatch +@_dispatchable def to_prufer_sequence(T): ... -@_dispatch +@_dispatchable def from_prufer_sequence(sequence): ... diff --git a/stubs/networkx/networkx/algorithms/tree/decomposition.pyi b/stubs/networkx/networkx/algorithms/tree/decomposition.pyi index ea14d081b271..998d6241c363 100644 --- a/stubs/networkx/networkx/algorithms/tree/decomposition.pyi +++ b/stubs/networkx/networkx/algorithms/tree/decomposition.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def junction_tree(G): ... diff --git a/stubs/networkx/networkx/algorithms/tree/mst.pyi b/stubs/networkx/networkx/algorithms/tree/mst.pyi index 8f40029ff521..178b5a771cb7 100644 --- a/stubs/networkx/networkx/algorithms/tree/mst.pyi +++ b/stubs/networkx/networkx/algorithms/tree/mst.pyi @@ -3,30 +3,30 @@ from collections.abc import Iterator from dataclasses import dataclass from enum import Enum -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class EdgePartition(Enum): OPEN = 0 INCLUDED = 1 EXCLUDED = 2 -@_dispatch +@_dispatchable def minimum_spanning_edges( G, algorithm: str = "kruskal", weight: str = "weight", keys: bool = True, data: bool = True, ignore_nan: bool = False ): ... -@_dispatch +@_dispatchable def maximum_spanning_edges( G, algorithm: str = "kruskal", weight: str = "weight", keys: bool = True, data: bool = True, ignore_nan: bool = False ): ... -@_dispatch +@_dispatchable def minimum_spanning_tree(G, weight: str = "weight", algorithm: str = "kruskal", ignore_nan: bool = False): ... -@_dispatch +@_dispatchable def partition_spanning_tree( G, minimum: bool = True, weight: str = "weight", partition: str = "partition", ignore_nan: bool = False ): ... -@_dispatch +@_dispatchable def maximum_spanning_tree(G, weight: str = "weight", algorithm: str = "kruskal", ignore_nan: bool = False): ... -@_dispatch +@_dispatchable def random_spanning_tree(G, weight: Incomplete | None = None, *, multiplicative: bool = True, seed: Incomplete | None = None): ... class SpanningTreeIterator: diff --git a/stubs/networkx/networkx/algorithms/tree/operations.pyi b/stubs/networkx/networkx/algorithms/tree/operations.pyi index 712f9f546e83..5a3981c63c6f 100644 --- a/stubs/networkx/networkx/algorithms/tree/operations.pyi +++ b/stubs/networkx/networkx/algorithms/tree/operations.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def join(rooted_trees, label_attribute: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/tree/recognition.pyi b/stubs/networkx/networkx/algorithms/tree/recognition.pyi index 49b318a857e0..b5b303b66c81 100644 --- a/stubs/networkx/networkx/algorithms/tree/recognition.pyi +++ b/stubs/networkx/networkx/algorithms/tree/recognition.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_arborescence(G): ... -@_dispatch +@_dispatchable def is_branching(G): ... -@_dispatch +@_dispatchable def is_forest(G): ... -@_dispatch +@_dispatchable def is_tree(G): ... diff --git a/stubs/networkx/networkx/algorithms/triads.pyi b/stubs/networkx/networkx/algorithms/triads.pyi index c3b4eeba410d..510b01cbdf2a 100644 --- a/stubs/networkx/networkx/algorithms/triads.pyi +++ b/stubs/networkx/networkx/algorithms/triads.pyi @@ -1,19 +1,19 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def triadic_census(G, nodelist: Incomplete | None = None): ... -@_dispatch +@_dispatchable def is_triad(G): ... -@_dispatch +@_dispatchable def all_triplets(G): ... -@_dispatch +@_dispatchable def all_triads(G) -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def triads_by_type(G): ... -@_dispatch +@_dispatchable def triad_type(G): ... -@_dispatch +@_dispatchable def random_triad(G, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/algorithms/vitality.pyi b/stubs/networkx/networkx/algorithms/vitality.pyi index abc5840d530c..9a7cfcb2b64a 100644 --- a/stubs/networkx/networkx/algorithms/vitality.pyi +++ b/stubs/networkx/networkx/algorithms/vitality.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def closeness_vitality( G, node: Incomplete | None = None, weight: Incomplete | None = None, wiener_index: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/voronoi.pyi b/stubs/networkx/networkx/algorithms/voronoi.pyi index baefb2ea7509..6713ec759232 100644 --- a/stubs/networkx/networkx/algorithms/voronoi.pyi +++ b/stubs/networkx/networkx/algorithms/voronoi.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def voronoi_cells(G, center_nodes, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/algorithms/wiener.pyi b/stubs/networkx/networkx/algorithms/wiener.pyi index dbafb2128541..1cff8ccd0f76 100644 --- a/stubs/networkx/networkx/algorithms/wiener.pyi +++ b/stubs/networkx/networkx/algorithms/wiener.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def wiener_index(G, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/classes/function.pyi b/stubs/networkx/networkx/classes/function.pyi index 145713b3672b..459cd8baa8d9 100644 --- a/stubs/networkx/networkx/classes/function.pyi +++ b/stubs/networkx/networkx/classes/function.pyi @@ -2,6 +2,7 @@ from _typeshed import Incomplete, SupportsItems, SupportsKeysAndGetItem, Unused from collections.abc import Generator, Hashable, Iterable, Iterator from typing import Literal, TypeVar, overload +from networkx import _dispatchable from networkx.algorithms.planarity import PlanarEmbedding from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _NBunch, _Node @@ -97,6 +98,7 @@ def non_neighbors(graph: Graph[_Node], node: _Node) -> Generator[_Node, None, No def non_edges(graph: Graph[_Node]) -> Generator[tuple[_Node, _Node], None, None]: ... def common_neighbors(G: Graph[_Node], u: _Node, v: _Node) -> Generator[_Node, None, None]: ... def is_weighted(G: Graph[_Node], edge: tuple[_Node, _Node] | None = None, weight: str = "weight") -> bool: ... +@_dispatchable def is_negatively_weighted(G: Graph[_Node], edge: tuple[_Node, _Node] | None = None, weight: str = "weight"): ... def is_empty(G: Graph[Hashable]) -> bool: ... def nodes_with_selfloops(G: Graph[_Node]) -> Generator[_Node, None, None]: ... diff --git a/stubs/networkx/networkx/convert.pyi b/stubs/networkx/networkx/convert.pyi index ab291b08f71b..d02a612f993c 100644 --- a/stubs/networkx/networkx/convert.pyi +++ b/stubs/networkx/networkx/convert.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from collections.abc import Callable, Iterable from networkx.classes.graph import Graph, _Data, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "to_networkx_graph", @@ -17,14 +17,14 @@ __all__ = [ def to_networkx_graph( data: _Data[_Node], create_using: Graph[_Node] | Callable[[], Graph[_Node]] | None = None, multigraph_input: bool = False ) -> Graph[_Node]: ... -@_dispatch +@_dispatchable def to_dict_of_lists(G: Graph[_Node], nodelist: None | Iterable[_Node] = None) -> dict[_Node, list[_Node]]: ... -@_dispatch +@_dispatchable def from_dict_of_lists(d: dict[_Node, Iterable[_Node]], create_using: Incomplete | None = None) -> Graph[_Node]: ... def to_dict_of_dicts(G: Graph[_Node], nodelist=None, edge_data=None) -> dict[Incomplete, Incomplete]: ... -@_dispatch +@_dispatchable def from_dict_of_dicts(d, create_using=None, multigraph_input=False) -> Graph[Incomplete]: ... -@_dispatch +@_dispatchable def to_edgelist(G: Graph[_Node], nodelist=None): ... -@_dispatch +@_dispatchable def from_edgelist(edgelist, create_using=None) -> Graph[Incomplete]: ... diff --git a/stubs/networkx/networkx/convert_matrix.pyi b/stubs/networkx/networkx/convert_matrix.pyi index 4b508a7b51dc..a94e00e7ada8 100644 --- a/stubs/networkx/networkx/convert_matrix.pyi +++ b/stubs/networkx/networkx/convert_matrix.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias import numpy from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable # stub_uploader won't allow pandas-stubs in the requires field https://github.com/typeshed-internal/stub_uploader/issues/90 # from pandas import DataFrame @@ -17,7 +17,7 @@ _ExtensionDtype: TypeAlias = Incomplete _Axes: TypeAlias = Collection[_Node] _G = TypeVar("_G", bound=Graph[Hashable]) -@_dispatch +@_dispatchable def to_pandas_adjacency( G: Graph[_Node], nodelist: _Axes[_Node] | None = None, @@ -31,7 +31,7 @@ def to_pandas_adjacency( def from_pandas_adjacency(df: _DataFrame, create_using: type[_G]) -> _G: ... @overload def from_pandas_adjacency(df: _DataFrame, create_using: None = None) -> Graph[Incomplete]: ... -@_dispatch +@_dispatchable def to_pandas_edgelist( G: Graph[_Node], source: str | int = "source", @@ -68,7 +68,7 @@ def from_pandas_edgelist( create_using: None = None, edge_key: str | None = None, ) -> Graph[Incomplete]: ... -@_dispatch +@_dispatchable def to_numpy_array( G: Graph[_Node], nodelist: Collection[_Node] | None = None, diff --git a/stubs/networkx/networkx/drawing/nx_agraph.pyi b/stubs/networkx/networkx/drawing/nx_agraph.pyi index 58534aaadbdd..025489a5759a 100644 --- a/stubs/networkx/networkx/drawing/nx_agraph.pyi +++ b/stubs/networkx/networkx/drawing/nx_agraph.pyi @@ -4,16 +4,16 @@ from io import TextIOBase from typing_extensions import TypeAlias from networkx.classes.graph import Graph, _Node -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable # from pygraphviz.agraph import AGraph as _AGraph _AGraph: TypeAlias = Incomplete -@_dispatch +@_dispatchable def from_agraph(A, create_using: Incomplete | None = None) -> Graph[Incomplete]: ... def to_agraph(N: Graph[Hashable]) -> _AGraph: ... def write_dot(G: Graph[Hashable], path: str | TextIOBase) -> None: ... -@_dispatch +@_dispatchable def read_dot(path: str | TextIOBase) -> Graph[Incomplete]: ... def graphviz_layout( G: Graph[_Node], prog: str = "neato", root: str | None = None, args: str = "" diff --git a/stubs/networkx/networkx/drawing/nx_pydot.pyi b/stubs/networkx/networkx/drawing/nx_pydot.pyi index 7a37ceabce8f..0d8a59e9044f 100644 --- a/stubs/networkx/networkx/drawing/nx_pydot.pyi +++ b/stubs/networkx/networkx/drawing/nx_pydot.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def write_dot(G, path) -> None: ... -@_dispatch +@_dispatchable def read_dot(path): ... -@_dispatch +@_dispatchable def from_pydot(P): ... def to_pydot(N): ... def graphviz_layout(G, prog: str = "neato", root: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/drawing/nx_pylab.pyi b/stubs/networkx/networkx/drawing/nx_pylab.pyi index 1fc090b5f0a7..1852dcdd96a2 100644 --- a/stubs/networkx/networkx/drawing/nx_pylab.pyi +++ b/stubs/networkx/networkx/drawing/nx_pylab.pyi @@ -20,6 +20,7 @@ def draw_networkx_nodes( edgecolors: Incomplete | None = None, label: Incomplete | None = None, margins: Incomplete | None = None, + hide_ticks: bool = True, ): ... def draw_networkx_edges( G, @@ -43,6 +44,7 @@ def draw_networkx_edges( connectionstyle: str = "arc3", min_source_margin: int = 0, min_target_margin: int = 0, + hide_ticks: bool = True, ): ... def draw_networkx_labels( G, @@ -58,6 +60,7 @@ def draw_networkx_labels( verticalalignment: str = "center", ax: Incomplete | None = None, clip_on: bool = True, + hide_ticks: bool = True, ): ... def draw_networkx_edge_labels( G, @@ -75,6 +78,10 @@ def draw_networkx_edge_labels( ax: Incomplete | None = None, rotate: bool = True, clip_on: bool = True, + node_size: int = 300, + nodelist: Incomplete | None = None, + connectionstyle: str = "arc3", + hide_ticks: bool = True, ): ... def draw_circular(G, **kwargs) -> None: ... def draw_kamada_kawai(G, **kwargs) -> None: ... diff --git a/stubs/networkx/networkx/generators/atlas.pyi b/stubs/networkx/networkx/generators/atlas.pyi index 3c6ab78a4fa3..f97cf915b717 100644 --- a/stubs/networkx/networkx/generators/atlas.pyi +++ b/stubs/networkx/networkx/generators/atlas.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def graph_atlas(i): ... -@_dispatch +@_dispatchable def graph_atlas_g(): ... diff --git a/stubs/networkx/networkx/generators/classic.pyi b/stubs/networkx/networkx/generators/classic.pyi index 5ce9da870092..b35c8b4adb64 100644 --- a/stubs/networkx/networkx/generators/classic.pyi +++ b/stubs/networkx/networkx/generators/classic.pyi @@ -1,42 +1,42 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def full_rary_tree(r, n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def balanced_tree(r, h, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def barbell_graph(m1, m2, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def binomial_tree(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def complete_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def circular_ladder_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def circulant_graph(n, offsets, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def cycle_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dorogovtsev_goltsev_mendes_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def empty_graph(n: Incomplete | int = 0, create_using: Incomplete | None = None, default=...): ... -@_dispatch +@_dispatchable def ladder_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def lollipop_graph(m, n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def null_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def path_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def star_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def trivial_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def turan_graph(n, r): ... -@_dispatch +@_dispatchable def wheel_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def complete_multipartite_graph(*subset_sizes): ... diff --git a/stubs/networkx/networkx/generators/cographs.pyi b/stubs/networkx/networkx/generators/cographs.pyi index ce3faccf2fb6..2349a9dbe77d 100644 --- a/stubs/networkx/networkx/generators/cographs.pyi +++ b/stubs/networkx/networkx/generators/cographs.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def random_cograph(n, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/community.pyi b/stubs/networkx/networkx/generators/community.pyi index 893f3b824883..55e386934db1 100644 --- a/stubs/networkx/networkx/generators/community.pyi +++ b/stubs/networkx/networkx/generators/community.pyi @@ -1,24 +1,24 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def caveman_graph(l, k): ... -@_dispatch +@_dispatchable def connected_caveman_graph(l, k): ... -@_dispatch +@_dispatchable def relaxed_caveman_graph(l, k, p, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_partition_graph(sizes, p_in, p_out, seed: Incomplete | None = None, directed: bool = False): ... -@_dispatch +@_dispatchable def planted_partition_graph(l, k, p_in, p_out, seed: Incomplete | None = None, directed: bool = False): ... -@_dispatch +@_dispatchable def gaussian_random_partition_graph(n, s, v, p_in, p_out, directed: bool = False, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def ring_of_cliques(num_cliques, clique_size): ... -@_dispatch +@_dispatchable def windmill_graph(n, k): ... -@_dispatch +@_dispatchable def stochastic_block_model( sizes, p, @@ -28,7 +28,7 @@ def stochastic_block_model( selfloops: bool = False, sparse: bool = True, ): ... -@_dispatch +@_dispatchable def LFR_benchmark_graph( n, tau1, diff --git a/stubs/networkx/networkx/generators/degree_seq.pyi b/stubs/networkx/networkx/generators/degree_seq.pyi index 73ba1619eb65..b24d74eea48e 100644 --- a/stubs/networkx/networkx/generators/degree_seq.pyi +++ b/stubs/networkx/networkx/generators/degree_seq.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "configuration_model", @@ -12,21 +12,21 @@ __all__ = [ "random_degree_sequence_graph", ] -@_dispatch +@_dispatchable def configuration_model(deg_sequence, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def directed_configuration_model( in_degree_sequence, out_degree_sequence, create_using: Incomplete | None = None, seed: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def expected_degree_graph(w, seed: Incomplete | None = None, selfloops: bool = True): ... -@_dispatch +@_dispatchable def havel_hakimi_graph(deg_sequence, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def directed_havel_hakimi_graph(in_deg_sequence, out_deg_sequence, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def degree_sequence_tree(deg_sequence, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_degree_sequence_graph(sequence, seed: Incomplete | None = None, tries: int = 10): ... class DegreeSequenceRandomGraph: diff --git a/stubs/networkx/networkx/generators/directed.pyi b/stubs/networkx/networkx/generators/directed.pyi index 9bae0a95b3aa..4be5ac627222 100644 --- a/stubs/networkx/networkx/generators/directed.pyi +++ b/stubs/networkx/networkx/generators/directed.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def gn_graph(n, kernel: Incomplete | None = None, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def gnr_graph(n, p, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def gnc_graph(n, create_using: Incomplete | None = None, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def scale_free_graph( n, alpha: float = 0.41, @@ -20,5 +20,5 @@ def scale_free_graph( seed: Incomplete | None = None, initial_graph: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def random_k_out_graph(n, k, alpha, self_loops: bool = True, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/duplication.pyi b/stubs/networkx/networkx/generators/duplication.pyi index ea7f95cb0602..ec3248a8b9f1 100644 --- a/stubs/networkx/networkx/generators/duplication.pyi +++ b/stubs/networkx/networkx/generators/duplication.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def partial_duplication_graph(N, n, p, q, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def duplication_divergence_graph(n, p, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/ego.pyi b/stubs/networkx/networkx/generators/ego.pyi index adeb8b300eb5..f64b9ec10d4b 100644 --- a/stubs/networkx/networkx/generators/ego.pyi +++ b/stubs/networkx/networkx/generators/ego.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def ego_graph(G, n, radius: float = 1, center: bool = True, undirected: bool = False, distance: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/expanders.pyi b/stubs/networkx/networkx/generators/expanders.pyi index 80c0f30e4894..9b2d9b1cd597 100644 --- a/stubs/networkx/networkx/generators/expanders.pyi +++ b/stubs/networkx/networkx/generators/expanders.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def margulis_gabber_galil_graph(n, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def chordal_cycle_graph(p, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def paley_graph(p, create_using: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/geometric.pyi b/stubs/networkx/networkx/generators/geometric.pyi index 0f146cee0628..0442140b39bf 100644 --- a/stubs/networkx/networkx/generators/geometric.pyi +++ b/stubs/networkx/networkx/generators/geometric.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def geometric_edges(G, radius, p: float = 2): ... -@_dispatch +@_dispatchable def random_geometric_graph( n, radius, dim: int = 2, pos: Incomplete | None = None, p: float = 2, seed: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def soft_random_geometric_graph( n, radius, @@ -18,7 +18,7 @@ def soft_random_geometric_graph( p_dist: Incomplete | None = None, seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def geographical_threshold_graph( n, theta, @@ -29,7 +29,7 @@ def geographical_threshold_graph( p_dist: Incomplete | None = None, seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def waxman_graph( n, beta: float = 0.4, @@ -41,9 +41,9 @@ def waxman_graph( ): ... # docstring marks p as int, but it still works with floats. So I think it's better for consistency -@_dispatch +@_dispatchable def navigable_small_world_graph(n, p: float = 1, q: int = 1, r: float = 2, dim: int = 2, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def thresholded_random_geometric_graph( n, radius, diff --git a/stubs/networkx/networkx/generators/harary_graph.pyi b/stubs/networkx/networkx/generators/harary_graph.pyi index d797ee6ed69c..b62d2e2ce0e0 100644 --- a/stubs/networkx/networkx/generators/harary_graph.pyi +++ b/stubs/networkx/networkx/generators/harary_graph.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def hnm_harary_graph(n, m, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def hkn_harary_graph(k, n, create_using: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/internet_as_graphs.pyi b/stubs/networkx/networkx/generators/internet_as_graphs.pyi index a870d297000f..8c9542f45480 100644 --- a/stubs/networkx/networkx/generators/internet_as_graphs.pyi +++ b/stubs/networkx/networkx/generators/internet_as_graphs.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["random_internet_as_graph"] @@ -37,5 +37,5 @@ class AS_graph_generator: nodes: Incomplete def generate(self): ... -@_dispatch +@_dispatchable def random_internet_as_graph(n, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/intersection.pyi b/stubs/networkx/networkx/generators/intersection.pyi index b850ad56cfc7..a58cbf5befcf 100644 --- a/stubs/networkx/networkx/generators/intersection.pyi +++ b/stubs/networkx/networkx/generators/intersection.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def uniform_random_intersection_graph(n, m, p, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def k_random_intersection_graph(n, m, k, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def general_random_intersection_graph(n, m, p, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/interval_graph.pyi b/stubs/networkx/networkx/generators/interval_graph.pyi index dd964187dc44..8a0d89c9e33e 100644 --- a/stubs/networkx/networkx/generators/interval_graph.pyi +++ b/stubs/networkx/networkx/generators/interval_graph.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def interval_graph(intervals): ... diff --git a/stubs/networkx/networkx/generators/joint_degree_seq.pyi b/stubs/networkx/networkx/generators/joint_degree_seq.pyi index 844df93eff41..2f4ce6eeba33 100644 --- a/stubs/networkx/networkx/generators/joint_degree_seq.pyi +++ b/stubs/networkx/networkx/generators/joint_degree_seq.pyi @@ -1,12 +1,12 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def is_valid_joint_degree(joint_degrees): ... -@_dispatch +@_dispatchable def joint_degree_graph(joint_degrees, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def is_valid_directed_joint_degree(in_degrees, out_degrees, nkk): ... -@_dispatch +@_dispatchable def directed_joint_degree_graph(in_degrees, out_degrees, nkk, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/lattice.pyi b/stubs/networkx/networkx/generators/lattice.pyi index 72205876e603..50ac54691da4 100644 --- a/stubs/networkx/networkx/generators/lattice.pyi +++ b/stubs/networkx/networkx/generators/lattice.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def grid_2d_graph(m, n, periodic: bool = False, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def grid_graph(dim, periodic: bool = False): ... -@_dispatch +@_dispatchable def hypercube_graph(n): ... -@_dispatch +@_dispatchable def triangular_lattice_graph( m, n, periodic: bool = False, with_positions: bool = True, create_using: Incomplete | None = None ): ... -@_dispatch +@_dispatchable def hexagonal_lattice_graph( m, n, periodic: bool = False, with_positions: bool = True, create_using: Incomplete | None = None ): ... diff --git a/stubs/networkx/networkx/generators/line.pyi b/stubs/networkx/networkx/generators/line.pyi index fac54f339bde..9d3625e22c7c 100644 --- a/stubs/networkx/networkx/generators/line.pyi +++ b/stubs/networkx/networkx/generators/line.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def line_graph(G, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def inverse_line_graph(G): ... diff --git a/stubs/networkx/networkx/generators/mycielski.pyi b/stubs/networkx/networkx/generators/mycielski.pyi index 38f2b4957040..31ced02dcc80 100644 --- a/stubs/networkx/networkx/generators/mycielski.pyi +++ b/stubs/networkx/networkx/generators/mycielski.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def mycielskian(G, iterations: int = 1): ... -@_dispatch +@_dispatchable def mycielski_graph(n): ... diff --git a/stubs/networkx/networkx/generators/nonisomorphic_trees.pyi b/stubs/networkx/networkx/generators/nonisomorphic_trees.pyi index e97bf7838764..57e277dde533 100644 --- a/stubs/networkx/networkx/generators/nonisomorphic_trees.pyi +++ b/stubs/networkx/networkx/generators/nonisomorphic_trees.pyi @@ -1,9 +1,9 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def nonisomorphic_trees(order, create: str = "graph") -> Generator[Incomplete, None, None]: ... -@_dispatch +@_dispatchable def number_of_nonisomorphic_trees(order): ... diff --git a/stubs/networkx/networkx/generators/random_graphs.pyi b/stubs/networkx/networkx/generators/random_graphs.pyi index f18caa3b86e0..e3b557c785a0 100644 --- a/stubs/networkx/networkx/generators/random_graphs.pyi +++ b/stubs/networkx/networkx/generators/random_graphs.pyi @@ -1,42 +1,42 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def fast_gnp_random_graph(n, p, seed: Incomplete | None = None, directed: bool = False): ... -@_dispatch +@_dispatchable def gnp_random_graph(n, p, seed: Incomplete | None = None, directed: bool = False): ... binomial_graph = gnp_random_graph erdos_renyi_graph = gnp_random_graph -@_dispatch +@_dispatchable def dense_gnm_random_graph(n, m, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def gnm_random_graph(n, m, seed: Incomplete | None = None, directed: bool = False): ... -@_dispatch +@_dispatchable def newman_watts_strogatz_graph(n, k, p, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def watts_strogatz_graph(n, k, p, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def connected_watts_strogatz_graph(n, k, p, tries: int = 100, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_regular_graph(d, n, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def barabasi_albert_graph(n, m, seed: Incomplete | None = None, initial_graph: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dual_barabasi_albert_graph(n, m1, m2, p, seed: Incomplete | None = None, initial_graph: Incomplete | None = None): ... -@_dispatch +@_dispatchable def extended_barabasi_albert_graph(n, m, p, q, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def powerlaw_cluster_graph(n, m, p, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_lobster(n, p1, p2, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_shell_graph(constructor, seed: Incomplete | None = None): ... -@_dispatch +@_dispatchable def random_powerlaw_tree(n, gamma: float = 3, seed: Incomplete | None = None, tries: int = 100): ... -@_dispatch +@_dispatchable def random_powerlaw_tree_sequence(n, gamma: float = 3, seed: Incomplete | None = None, tries: int = 100): ... -@_dispatch +@_dispatchable def random_kernel_graph(n, kernel_integral, kernel_root: Incomplete | None = None, seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/small.pyi b/stubs/networkx/networkx/generators/small.pyi index 56ad13a33051..4563f2308e58 100644 --- a/stubs/networkx/networkx/generators/small.pyi +++ b/stubs/networkx/networkx/generators/small.pyi @@ -1,50 +1,50 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def LCF_graph(n, shift_list, repeats, create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def bull_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def chvatal_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def cubical_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def desargues_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def diamond_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def dodecahedral_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def frucht_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def heawood_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def hoffman_singleton_graph(): ... -@_dispatch +@_dispatchable def house_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def house_x_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def icosahedral_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def krackhardt_kite_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def moebius_kantor_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def octahedral_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def pappus_graph(): ... -@_dispatch +@_dispatchable def petersen_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def sedgewick_maze_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def tetrahedral_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def truncated_cube_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def truncated_tetrahedron_graph(create_using: Incomplete | None = None): ... -@_dispatch +@_dispatchable def tutte_graph(create_using: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/social.pyi b/stubs/networkx/networkx/generators/social.pyi index 18a7a9fd9811..b145710668b6 100644 --- a/stubs/networkx/networkx/generators/social.pyi +++ b/stubs/networkx/networkx/generators/social.pyi @@ -1,10 +1,10 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def karate_club_graph(): ... -@_dispatch +@_dispatchable def davis_southern_women_graph(): ... -@_dispatch +@_dispatchable def florentine_families_graph(): ... -@_dispatch +@_dispatchable def les_miserables_graph(): ... diff --git a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi index 62cb464ce78b..23e1e5bffaa5 100644 --- a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi +++ b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def spectral_graph_forge(G, alpha, transformation: str = "identity", seed: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/stochastic.pyi b/stubs/networkx/networkx/generators/stochastic.pyi index c97ff6531f92..4dd8f1ecb2b3 100644 --- a/stubs/networkx/networkx/generators/stochastic.pyi +++ b/stubs/networkx/networkx/generators/stochastic.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def stochastic_graph(G, copy: bool = True, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/generators/sudoku.pyi b/stubs/networkx/networkx/generators/sudoku.pyi index a271c653958b..15eb488e7f75 100644 --- a/stubs/networkx/networkx/generators/sudoku.pyi +++ b/stubs/networkx/networkx/generators/sudoku.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def sudoku_graph(n: int = 3): ... diff --git a/stubs/networkx/networkx/generators/trees.pyi b/stubs/networkx/networkx/generators/trees.pyi index 313baec457c4..f511c2d87dee 100644 --- a/stubs/networkx/networkx/generators/trees.pyi +++ b/stubs/networkx/networkx/generators/trees.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def prefix_tree(paths): ... -@_dispatch +@_dispatchable def prefix_tree_recursive(paths): ... -@_dispatch +@_dispatchable def random_tree(n, seed: Incomplete | None = None, create_using: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/generators/triads.pyi b/stubs/networkx/networkx/generators/triads.pyi index 1ab083026c2b..cdc648ee378d 100644 --- a/stubs/networkx/networkx/generators/triads.pyi +++ b/stubs/networkx/networkx/generators/triads.pyi @@ -1,4 +1,4 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def triad_graph(triad_name): ... diff --git a/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi b/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi index 0a01e2419d8c..52961225175a 100644 --- a/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi +++ b/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable class _PCGSolver: def __init__(self, A, M) -> None: ... @@ -10,7 +10,7 @@ class _LUSolver: def __init__(self, A) -> None: ... def solve(self, B, tol: Incomplete | None = None): ... -@_dispatch +@_dispatchable def algebraic_connectivity( G, weight: str = "weight", @@ -19,7 +19,7 @@ def algebraic_connectivity( method: str = "tracemin_pcg", seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def fiedler_vector( G, weight: str = "weight", @@ -28,7 +28,7 @@ def fiedler_vector( method: str = "tracemin_pcg", seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def spectral_ordering( G, weight: str = "weight", @@ -37,7 +37,7 @@ def spectral_ordering( method: str = "tracemin_pcg", seed: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def spectral_bisection( G, weight: str = "weight", diff --git a/stubs/networkx/networkx/linalg/attrmatrix.pyi b/stubs/networkx/networkx/linalg/attrmatrix.pyi index f8cfebb7b572..360a53ffbdd6 100644 --- a/stubs/networkx/networkx/linalg/attrmatrix.pyi +++ b/stubs/networkx/networkx/linalg/attrmatrix.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def attr_matrix( G, edge_attr: Incomplete | None = None, @@ -12,7 +12,7 @@ def attr_matrix( dtype: Incomplete | None = None, order: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def attr_sparse_matrix( G, edge_attr: Incomplete | None = None, diff --git a/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi b/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi index ee7a1bb9495d..a122ca706a24 100644 --- a/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi +++ b/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def bethe_hessian_matrix(G, r: Incomplete | None = None, nodelist: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/linalg/graphmatrix.pyi b/stubs/networkx/networkx/linalg/graphmatrix.pyi index 58d1b661313e..6eb0c4243974 100644 --- a/stubs/networkx/networkx/linalg/graphmatrix.pyi +++ b/stubs/networkx/networkx/linalg/graphmatrix.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def incidence_matrix( G, nodelist: Incomplete | None = None, @@ -10,5 +10,5 @@ def incidence_matrix( oriented: bool = False, weight: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def adjacency_matrix(G, nodelist: Incomplete | None = None, dtype: Incomplete | None = None, weight: str = "weight"): ... diff --git a/stubs/networkx/networkx/linalg/laplacianmatrix.pyi b/stubs/networkx/networkx/linalg/laplacianmatrix.pyi index 8921eb899769..5e607d91b15d 100644 --- a/stubs/networkx/networkx/linalg/laplacianmatrix.pyi +++ b/stubs/networkx/networkx/linalg/laplacianmatrix.pyi @@ -1,18 +1,18 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def laplacian_matrix(G, nodelist: Incomplete | None = None, weight: str = "weight"): ... -@_dispatch +@_dispatchable def normalized_laplacian_matrix(G, nodelist: Incomplete | None = None, weight: str = "weight"): ... -@_dispatch +@_dispatchable def total_spanning_tree_weight(G, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def directed_laplacian_matrix( G, nodelist: Incomplete | None = None, weight: str = "weight", walk_type: Incomplete | None = None, alpha: float = 0.95 ): ... -@_dispatch +@_dispatchable def directed_combinatorial_laplacian_matrix( G, nodelist: Incomplete | None = None, weight: str = "weight", walk_type: Incomplete | None = None, alpha: float = 0.95 ): ... diff --git a/stubs/networkx/networkx/linalg/modularitymatrix.pyi b/stubs/networkx/networkx/linalg/modularitymatrix.pyi index 581a858dfa8b..5ef6eec7c3bf 100644 --- a/stubs/networkx/networkx/linalg/modularitymatrix.pyi +++ b/stubs/networkx/networkx/linalg/modularitymatrix.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def modularity_matrix(G, nodelist: Incomplete | None = None, weight: Incomplete | None = None): ... -@_dispatch +@_dispatchable def directed_modularity_matrix(G, nodelist: Incomplete | None = None, weight: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/linalg/spectrum.pyi b/stubs/networkx/networkx/linalg/spectrum.pyi index a7713345eb52..dae0e63001e8 100644 --- a/stubs/networkx/networkx/linalg/spectrum.pyi +++ b/stubs/networkx/networkx/linalg/spectrum.pyi @@ -1,14 +1,14 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def laplacian_spectrum(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def normalized_laplacian_spectrum(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def adjacency_spectrum(G, weight: str = "weight"): ... -@_dispatch +@_dispatchable def modularity_spectrum(G): ... -@_dispatch +@_dispatchable def bethe_hessian_spectrum(G, r: Incomplete | None = None): ... diff --git a/stubs/networkx/networkx/readwrite/adjlist.pyi b/stubs/networkx/networkx/readwrite/adjlist.pyi index 3afb506f9471..ad2f31f2e9a5 100644 --- a/stubs/networkx/networkx/readwrite/adjlist.pyi +++ b/stubs/networkx/networkx/readwrite/adjlist.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def generate_adjlist(G, delimiter: str = " ") -> Generator[Incomplete, None, None]: ... def write_adjlist(G, path, comments: str = "#", delimiter: str = " ", encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def parse_adjlist( lines, comments: str = "#", @@ -13,7 +13,7 @@ def parse_adjlist( create_using: Incomplete | None = None, nodetype: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def read_adjlist( path, comments: str = "#", diff --git a/stubs/networkx/networkx/readwrite/edgelist.pyi b/stubs/networkx/networkx/readwrite/edgelist.pyi index 084a08fdcbd9..c8587b307881 100644 --- a/stubs/networkx/networkx/readwrite/edgelist.pyi +++ b/stubs/networkx/networkx/readwrite/edgelist.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def generate_edgelist(G, delimiter: str = " ", data: bool = True) -> Generator[Incomplete, None, None]: ... def write_edgelist(G, path, comments: str = "#", delimiter: str = " ", data: bool = True, encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def parse_edgelist( lines, comments: str = "#", @@ -14,7 +14,7 @@ def parse_edgelist( nodetype: Incomplete | None = None, data: bool = True, ): ... -@_dispatch +@_dispatchable def read_edgelist( path, comments: str = "#", @@ -26,7 +26,7 @@ def read_edgelist( encoding: str = "utf-8", ): ... def write_weighted_edgelist(G, path, comments: str = "#", delimiter: str = " ", encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def read_weighted_edgelist( path, comments: str = "#", diff --git a/stubs/networkx/networkx/readwrite/gexf.pyi b/stubs/networkx/networkx/readwrite/gexf.pyi index 844dae89a6f7..8de89fcd392f 100644 --- a/stubs/networkx/networkx/readwrite/gexf.pyi +++ b/stubs/networkx/networkx/readwrite/gexf.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = ["write_gexf", "read_gexf", "relabel_gexf_graph", "generate_gexf"] @@ -9,7 +9,7 @@ def write_gexf(G, path, encoding: str = "utf-8", prettyprint: bool = True, versi def generate_gexf( G, encoding: str = "utf-8", prettyprint: bool = True, version: str = "1.2draft" ) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def read_gexf(path, node_type: Incomplete | None = None, relabel: bool = False, version: str = "1.2draft"): ... class GEXF: diff --git a/stubs/networkx/networkx/readwrite/gml.pyi b/stubs/networkx/networkx/readwrite/gml.pyi index 4cd4c6afdd2a..63fae3c7b3e1 100644 --- a/stubs/networkx/networkx/readwrite/gml.pyi +++ b/stubs/networkx/networkx/readwrite/gml.pyi @@ -3,15 +3,15 @@ from collections.abc import Generator from enum import Enum from typing import Generic, NamedTuple, TypeVar -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable _T = TypeVar("_T") __all__ = ["read_gml", "parse_gml", "generate_gml", "write_gml"] -@_dispatch +@_dispatchable def read_gml(path, label: str = "label", destringizer: Incomplete | None = None): ... -@_dispatch +@_dispatchable def parse_gml(lines, label: str = "label", destringizer: Incomplete | None = None): ... class Pattern(Enum): diff --git a/stubs/networkx/networkx/readwrite/graph6.pyi b/stubs/networkx/networkx/readwrite/graph6.pyi index 3ee6a86411a3..e1379b4568c9 100644 --- a/stubs/networkx/networkx/readwrite/graph6.pyi +++ b/stubs/networkx/networkx/readwrite/graph6.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def from_graph6_bytes(bytes_in): ... def to_graph6_bytes(G, nodes: Incomplete | None = None, header: bool = True): ... -@_dispatch +@_dispatchable def read_graph6(path): ... def write_graph6(G, path, nodes: Incomplete | None = None, header: bool = True): ... diff --git a/stubs/networkx/networkx/readwrite/graphml.pyi b/stubs/networkx/networkx/readwrite/graphml.pyi index 548b1db14ab8..2ef976b5118c 100644 --- a/stubs/networkx/networkx/readwrite/graphml.pyi +++ b/stubs/networkx/networkx/readwrite/graphml.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from collections.abc import Generator from typing import Final -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable __all__ = [ "write_graphml", @@ -40,9 +40,9 @@ def generate_graphml( named_key_ids: bool = False, edge_id_from_attribute: Incomplete | None = None, ) -> Generator[Incomplete, Incomplete, None]: ... -@_dispatch +@_dispatchable def read_graphml(path, node_type=..., edge_key_type=..., force_multigraph: bool = False): ... -@_dispatch +@_dispatchable def parse_graphml(graphml_string, node_type=..., edge_key_type=..., force_multigraph: bool = False): ... class GraphML: @@ -113,7 +113,7 @@ class GraphMLWriterLxml(GraphMLWriter): ) -> None: ... def add_graph_element(self, G) -> None: ... def add_attributes(self, scope, xml_obj, data, default) -> None: ... - def dump(self) -> None: ... # type: ignore[override] # This incompatible signature is an actual issue in networkx + def dump(self, stream: Incomplete | None = None) -> None: ... write_graphml = write_graphml_lxml diff --git a/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi b/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi index fa2d68e67c25..35953a37d85c 100644 --- a/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi +++ b/stubs/networkx/networkx/readwrite/json_graph/adjacency.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def adjacency_data(G, attrs={"id": "id", "key": "key"}): ... -@_dispatch +@_dispatchable def adjacency_graph(data, directed: bool = False, multigraph: bool = True, attrs={"id": "id", "key": "key"}): ... diff --git a/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi b/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi index 03c5dd56d88a..59ce696c83c6 100644 --- a/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi +++ b/stubs/networkx/networkx/readwrite/json_graph/cytoscape.pyi @@ -1,5 +1,5 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def cytoscape_data(G, name: str = "name", ident: str = "id"): ... -@_dispatch +@_dispatchable def cytoscape_graph(data, name: str = "name", ident: str = "id"): ... diff --git a/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi b/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi index 040e13d40dcc..e37e34838277 100644 --- a/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +++ b/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def node_link_data( G, *, source: str = "source", target: str = "target", name: str = "id", key: str = "key", link: str = "links" ): ... -@_dispatch +@_dispatchable def node_link_graph( data, directed: bool = False, diff --git a/stubs/networkx/networkx/readwrite/json_graph/tree.pyi b/stubs/networkx/networkx/readwrite/json_graph/tree.pyi index 2c8d342e58a7..c9e503fa7270 100644 --- a/stubs/networkx/networkx/readwrite/json_graph/tree.pyi +++ b/stubs/networkx/networkx/readwrite/json_graph/tree.pyi @@ -1,5 +1,5 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def tree_data(G, root, ident: str = "id", children: str = "children"): ... -@_dispatch +@_dispatchable def tree_graph(data, ident: str = "id", children: str = "children"): ... diff --git a/stubs/networkx/networkx/readwrite/leda.pyi b/stubs/networkx/networkx/readwrite/leda.pyi index 5611384a5870..604a687efcd3 100644 --- a/stubs/networkx/networkx/readwrite/leda.pyi +++ b/stubs/networkx/networkx/readwrite/leda.pyi @@ -1,6 +1,6 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def read_leda(path, encoding: str = "UTF-8"): ... -@_dispatch +@_dispatchable def parse_leda(lines): ... diff --git a/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi b/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi index d1c2de83b1be..7764cac9ec73 100644 --- a/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi +++ b/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def generate_multiline_adjlist(G, delimiter: str = " ") -> Generator[Incomplete, None, None]: ... def write_multiline_adjlist(G, path, delimiter: str = " ", comments: str = "#", encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def parse_multiline_adjlist( lines, comments: str = "#", @@ -14,7 +14,7 @@ def parse_multiline_adjlist( nodetype: Incomplete | None = None, edgetype: Incomplete | None = None, ): ... -@_dispatch +@_dispatchable def read_multiline_adjlist( path, comments: str = "#", diff --git a/stubs/networkx/networkx/readwrite/p2g.pyi b/stubs/networkx/networkx/readwrite/p2g.pyi index c4a1a630d90e..f9da22dd2611 100644 --- a/stubs/networkx/networkx/readwrite/p2g.pyi +++ b/stubs/networkx/networkx/readwrite/p2g.pyi @@ -1,7 +1,7 @@ -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def write_p2g(G, path, encoding: str = "utf-8") -> None: ... -@_dispatch +@_dispatchable def read_p2g(path, encoding: str = "utf-8"): ... -@_dispatch +@_dispatchable def parse_p2g(lines): ... diff --git a/stubs/networkx/networkx/readwrite/pajek.pyi b/stubs/networkx/networkx/readwrite/pajek.pyi index fdce2f818ced..f48590aa91ef 100644 --- a/stubs/networkx/networkx/readwrite/pajek.pyi +++ b/stubs/networkx/networkx/readwrite/pajek.pyi @@ -1,11 +1,11 @@ from _typeshed import Incomplete from collections.abc import Generator -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable def generate_pajek(G) -> Generator[Incomplete, None, None]: ... def write_pajek(G, path, encoding: str = "UTF-8") -> None: ... -@_dispatch +@_dispatchable def read_pajek(path, encoding: str = "UTF-8"): ... -@_dispatch +@_dispatchable def parse_pajek(lines): ... diff --git a/stubs/networkx/networkx/readwrite/sparse6.pyi b/stubs/networkx/networkx/readwrite/sparse6.pyi index 7674f644e072..a1f2e30e64c1 100644 --- a/stubs/networkx/networkx/readwrite/sparse6.pyi +++ b/stubs/networkx/networkx/readwrite/sparse6.pyi @@ -1,10 +1,10 @@ from _typeshed import Incomplete -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable -@_dispatch +@_dispatchable def from_sparse6_bytes(string): ... def to_sparse6_bytes(G, nodes: Incomplete | None = None, header: bool = True): ... -@_dispatch +@_dispatchable def read_sparse6(path): ... def write_sparse6(G, path, nodes: Incomplete | None = None, header: bool = True) -> None: ... diff --git a/stubs/networkx/networkx/relabel.pyi b/stubs/networkx/networkx/relabel.pyi index f8402f5e4867..57aa6384395c 100644 --- a/stubs/networkx/networkx/relabel.pyi +++ b/stubs/networkx/networkx/relabel.pyi @@ -6,7 +6,7 @@ from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph from networkx.classes.multidigraph import MultiDiGraph from networkx.classes.multigraph import MultiGraph -from networkx.utils.backends import _dispatch +from networkx.utils.backends import _dispatchable _X = TypeVar("_X", bound=Hashable) _Y = TypeVar("_Y", bound=Hashable) @@ -19,7 +19,7 @@ def relabel_nodes(G: DiGraph[_X], mapping: Mapping[_X, _Y], copy: bool = True) - def relabel_nodes(G: MultiGraph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> MultiGraph[_X | _Y]: ... @overload def relabel_nodes(G: Graph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> Graph[_X | _Y]: ... -@_dispatch +@_dispatchable def convert_node_labels_to_integers( G: Graph[Hashable], first_label: int = 0, diff --git a/stubs/networkx/networkx/utils/__init__.pyi b/stubs/networkx/networkx/utils/__init__.pyi index 1417c4af9e2e..7e234b3f75a0 100644 --- a/stubs/networkx/networkx/utils/__init__.pyi +++ b/stubs/networkx/networkx/utils/__init__.pyi @@ -1,6 +1,25 @@ +from networkx.utils.backends import _dispatchable as _dispatchable +from networkx.utils.configs import * from networkx.utils.decorators import * from networkx.utils.heaps import * -from networkx.utils.misc import * + +# should be import * but pytype doesn't understand that _clear_cache is part of __all__ +from networkx.utils.misc import ( + PythonRandomInterface as PythonRandomInterface, + PythonRandomViaNumpyBits as PythonRandomViaNumpyBits, + _clear_cache as _clear_cache, + arbitrary_element as arbitrary_element, + create_py_random_state as create_py_random_state, + create_random_state as create_random_state, + dict_to_numpy_array as dict_to_numpy_array, + edges_equal as edges_equal, + flatten as flatten, + graphs_equal as graphs_equal, + groups as groups, + make_list_of_ints as make_list_of_ints, + nodes_equal as nodes_equal, + pairwise as pairwise, +) from networkx.utils.random_sequence import * from networkx.utils.rcm import * from networkx.utils.union_find import * diff --git a/stubs/networkx/networkx/utils/backends.pyi b/stubs/networkx/networkx/utils/backends.pyi index bec848c0a8e2..b0a280ab9127 100644 --- a/stubs/networkx/networkx/utils/backends.pyi +++ b/stubs/networkx/networkx/utils/backends.pyi @@ -5,9 +5,9 @@ from typing_extensions import ParamSpec, Self _P = ParamSpec("_P") _R = TypeVar("_R") -__all__ = ["_dispatch"] +__all__ = ["_dispatchable"] -class _dispatch(Generic[_P, _R]): +class _dispatchable(Generic[_P, _R]): __defaults__: Incomplete __kwdefaults__: Incomplete __module__: Incomplete @@ -20,12 +20,13 @@ class _dispatch(Generic[_P, _R]): preserve_edge_attrs: bool preserve_node_attrs: bool preserve_graph_attrs: bool + mutates_input: bool optional_graphs: Incomplete list_graphs: Incomplete graphs: dict[str, int] backends: dict[str, Incomplete] # Incomplete: Ignoring the case where func=None returns a partial, - # we only care about `_dispatch` used as a static-typing decorator + # we only care about `_dispatchable` used as a static-typing decorator def __new__( cls, func: Callable[_P, _R] | None = None, @@ -38,6 +39,8 @@ class _dispatch(Generic[_P, _R]): preserve_node_attrs: bool = False, preserve_graph_attrs: bool = False, preserve_all_attrs: bool = False, + mutates_input: bool = False, + returns_graph: bool = False, ) -> Self: ... @property def __doc__(self): ... diff --git a/stubs/networkx/networkx/utils/configs.pyi b/stubs/networkx/networkx/utils/configs.pyi new file mode 100644 index 000000000000..c9f8cb49d2dd --- /dev/null +++ b/stubs/networkx/networkx/utils/configs.pyi @@ -0,0 +1,32 @@ +from _typeshed import Incomplete +from collections.abc import ItemsView, Iterable, Iterator, KeysView, Mapping, ValuesView +from typing_extensions import Self + +__all__ = ["Config", "config"] + +class Config(Mapping[str, Incomplete]): + def __init_subclass__(cls, strict: bool = True) -> None: ... + def __new__(cls, **kwargs) -> Self: ... + def __dir__(self) -> Iterable[str]: ... + def __setattr__(self, name: str, value) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __contains__(self, key: object) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __reversed__(self) -> Iterator[str]: ... + def __getitem__(self, key: str): ... + def __setitem__(self, key: str, value) -> None: ... + def __delitem__(self, key: str) -> None: ... + def get(self, key: str, default: Incomplete | None = None): ... + def items(self) -> ItemsView[str, Incomplete]: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> ValuesView[Incomplete]: ... + +class NetworkXConfig(Config): + backend_priority: list[str] + backends: Config + cache_converted_graphs: bool + def __init__(self, *, backend_priority: list[str], backends: Config, cache_converted_graphs: bool) -> None: ... + def __new__(cls, *, backend_priority: list[str], backends: Config, cache_converted_graphs: bool) -> Self: ... + +config: NetworkXConfig diff --git a/stubs/networkx/networkx/utils/misc.pyi b/stubs/networkx/networkx/utils/misc.pyi index eb5414bc7bbc..261e030b1df2 100644 --- a/stubs/networkx/networkx/utils/misc.pyi +++ b/stubs/networkx/networkx/utils/misc.pyi @@ -5,6 +5,23 @@ from typing_extensions import TypeAlias import numpy +__all__ = [ + "flatten", + "make_list_of_ints", + "dict_to_numpy_array", + "arbitrary_element", + "pairwise", + "groups", + "create_random_state", + "create_py_random_state", + "PythonRandomInterface", + "PythonRandomViaNumpyBits", + "nodes_equal", + "edges_equal", + "graphs_equal", + "_clear_cache", +] + _RandomNumberGenerator: TypeAlias = ( ModuleType | random.Random | numpy.random.RandomState | numpy.random.Generator | PythonRandomInterface ) @@ -18,6 +35,10 @@ def pairwise(iterable, cyclic: bool = False): ... def groups(many_to_one): ... def create_random_state(random_state: Incomplete | None = None): ... +class PythonRandomViaNumpyBits(random.Random): + def __init__(self, rng: numpy.random.Generator | None = None) -> None: ... + def getrandbits(self, k: int) -> int: ... + class PythonRandomInterface: def __init__(self, rng: Incomplete | None = None) -> None: ... def random(self): ... @@ -35,3 +56,4 @@ def create_py_random_state(random_state: _RandomState = None): ... def nodes_equal(nodes1, nodes2): ... def edges_equal(edges1, edges2): ... def graphs_equal(graph1, graph2): ... +def _clear_cache(G) -> None: ...