diff --git a/README.md b/README.md index 51880acd..67798352 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Stubs for the following libraries now exist in typeshed or the libraries themsel - jmespath - markdown - netaddr +- networkx - openpyxl - opencv-python (see ; please upgrade opencv-python to 4.8.0+ and file any issues there) - packaging diff --git a/pyproject.toml b/pyproject.toml index 403063a3..b3ee3475 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,11 +20,11 @@ tests = [ "pandas-stubs", "pytest", "scipy-stubs", + "types-networkx", "typing_extensions", # The libraries we're stubbing. # Needed for stubtest and downloads their dependencies to get known import symbols - "networkx", "scikit-image", "scikit-learn <1.7.0", # TODO: Update stubs for sklearn "sympy", @@ -41,7 +41,6 @@ dev = [{ include-group = "hygiene" }, { include-group = "tests" }] # see https://github.com/microsoft/python-type-stubs/issues/315 [tool.setuptools.package-dir] # See README.md as to why matplotlib is not included -"networkx-stubs" = "stubs/networkx" "skimage-stubs" = "stubs/skimage" "sklearn-stubs" = "stubs/sklearn" "sympy-stubs" = "stubs/sympy-stubs" diff --git a/stubs/networkx/README.md b/stubs/networkx/README.md deleted file mode 100644 index 4a7c49d8..00000000 --- a/stubs/networkx/README.md +++ /dev/null @@ -1 +0,0 @@ -These stubs were created with https://github.com/gramster/docs2stubs. diff --git a/stubs/networkx/__init__.pyi b/stubs/networkx/__init__.pyi deleted file mode 100644 index 901f9d56..00000000 --- a/stubs/networkx/__init__.pyi +++ /dev/null @@ -1,66 +0,0 @@ -__version__: str = ... - -# These are imported in order as listed - -# Need to test with SciPy, when available -from . import ( - algorithms as algorithms, - classes as classes, - convert as convert, - convert_matrix as convert_matrix, - drawing as drawing, - generators as generators, - linalg as linalg, - readwrite as readwrite, - relabel as relabel, - utils as utils, -) -from .algorithms import * -from .classes import * -from .classes import filters as filters -from .convert import ( - from_dict_of_dicts as from_dict_of_dicts, - from_dict_of_lists as from_dict_of_lists, - from_edgelist as from_edgelist, - to_dict_of_dicts as to_dict_of_dicts, - to_dict_of_lists as to_dict_of_lists, - to_edgelist as to_edgelist, - to_networkx_graph as to_networkx_graph, -) -from .convert_matrix import ( - from_numpy_array as from_numpy_array, - from_numpy_matrix as from_numpy_matrix, - from_pandas_adjacency as from_pandas_adjacency, - from_pandas_edgelist as from_pandas_edgelist, - from_scipy_sparse_array as from_scipy_sparse_array, - from_scipy_sparse_matrix as from_scipy_sparse_matrix, - to_numpy_array as to_numpy_array, - to_numpy_matrix as to_numpy_matrix, - to_numpy_recarray as to_numpy_recarray, - to_pandas_adjacency as to_pandas_adjacency, - to_pandas_edgelist as to_pandas_edgelist, - to_scipy_sparse_array as to_scipy_sparse_array, - to_scipy_sparse_matrix as to_scipy_sparse_matrix, -) -from .drawing import * -from .exception import ( - AmbiguousSolution as AmbiguousSolution, - ExceededMaxIterations as ExceededMaxIterations, - HasACycle as HasACycle, - NetworkXAlgorithmError as NetworkXAlgorithmError, - NetworkXError as NetworkXError, - NetworkXException as NetworkXException, - NetworkXNoCycle as NetworkXNoCycle, - NetworkXNoPath as NetworkXNoPath, - NetworkXNotImplemented as NetworkXNotImplemented, - NetworkXPointlessConcept as NetworkXPointlessConcept, - NetworkXUnbounded as NetworkXUnbounded, - NetworkXUnfeasible as NetworkXUnfeasible, - NodeNotFound as NodeNotFound, - PowerIterationFailedConvergence as PowerIterationFailedConvergence, -) -from .generators import * -from .linalg import * -from .readwrite import * -from .relabel import convert_node_labels_to_integers as convert_node_labels_to_integers, relabel_nodes as relabel_nodes -from .testing.test import run as test diff --git a/stubs/networkx/_typing.pyi b/stubs/networkx/_typing.pyi deleted file mode 100644 index 48eb475c..00000000 --- a/stubs/networkx/_typing.pyi +++ /dev/null @@ -1,27 +0,0 @@ -import decimal -import io -import typing_extensions - -import numpy.typing -import pandas as pd - -Decimal = decimal.Decimal -PythonScalar: typing_extensions.TypeAlias = str | int | float | bool - -ArrayLike = numpy.typing.ArrayLike -FileLike = io.IOBase -PathLike = str - -PandasScalar: typing_extensions.TypeAlias = pd.Period | pd.Timestamp | pd.Timedelta | pd.Interval -Scalar: typing_extensions.TypeAlias = PythonScalar | PandasScalar - -Color: typing_extensions.TypeAlias = tuple[float, float, float] | str - -__all__ = [ - "ArrayLike", - "Color", - "Decimal", - "FileLike", - "PathLike", - "Scalar", -] diff --git a/stubs/networkx/algorithms/__init__.pyi b/stubs/networkx/algorithms/__init__.pyi deleted file mode 100644 index b5ed972d..00000000 --- a/stubs/networkx/algorithms/__init__.pyi +++ /dev/null @@ -1,308 +0,0 @@ -# Make certain subpackages available to the user as direct imports from -# the `networkx` namespace. -from . import ( - approximation as approximation, - assortativity as assortativity, - bipartite as bipartite, - centrality as centrality, - chordal as chordal, - clique as clique, - cluster as cluster, - coloring as coloring, - community as community, - components as components, - connectivity as connectivity, - flow as flow, - isomorphism as isomorphism, - link_analysis as link_analysis, - lowest_common_ancestors as lowest_common_ancestors, - node_classification as node_classification, - operators as operators, - shortest_paths as shortest_paths, - tournament as tournament, - traversal as traversal, - tree as tree, -) -from .assortativity import * -from .asteroidal import find_asteroidal_triple as find_asteroidal_triple, is_at_free as is_at_free - -# Make certain functions from some of the previous subpackages available -# to the user as direct imports from the `networkx` namespace. -from .bipartite import ( - complete_bipartite_graph as complete_bipartite_graph, - is_bipartite as is_bipartite, - project as project, - projected_graph as projected_graph, -) -from .boundary import edge_boundary as edge_boundary, node_boundary as node_boundary -from .bridges import bridges as bridges, has_bridges as has_bridges, local_bridges as local_bridges -from .centrality import * -from .chains import chain_decomposition as chain_decomposition -from .chordal import ( - NetworkXTreewidthBoundExceeded as NetworkXTreewidthBoundExceeded, - chordal_graph_cliques as chordal_graph_cliques, - chordal_graph_treewidth as chordal_graph_treewidth, - complete_to_chordal_graph as complete_to_chordal_graph, - find_induced_nodes as find_induced_nodes, - is_chordal as is_chordal, -) -from .clique import ( - cliques_containing_node as cliques_containing_node, - enumerate_all_cliques as enumerate_all_cliques, - find_cliques as find_cliques, - find_cliques_recursive as find_cliques_recursive, - graph_clique_number as graph_clique_number, - graph_number_of_cliques as graph_number_of_cliques, - make_clique_bipartite as make_clique_bipartite, - make_max_clique_graph as make_max_clique_graph, - max_weight_clique as max_weight_clique, - node_clique_number as node_clique_number, - number_of_cliques as number_of_cliques, -) -from .cluster import ( - average_clustering as average_clustering, - clustering as clustering, - generalized_degree as generalized_degree, - square_clustering as square_clustering, - transitivity as transitivity, - triangles as triangles, -) -from .coloring import * -from .communicability_alg import communicability as communicability, communicability_exp as communicability_exp -from .components import * -from .connectivity import ( - all_node_cuts as all_node_cuts, - all_pairs_node_connectivity as all_pairs_node_connectivity, - average_node_connectivity as average_node_connectivity, - edge_connectivity as edge_connectivity, - edge_disjoint_paths as edge_disjoint_paths, - is_k_edge_connected as is_k_edge_connected, - k_components as k_components, - k_edge_augmentation as k_edge_augmentation, - k_edge_components as k_edge_components, - k_edge_subgraphs as k_edge_subgraphs, - minimum_edge_cut as minimum_edge_cut, - minimum_node_cut as minimum_node_cut, - node_connectivity as node_connectivity, - node_disjoint_paths as node_disjoint_paths, - stoer_wagner as stoer_wagner, -) -from .core import ( - core_number as core_number, - find_cores as find_cores, - k_core as k_core, - k_corona as k_corona, - k_crust as k_crust, - k_shell as k_shell, - k_truss as k_truss, - onion_layers as onion_layers, -) -from .covering import is_edge_cover as is_edge_cover, min_edge_cover as min_edge_cover -from .cuts import ( - boundary_expansion as boundary_expansion, - conductance as conductance, - cut_size as cut_size, - edge_expansion as edge_expansion, - mixing_expansion as mixing_expansion, - node_expansion as node_expansion, - normalized_cut_size as normalized_cut_size, - volume as volume, -) -from .cycles import ( - cycle_basis as cycle_basis, - find_cycle as find_cycle, - minimum_cycle_basis as minimum_cycle_basis, - recursive_simple_cycles as recursive_simple_cycles, - simple_cycles as simple_cycles, -) -from .d_separation import d_separated as d_separated -from .dag import ( - all_topological_sorts as all_topological_sorts, - ancestors as ancestors, - antichains as antichains, - dag_longest_path as dag_longest_path, - dag_longest_path_length as dag_longest_path_length, - dag_to_branching as dag_to_branching, - descendants as descendants, - is_aperiodic as is_aperiodic, - is_directed_acyclic_graph as is_directed_acyclic_graph, - lexicographical_topological_sort as lexicographical_topological_sort, - topological_generations as topological_generations, - topological_sort as topological_sort, - transitive_closure as transitive_closure, - transitive_closure_dag as transitive_closure_dag, - transitive_reduction as transitive_reduction, -) -from .distance_measures import ( - barycenter as barycenter, - center as center, - diameter as diameter, - eccentricity as eccentricity, - extrema_bounding as extrema_bounding, - periphery as periphery, - radius as radius, - resistance_distance as resistance_distance, -) -from .distance_regular import ( - global_parameters as global_parameters, - intersection_array as intersection_array, - is_distance_regular as is_distance_regular, - is_strongly_regular as is_strongly_regular, -) -from .dominance import dominance_frontiers as dominance_frontiers, immediate_dominators as immediate_dominators -from .dominating import dominating_set as dominating_set, is_dominating_set as is_dominating_set -from .efficiency_measures import ( - efficiency as efficiency, - global_efficiency as global_efficiency, - local_efficiency as local_efficiency, -) -from .euler import ( - eulerian_circuit as eulerian_circuit, - eulerian_path as eulerian_path, - eulerize as eulerize, - has_eulerian_path as has_eulerian_path, - is_eulerian as is_eulerian, - is_semieulerian as is_semieulerian, -) -from .flow import ( - capacity_scaling as capacity_scaling, - cost_of_flow as cost_of_flow, - gomory_hu_tree as gomory_hu_tree, - max_flow_min_cost as max_flow_min_cost, - maximum_flow as maximum_flow, - maximum_flow_value as maximum_flow_value, - min_cost_flow as min_cost_flow, - min_cost_flow_cost as min_cost_flow_cost, - minimum_cut as minimum_cut, - minimum_cut_value as minimum_cut_value, - network_simplex as network_simplex, -) -from .graph_hashing import ( - weisfeiler_lehman_graph_hash as weisfeiler_lehman_graph_hash, - weisfeiler_lehman_subgraph_hashes as weisfeiler_lehman_subgraph_hashes, -) -from .graphical import ( - is_digraphical as is_digraphical, - is_graphical as is_graphical, - is_multigraphical as is_multigraphical, - is_pseudographical as is_pseudographical, - is_valid_degree_sequence_erdos_gallai as is_valid_degree_sequence_erdos_gallai, - is_valid_degree_sequence_havel_hakimi as is_valid_degree_sequence_havel_hakimi, -) -from .hierarchy import flow_hierarchy as flow_hierarchy -from .hybrid import is_kl_connected as is_kl_connected, kl_connected_subgraph as kl_connected_subgraph -from .isolate import is_isolate as is_isolate, isolates as isolates, number_of_isolates as number_of_isolates -from .isomorphism import ( - could_be_isomorphic as could_be_isomorphic, - fast_could_be_isomorphic as fast_could_be_isomorphic, - faster_could_be_isomorphic as faster_could_be_isomorphic, - is_isomorphic as is_isomorphic, -) -from .link_analysis import * -from .link_prediction import ( - adamic_adar_index as adamic_adar_index, - cn_soundarajan_hopcroft as cn_soundarajan_hopcroft, - common_neighbor_centrality as common_neighbor_centrality, - jaccard_coefficient as jaccard_coefficient, - preferential_attachment as preferential_attachment, - ra_index_soundarajan_hopcroft as ra_index_soundarajan_hopcroft, - resource_allocation_index as resource_allocation_index, - within_inter_cluster as within_inter_cluster, -) -from .lowest_common_ancestors import ( - all_pairs_lowest_common_ancestor as all_pairs_lowest_common_ancestor, - lowest_common_ancestor as lowest_common_ancestor, - tree_all_pairs_lowest_common_ancestor as tree_all_pairs_lowest_common_ancestor, -) -from .matching import ( - is_matching as is_matching, - is_maximal_matching as is_maximal_matching, - is_perfect_matching as is_perfect_matching, - max_weight_matching as max_weight_matching, - maximal_matching as maximal_matching, - min_weight_matching as min_weight_matching, -) -from .minors import * -from .mis import maximal_independent_set as maximal_independent_set -from .moral import moral_graph as moral_graph -from .non_randomness import non_randomness as non_randomness -from .operators import * -from .planar_drawing import combinatorial_embedding_to_pos as combinatorial_embedding_to_pos -from .planarity import PlanarEmbedding as PlanarEmbedding, check_planarity as check_planarity, is_planar as is_planar -from .polynomials import chromatic_polynomial as chromatic_polynomial, tutte_polynomial as tutte_polynomial -from .reciprocity import overall_reciprocity as overall_reciprocity, reciprocity as reciprocity -from .regular import is_k_regular as is_k_regular, is_regular as is_regular, k_factor as k_factor -from .richclub import rich_club_coefficient as rich_club_coefficient -from .shortest_paths import * -from .similarity import ( - generate_random_paths as generate_random_paths, - graph_edit_distance as graph_edit_distance, - optimal_edit_paths as optimal_edit_paths, - optimize_edit_paths as optimize_edit_paths, - optimize_graph_edit_distance as optimize_graph_edit_distance, - panther_similarity as panther_similarity, - simrank_similarity as simrank_similarity, - simrank_similarity_numpy as simrank_similarity_numpy, -) -from .simple_paths import ( - all_simple_edge_paths as all_simple_edge_paths, - all_simple_paths as all_simple_paths, - is_simple_path as is_simple_path, - shortest_simple_paths as shortest_simple_paths, -) -from .smallworld import ( - lattice_reference as lattice_reference, - omega as omega, - random_reference as random_reference, - sigma as sigma, -) -from .smetric import s_metric as s_metric -from .sparsifiers import spanner as spanner -from .structuralholes import constraint as constraint, effective_size as effective_size, local_constraint as local_constraint -from .summarization import dedensify as dedensify, snap_aggregation as snap_aggregation -from .swap import connected_double_edge_swap as connected_double_edge_swap, double_edge_swap as double_edge_swap -from .traversal import * -from .tree.branchings import ( - ArborescenceIterator as ArborescenceIterator, - maximum_branching as maximum_branching, - maximum_spanning_arborescence as maximum_spanning_arborescence, - minimum_branching as minimum_branching, - minimum_spanning_arborescence as minimum_spanning_arborescence, -) -from .tree.coding import ( - NotATree as NotATree, - from_nested_tuple as from_nested_tuple, - from_prufer_sequence as from_prufer_sequence, - to_nested_tuple as to_nested_tuple, - to_prufer_sequence as to_prufer_sequence, -) -from .tree.decomposition import junction_tree as junction_tree -from .tree.mst import ( - EdgePartition as EdgePartition, - SpanningTreeIterator as SpanningTreeIterator, - maximum_spanning_edges as maximum_spanning_edges, - maximum_spanning_tree as maximum_spanning_tree, - minimum_spanning_edges as minimum_spanning_edges, - minimum_spanning_tree as minimum_spanning_tree, - partition_spanning_tree as partition_spanning_tree, - random_spanning_tree as random_spanning_tree, -) -from .tree.operations import join as join -from .tree.recognition import ( - is_arborescence as is_arborescence, - is_branching as is_branching, - is_forest as is_forest, - is_tree as is_tree, -) -from .triads import ( - all_triads as all_triads, - all_triplets as all_triplets, - is_triad as is_triad, - random_triad as random_triad, - triad_type as triad_type, - triadic_census as triadic_census, - triads_by_type as triads_by_type, -) -from .vitality import closeness_vitality as closeness_vitality -from .voronoi import voronoi_cells as voronoi_cells -from .wiener import wiener_index as wiener_index diff --git a/stubs/networkx/algorithms/approximation/__init__.pyi b/stubs/networkx/algorithms/approximation/__init__.pyi deleted file mode 100644 index b12b9871..00000000 --- a/stubs/networkx/algorithms/approximation/__init__.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from ...algorithms.approximation.clique import ( - clique_removal as clique_removal, - large_clique_size as large_clique_size, - max_clique as max_clique, - maximum_independent_set as maximum_independent_set, -) -from .clustering_coefficient import average_clustering as average_clustering -from .connectivity import ( - all_pairs_node_connectivity as all_pairs_node_connectivity, - local_node_connectivity as local_node_connectivity, - node_connectivity as node_connectivity, -) -from .distance_measures import diameter as diameter -from .dominating_set import ( - min_edge_dominating_set as min_edge_dominating_set, - min_weighted_dominating_set as min_weighted_dominating_set, -) -from .kcomponents import k_components as k_components -from .matching import min_maximal_matching as min_maximal_matching -from .maxcut import one_exchange as one_exchange, randomized_partitioning as randomized_partitioning -from .ramsey import ramsey_R2 as ramsey_R2 -from .steinertree import metric_closure as metric_closure, steiner_tree as steiner_tree -from .traveling_salesman import ( - asadpour_atsp as asadpour_atsp, - christofides as christofides, - greedy_tsp as greedy_tsp, - simulated_annealing_tsp as simulated_annealing_tsp, - threshold_accepting_tsp as threshold_accepting_tsp, - traveling_salesman_problem as traveling_salesman_problem, -) -from .treewidth import treewidth_min_degree as treewidth_min_degree, treewidth_min_fill_in as treewidth_min_fill_in -from .vertex_cover import min_weighted_vertex_cover as min_weighted_vertex_cover diff --git a/stubs/networkx/algorithms/approximation/clique.pyi b/stubs/networkx/algorithms/approximation/clique.pyi deleted file mode 100644 index 1bf58945..00000000 --- a/stubs/networkx/algorithms/approximation/clique.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = [ - "clique_removal", - "max_clique", - "large_clique_size", - "maximum_independent_set", -] - -def maximum_independent_set(G: Graph) -> set: ... -def max_clique(G: Graph) -> set: ... -def clique_removal(G: Graph): ... -def large_clique_size(G: Graph): ... diff --git a/stubs/networkx/algorithms/approximation/clustering_coefficient.pyi b/stubs/networkx/algorithms/approximation/clustering_coefficient.pyi deleted file mode 100644 index 099da4d3..00000000 --- a/stubs/networkx/algorithms/approximation/clustering_coefficient.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ...classes.graph import Graph -from ...utils import not_implemented_for, py_random_state - -__all__ = ["average_clustering"] - -@py_random_state(2) -def average_clustering(G: Graph, trials=1000, seed=None) -> float: ... diff --git a/stubs/networkx/algorithms/approximation/connectivity.pyi b/stubs/networkx/algorithms/approximation/connectivity.pyi deleted file mode 100644 index 1359a74c..00000000 --- a/stubs/networkx/algorithms/approximation/connectivity.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import itertools -from collections.abc import Mapping -from operator import itemgetter - -from ...classes.graph import Graph - -__all__ = [ - "local_node_connectivity", - "node_connectivity", - "all_pairs_node_connectivity", -] - -def local_node_connectivity(G: Graph, source, target, cutoff=None): ... -def node_connectivity(G: Graph, s=None, t=None): ... -def all_pairs_node_connectivity(G: Graph, nbunch=None, cutoff=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/approximation/distance_measures.pyi b/stubs/networkx/algorithms/approximation/distance_measures.pyi deleted file mode 100644 index 28092329..00000000 --- a/stubs/networkx/algorithms/approximation/distance_measures.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ...classes.graph import Graph -from ...utils.decorators import py_random_state - -__all__ = ["diameter"] - -@py_random_state(1) -def diameter(G: Graph, seed=None): ... diff --git a/stubs/networkx/algorithms/approximation/dominating_set.pyi b/stubs/networkx/algorithms/approximation/dominating_set.pyi deleted file mode 100644 index 014f9d12..00000000 --- a/stubs/networkx/algorithms/approximation/dominating_set.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["min_weighted_dominating_set", "min_edge_dominating_set"] - -def min_weighted_dominating_set(G: Graph, weight: str | None = None) -> set: ... -def min_edge_dominating_set(G: Graph) -> set: ... diff --git a/stubs/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/algorithms/approximation/kcomponents.pyi deleted file mode 100644 index c247a294..00000000 --- a/stubs/networkx/algorithms/approximation/kcomponents.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from collections.abc import Mapping -from functools import cached_property - -from ...classes.graph import Graph - -__all__ = ["k_components"] - -def k_components(G: Graph, min_density: float = 0.95) -> Mapping: ... - -class _AntiGraph(Graph): - all_edge_dict: dict = ... - - def single_edge_dict(self): ... - - edge_attr_dict_factory = single_edge_dict - - def __getitem__(self, n) -> Mapping: ... - def neighbors(self, n): ... - @cached_property - def adj(self): ... - def subgraph(self, nodes): ... - @cached_property - def degree(self): ... - def adjacency(self): ... diff --git a/stubs/networkx/algorithms/approximation/matching.pyi b/stubs/networkx/algorithms/approximation/matching.pyi deleted file mode 100644 index 289d3fdc..00000000 --- a/stubs/networkx/algorithms/approximation/matching.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["min_maximal_matching"] - -def min_maximal_matching(G: Graph) -> set: ... diff --git a/stubs/networkx/algorithms/approximation/maxcut.pyi b/stubs/networkx/algorithms/approximation/maxcut.pyi deleted file mode 100644 index 5f488f27..00000000 --- a/stubs/networkx/algorithms/approximation/maxcut.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from typing import Any - -from ..._typing import Scalar -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for, py_random_state - -__all__ = ["randomized_partitioning", "one_exchange"] - -@py_random_state(1) -def randomized_partitioning(G: Graph, seed=None, p: Scalar = 0.5, weight: Any = None): ... -@py_random_state(2) -def one_exchange(G: Graph, initial_cut: set | None = None, seed=None, weight: Any = None): ... diff --git a/stubs/networkx/algorithms/approximation/ramsey.pyi b/stubs/networkx/algorithms/approximation/ramsey.pyi deleted file mode 100644 index 0d2bfb92..00000000 --- a/stubs/networkx/algorithms/approximation/ramsey.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph -from ...utils import arbitrary_element, not_implemented_for - -__all__ = ["ramsey_R2"] - -def ramsey_R2(G: Graph): ... diff --git a/stubs/networkx/algorithms/approximation/steinertree.pyi b/stubs/networkx/algorithms/approximation/steinertree.pyi deleted file mode 100644 index 90dfc960..00000000 --- a/stubs/networkx/algorithms/approximation/steinertree.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from itertools import chain - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import not_implemented_for, pairwise - -__all__ = ["metric_closure", "steiner_tree"] - -def metric_closure(G: Graph, weight="weight"): ... -def steiner_tree(G: Graph, terminal_nodes: ArrayLike, weight="weight"): ... diff --git a/stubs/networkx/algorithms/approximation/traveling_salesman.pyi b/stubs/networkx/algorithms/approximation/traveling_salesman.pyi deleted file mode 100644 index 5175236b..00000000 --- a/stubs/networkx/algorithms/approximation/traveling_salesman.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import math -from collections.abc import Mapping -from typing import Literal - -from numpy.typing import ArrayLike - -from ...algorithms.tree.mst import random_spanning_tree -from ...classes.graph import Graph -from ...utils import not_implemented_for, pairwise, py_random_state - -__all__ = [ - "traveling_salesman_problem", - "christofides", - "asadpour_atsp", - "greedy_tsp", - "simulated_annealing_tsp", - "threshold_accepting_tsp", -] - -def swap_two_nodes(soln, seed) -> ArrayLike: ... -def move_one_node(soln, seed) -> ArrayLike: ... -def christofides(G: Graph, weight="weight", tree=None) -> ArrayLike: ... -def traveling_salesman_problem(G: Graph, weight="weight", nodes=None, cycle=True, method=None) -> ArrayLike: ... -@py_random_state(2) -def asadpour_atsp(G: Graph, weight="weight", seed=None, source=None): ... -def held_karp_ascent(G: Graph, weight="weight"): ... -def spanning_tree_distribution(G: Graph, z: Mapping) -> Mapping: ... -def greedy_tsp(G: Graph, weight="weight", source=None): ... -@py_random_state(9) -def simulated_annealing_tsp( - G: Graph, - init_cycle, - weight="weight", - source=None, - temp=100, - move="1-1", - max_iterations=10, - N_inner=100, - alpha=0.01, - seed=None, -): ... -@py_random_state(9) -def threshold_accepting_tsp( - G: Graph, - init_cycle: ArrayLike | Literal["greedy"], - weight="weight", - source=None, - threshold=1, - move="1-1", - max_iterations=10, - N_inner=100, - alpha=0.1, - seed=None, -): ... diff --git a/stubs/networkx/algorithms/approximation/treewidth.pyi b/stubs/networkx/algorithms/approximation/treewidth.pyi deleted file mode 100644 index a9eb41d5..00000000 --- a/stubs/networkx/algorithms/approximation/treewidth.pyi +++ /dev/null @@ -1,18 +0,0 @@ -import itertools -import sys -from heapq import heapify, heappop, heappush - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = ["treewidth_min_degree", "treewidth_min_fill_in"] - -def treewidth_min_degree(G: Graph): ... -def treewidth_min_fill_in(G: Graph): ... - -class MinDegreeHeuristic: - def __init__(self, graph): ... - def best_node(self, graph): ... - -def min_fill_in_heuristic(graph): ... -def treewidth_decomp(G: Graph, heuristic=...): ... diff --git a/stubs/networkx/algorithms/approximation/vertex_cover.pyi b/stubs/networkx/algorithms/approximation/vertex_cover.pyi deleted file mode 100644 index 00ab01b3..00000000 --- a/stubs/networkx/algorithms/approximation/vertex_cover.pyi +++ /dev/null @@ -1,4 +0,0 @@ -__all__ = ["min_weighted_vertex_cover"] -from ...classes.graph import Graph - -def min_weighted_vertex_cover(G: Graph, weight=None) -> set: ... diff --git a/stubs/networkx/algorithms/assortativity/__init__.pyi b/stubs/networkx/algorithms/assortativity/__init__.pyi deleted file mode 100644 index 3343e1c4..00000000 --- a/stubs/networkx/algorithms/assortativity/__init__.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from .connectivity import average_degree_connectivity as average_degree_connectivity, k_nearest_neighbors as k_nearest_neighbors -from .correlation import ( - attribute_assortativity_coefficient as attribute_assortativity_coefficient, - degree_assortativity_coefficient as degree_assortativity_coefficient, - degree_pearson_correlation_coefficient as degree_pearson_correlation_coefficient, - numeric_assortativity_coefficient as numeric_assortativity_coefficient, -) -from .mixing import ( - attribute_mixing_dict as attribute_mixing_dict, - attribute_mixing_matrix as attribute_mixing_matrix, - degree_mixing_dict as degree_mixing_dict, - degree_mixing_matrix as degree_mixing_matrix, - mixing_dict as mixing_dict, - numeric_mixing_matrix as numeric_mixing_matrix, -) -from .neighbor_degree import average_neighbor_degree as average_neighbor_degree -from .pairs import node_attribute_xy as node_attribute_xy, node_degree_xy as node_degree_xy diff --git a/stubs/networkx/algorithms/assortativity/connectivity.pyi b/stubs/networkx/algorithms/assortativity/connectivity.pyi deleted file mode 100644 index 86bba7b8..00000000 --- a/stubs/networkx/algorithms/assortativity/connectivity.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping -from typing import Literal - -from ...classes.graph import Graph - -__all__ = ["average_degree_connectivity", "k_nearest_neighbors"] - -def average_degree_connectivity( - G: Graph, - source="in+out", - target: Literal["in+out", "out", "in"] = "in+out", - nodes=None, - weight=None, -) -> Mapping: ... -def k_nearest_neighbors(G: Graph, source="in+out", target="in+out", nodes=None, weight=None): ... diff --git a/stubs/networkx/algorithms/assortativity/correlation.pyi b/stubs/networkx/algorithms/assortativity/correlation.pyi deleted file mode 100644 index ada1eb16..00000000 --- a/stubs/networkx/algorithms/assortativity/correlation.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from ...classes.graph import Graph -from .mixing import attribute_mixing_matrix, degree_mixing_matrix -from .pairs import node_degree_xy - -__all__ = [ - "degree_pearson_correlation_coefficient", - "degree_assortativity_coefficient", - "attribute_assortativity_coefficient", - "numeric_assortativity_coefficient", -] - -def degree_assortativity_coefficient(G: Graph, x="out", y="in", weight=None, nodes=None) -> float: ... -def degree_pearson_correlation_coefficient(G: Graph, x="out", y="in", weight=None, nodes=None) -> float: ... -def attribute_assortativity_coefficient(G: Graph, attribute: str, nodes=None) -> float: ... -def numeric_assortativity_coefficient(G: Graph, attribute: str, nodes=None) -> float: ... -def attribute_ac(M): ... diff --git a/stubs/networkx/algorithms/assortativity/mixing.pyi b/stubs/networkx/algorithms/assortativity/mixing.pyi deleted file mode 100644 index 573b38f5..00000000 --- a/stubs/networkx/algorithms/assortativity/mixing.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import dict_to_numpy_array -from .pairs import node_attribute_xy, node_degree_xy - -__all__ = [ - "attribute_mixing_matrix", - "attribute_mixing_dict", - "degree_mixing_matrix", - "degree_mixing_dict", - "numeric_mixing_matrix", - "mixing_dict", -] - -def attribute_mixing_dict(G: Graph, attribute: str, nodes=None, normalized=False) -> Mapping: ... -def attribute_mixing_matrix( - G: Graph, - attribute: str, - nodes=None, - mapping: Mapping | None = None, - normalized=True, -): ... -def degree_mixing_dict(G: Graph, x="out", y="in", weight=None, nodes=None, normalized=False) -> Mapping: ... -def degree_mixing_matrix( - G: Graph, - x="out", - y="in", - weight=None, - nodes=None, - normalized=True, - mapping: Mapping | None = None, -): ... -def numeric_mixing_matrix( - G: Graph, - attribute: str, - nodes=None, - normalized=True, - mapping: Mapping | None = None, -): ... -def mixing_dict(xy, normalized=False) -> Mapping: ... diff --git a/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi b/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi deleted file mode 100644 index 5c66e4bd..00000000 --- a/stubs/networkx/algorithms/assortativity/neighbor_degree.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["average_neighbor_degree"] - -def average_neighbor_degree(G: Graph, source="out", target="out", nodes=None, weight=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/assortativity/pairs.pyi b/stubs/networkx/algorithms/assortativity/pairs.pyi deleted file mode 100644 index ce76b034..00000000 --- a/stubs/networkx/algorithms/assortativity/pairs.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["node_attribute_xy", "node_degree_xy"] - -def node_attribute_xy(G: Graph, attribute, nodes=None): ... -def node_degree_xy(G: Graph, x="out", y="in", weight=None, nodes=None): ... diff --git a/stubs/networkx/algorithms/asteroidal.pyi b/stubs/networkx/algorithms/asteroidal.pyi deleted file mode 100644 index 3632aad6..00000000 --- a/stubs/networkx/algorithms/asteroidal.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["is_at_free", "find_asteroidal_triple"] - -def find_asteroidal_triple(G: Graph) -> list | None: ... -def is_at_free(G: Graph) -> bool: ... -def create_component_structure(G: Graph) -> Mapping: ... diff --git a/stubs/networkx/algorithms/bipartite/__init__.pyi b/stubs/networkx/algorithms/bipartite/__init__.pyi deleted file mode 100644 index 34a5e895..00000000 --- a/stubs/networkx/algorithms/bipartite/__init__.pyi +++ /dev/null @@ -1,54 +0,0 @@ -from .basic import ( - color as color, - degrees as degrees, - density as density, - is_bipartite as is_bipartite, - is_bipartite_node_set as is_bipartite_node_set, - sets as sets, -) -from .centrality import ( - betweenness_centrality as betweenness_centrality, - closeness_centrality as closeness_centrality, - degree_centrality as degree_centrality, -) -from .cluster import ( - average_clustering as average_clustering, - clustering as clustering, - latapy_clustering as latapy_clustering, - robins_alexander_clustering as robins_alexander_clustering, -) -from .covering import min_edge_cover as min_edge_cover -from .edgelist import ( - generate_edgelist as generate_edgelist, - parse_edgelist as parse_edgelist, - read_edgelist as read_edgelist, - write_edgelist as write_edgelist, -) -from .generators import ( - alternating_havel_hakimi_graph as alternating_havel_hakimi_graph, - complete_bipartite_graph as complete_bipartite_graph, - configuration_model as configuration_model, - gnmk_random_graph as gnmk_random_graph, - havel_hakimi_graph as havel_hakimi_graph, - preferential_attachment_graph as preferential_attachment_graph, - random_graph as random_graph, - reverse_havel_hakimi_graph as reverse_havel_hakimi_graph, -) -from .matching import ( - eppstein_matching as eppstein_matching, - hopcroft_karp_matching as hopcroft_karp_matching, - maximum_matching as maximum_matching, - minimum_weight_full_matching as minimum_weight_full_matching, - to_vertex_cover as to_vertex_cover, -) -from .matrix import biadjacency_matrix as biadjacency_matrix, from_biadjacency_matrix as from_biadjacency_matrix -from .projection import ( - collaboration_weighted_projected_graph as collaboration_weighted_projected_graph, - generic_weighted_projected_graph as generic_weighted_projected_graph, - overlap_weighted_projected_graph as overlap_weighted_projected_graph, - project as project, - projected_graph as projected_graph, - weighted_projected_graph as weighted_projected_graph, -) -from .redundancy import node_redundancy as node_redundancy -from .spectral import spectral_bipartivity as spectral_bipartivity diff --git a/stubs/networkx/algorithms/bipartite/basic.pyi b/stubs/networkx/algorithms/bipartite/basic.pyi deleted file mode 100644 index 989d2dad..00000000 --- a/stubs/networkx/algorithms/bipartite/basic.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Mapping - -from ...algorithms.components import connected_components -from ...classes.graph import Graph -from ...exception import AmbiguousSolution - -__all__ = [ - "is_bipartite", - "is_bipartite_node_set", - "color", - "sets", - "density", - "degrees", -] - -def color(G: Graph) -> Mapping: ... -def is_bipartite(G: Graph): ... -def is_bipartite_node_set(G: Graph, nodes): ... -def sets(G: Graph, top_nodes=None) -> tuple[set, set]: ... -def density(B, nodes) -> float: ... -def degrees(B, nodes, weight=None) -> tuple[dict, ...]: ... diff --git a/stubs/networkx/algorithms/bipartite/centrality.pyi b/stubs/networkx/algorithms/bipartite/centrality.pyi deleted file mode 100644 index 6d6a17aa..00000000 --- a/stubs/networkx/algorithms/bipartite/centrality.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["degree_centrality", "betweenness_centrality", "closeness_centrality"] - -def degree_centrality(G: Graph, nodes) -> Mapping: ... -def betweenness_centrality(G: Graph, nodes) -> Mapping: ... -def closeness_centrality(G: Graph, nodes, normalized: bool = True) -> Mapping: ... diff --git a/stubs/networkx/algorithms/bipartite/cluster.pyi b/stubs/networkx/algorithms/bipartite/cluster.pyi deleted file mode 100644 index 2a331049..00000000 --- a/stubs/networkx/algorithms/bipartite/cluster.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import itertools -from collections.abc import Iterable, Mapping - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = [ - "clustering", - "average_clustering", - "latapy_clustering", - "robins_alexander_clustering", -] - -def cc_dot(nu, nv): ... -def cc_max(nu, nv): ... -def cc_min(nu, nv): ... - -modes: dict = ... - -def latapy_clustering(G: Graph, nodes=None, mode: str = "dot") -> Mapping: ... - -clustering = ... - -def average_clustering(G: Graph, nodes: ArrayLike | Iterable | None = None, mode: str = "dot") -> float: ... -def robins_alexander_clustering(G: Graph) -> float: ... diff --git a/stubs/networkx/algorithms/bipartite/covering.pyi b/stubs/networkx/algorithms/bipartite/covering.pyi deleted file mode 100644 index 87c16cea..00000000 --- a/stubs/networkx/algorithms/bipartite/covering.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ...algorithms.covering import min_edge_cover as _min_edge_cover -from ...classes.graph import Graph -from ...utils import not_implemented_for -from .matching import hopcroft_karp_matching - -__all__ = ["min_edge_cover"] - -def min_edge_cover(G: Graph, matching_algorithm=None) -> set: ... diff --git a/stubs/networkx/algorithms/bipartite/edgelist.pyi b/stubs/networkx/algorithms/bipartite/edgelist.pyi deleted file mode 100644 index 8f28dd06..00000000 --- a/stubs/networkx/algorithms/bipartite/edgelist.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = ["generate_edgelist", "write_edgelist", "parse_edgelist", "read_edgelist"] - -from ...utils import not_implemented_for, open_file - -def write_edgelist( - G: Graph, - path, - comments: str = "#", - delimiter: str = " ", - data: bool | ArrayLike = True, - encoding: str = "utf-8", -): ... -def generate_edgelist(G: Graph, delimiter: str = " ", data=True) -> str: ... -def parse_edgelist( - lines, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - data=True, -): ... -def read_edgelist( - path, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - data=True, - edgetype=None, - encoding: str = "utf-8", -): ... diff --git a/stubs/networkx/algorithms/bipartite/generators.pyi b/stubs/networkx/algorithms/bipartite/generators.pyi deleted file mode 100644 index 26c85621..00000000 --- a/stubs/networkx/algorithms/bipartite/generators.pyi +++ /dev/null @@ -1,32 +0,0 @@ -import math -import numbers -from functools import reduce - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import nodes_or_number, py_random_state - -__all__ = [ - "configuration_model", - "havel_hakimi_graph", - "reverse_havel_hakimi_graph", - "alternating_havel_hakimi_graph", - "preferential_attachment_graph", - "random_graph", - "gnmk_random_graph", - "complete_bipartite_graph", -] - -def complete_bipartite_graph(n1, n2, create_using=None): ... -@py_random_state(3) -def configuration_model(aseq: ArrayLike, bseq: ArrayLike, create_using=None, seed=None): ... -def havel_hakimi_graph(aseq: ArrayLike, bseq: ArrayLike, create_using=None): ... -def reverse_havel_hakimi_graph(aseq: ArrayLike, bseq: ArrayLike, create_using=None): ... -def alternating_havel_hakimi_graph(aseq: ArrayLike, bseq: ArrayLike, create_using=None): ... -@py_random_state(3) -def preferential_attachment_graph(aseq: ArrayLike, p: float, create_using=None, seed=None): ... -@py_random_state(3) -def random_graph(n: int, m: int, p: float, seed=None, directed=False): ... -@py_random_state(3) -def gnmk_random_graph(n: int, m: int, k: int, seed=None, directed=False): ... diff --git a/stubs/networkx/algorithms/bipartite/matching.pyi b/stubs/networkx/algorithms/bipartite/matching.pyi deleted file mode 100644 index 8d9c502b..00000000 --- a/stubs/networkx/algorithms/bipartite/matching.pyi +++ /dev/null @@ -1,37 +0,0 @@ -# This module uses material from the Wikipedia article Hopcroft--Karp algorithm -# , accessed on -# January 3, 2015, which is released under the Creative Commons -# Attribution-Share-Alike License 3.0 -# . That article includes -# pseudocode, which has been translated into the corresponding Python code. -# -# Portions of this module use code from David Eppstein's Python Algorithms and -# Data Structures (PADS) library, which is dedicated to the public domain (for -# proof, see ). -import collections -import itertools -from collections.abc import Mapping - -from ...classes.graph import Graph -from .matrix import biadjacency_matrix - -__all__ = [ - "maximum_matching", - "hopcroft_karp_matching", - "eppstein_matching", - "to_vertex_cover", - "minimum_weight_full_matching", -] - -INFINITY = ... - -def hopcroft_karp_matching(G: Graph, top_nodes=None) -> Mapping: ... -def eppstein_matching(G: Graph, top_nodes=None) -> Mapping: ... -def to_vertex_cover(G: Graph, matching: Mapping, top_nodes=None): ... - -#: Returns the maximum cardinality matching in the given bipartite graph. -#: -#: This function is simply an alias for :func:`hopcroft_karp_matching`. -maximum_matching = ... - -def minimum_weight_full_matching(G: Graph, top_nodes=None, weight="weight") -> Mapping: ... diff --git a/stubs/networkx/algorithms/bipartite/matrix.pyi b/stubs/networkx/algorithms/bipartite/matrix.pyi deleted file mode 100644 index 3f2f6ad7..00000000 --- a/stubs/networkx/algorithms/bipartite/matrix.pyi +++ /dev/null @@ -1,17 +0,0 @@ -import itertools - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = ["biadjacency_matrix", "from_biadjacency_matrix"] - -def biadjacency_matrix( - G: Graph, - row_order, - column_order: ArrayLike | None = None, - dtype=None, - weight="weight", - format="csr", -): ... -def from_biadjacency_matrix(A, create_using=None, edge_attribute: str = "weight"): ... diff --git a/stubs/networkx/algorithms/bipartite/projection.pyi b/stubs/networkx/algorithms/bipartite/projection.pyi deleted file mode 100644 index 9c9ac760..00000000 --- a/stubs/networkx/algorithms/bipartite/projection.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections.abc import Iterable - -from numpy.typing import ArrayLike - -from ...exception import NetworkXAlgorithmError -from ...utils import not_implemented_for - -__all__ = [ - "project", - "projected_graph", - "weighted_projected_graph", - "collaboration_weighted_projected_graph", - "overlap_weighted_projected_graph", - "generic_weighted_projected_graph", -] - -def projected_graph(B, nodes: ArrayLike | Iterable, multigraph=False): ... -def weighted_projected_graph(B, nodes: ArrayLike | Iterable, ratio=False): ... -def collaboration_weighted_projected_graph(B, nodes: ArrayLike | Iterable): ... -def overlap_weighted_projected_graph(B, nodes: ArrayLike | Iterable, jaccard=True): ... -def generic_weighted_projected_graph(B, nodes: ArrayLike | Iterable, weight_function=None): ... -def project(B, nodes, create_using=None): ... diff --git a/stubs/networkx/algorithms/bipartite/redundancy.pyi b/stubs/networkx/algorithms/bipartite/redundancy.pyi deleted file mode 100644 index b8b2957c..00000000 --- a/stubs/networkx/algorithms/bipartite/redundancy.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping -from itertools import combinations - -from networkx import NetworkXError - -from ...classes.graph import Graph - -__all__ = ["node_redundancy"] - -def node_redundancy(G: Graph, nodes=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/bipartite/spectral.pyi b/stubs/networkx/algorithms/bipartite/spectral.pyi deleted file mode 100644 index f34fb629..00000000 --- a/stubs/networkx/algorithms/bipartite/spectral.pyi +++ /dev/null @@ -1,5 +0,0 @@ -__all__ = ["spectral_bipartivity"] - -from ...classes.graph import Graph - -def spectral_bipartivity(G: Graph, nodes=None, weight="weight") -> float | dict: ... diff --git a/stubs/networkx/algorithms/boundary.pyi b/stubs/networkx/algorithms/boundary.pyi deleted file mode 100644 index ed7e4567..00000000 --- a/stubs/networkx/algorithms/boundary.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Iterable -from itertools import chain -from typing import Any - -from ..classes.graph import Graph - -__all__ = ["edge_boundary", "node_boundary"] - -def edge_boundary( - G: Graph, - nbunch1: Iterable, - nbunch2: Iterable | None = None, - data: bool | Any = False, - keys: bool = False, - default: Any = None, -): ... -def node_boundary(G: Graph, nbunch1: Iterable, nbunch2: Iterable | None = None) -> set: ... diff --git a/stubs/networkx/algorithms/bridges.pyi b/stubs/networkx/algorithms/bridges.pyi deleted file mode 100644 index 8b706918..00000000 --- a/stubs/networkx/algorithms/bridges.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from itertools import chain - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["bridges", "has_bridges", "local_bridges"] - -def bridges(G: Graph, root=None): ... -def has_bridges(G: Graph, root=None) -> bool: ... -def local_bridges(G: Graph, with_span: bool = True, weight=None): ... diff --git a/stubs/networkx/algorithms/centrality/__init__.pyi b/stubs/networkx/algorithms/centrality/__init__.pyi deleted file mode 100644 index deb58992..00000000 --- a/stubs/networkx/algorithms/centrality/__init__.pyi +++ /dev/null @@ -1,66 +0,0 @@ -from .betweenness import ( - betweenness_centrality as betweenness_centrality, - edge_betweenness as edge_betweenness, - edge_betweenness_centrality as edge_betweenness_centrality, -) -from .betweenness_subset import ( - betweenness_centrality_source as betweenness_centrality_source, - betweenness_centrality_subset as betweenness_centrality_subset, - edge_betweenness_centrality_subset as edge_betweenness_centrality_subset, -) -from .closeness import ( - closeness_centrality as closeness_centrality, - incremental_closeness_centrality as incremental_closeness_centrality, -) -from .current_flow_betweenness import ( - approximate_current_flow_betweenness_centrality as approximate_current_flow_betweenness_centrality, - current_flow_betweenness_centrality as current_flow_betweenness_centrality, - edge_current_flow_betweenness_centrality as edge_current_flow_betweenness_centrality, -) -from .current_flow_betweenness_subset import ( - current_flow_betweenness_centrality_subset as current_flow_betweenness_centrality_subset, - edge_current_flow_betweenness_centrality_subset as edge_current_flow_betweenness_centrality_subset, -) -from .current_flow_closeness import ( - current_flow_closeness_centrality as current_flow_closeness_centrality, - information_centrality as information_centrality, -) -from .degree_alg import ( - degree_centrality as degree_centrality, - in_degree_centrality as in_degree_centrality, - out_degree_centrality as out_degree_centrality, -) -from .dispersion import dispersion as dispersion -from .eigenvector import ( - eigenvector_centrality as eigenvector_centrality, - eigenvector_centrality_numpy as eigenvector_centrality_numpy, -) -from .group import ( - group_betweenness_centrality as group_betweenness_centrality, - group_closeness_centrality as group_closeness_centrality, - group_degree_centrality as group_degree_centrality, - group_in_degree_centrality as group_in_degree_centrality, - group_out_degree_centrality as group_out_degree_centrality, - prominent_group as prominent_group, -) -from .harmonic import harmonic_centrality as harmonic_centrality -from .katz import katz_centrality as katz_centrality, katz_centrality_numpy as katz_centrality_numpy -from .load import edge_load_centrality as edge_load_centrality, load_centrality as load_centrality -from .percolation import percolation_centrality as percolation_centrality -from .reaching import ( - global_reaching_centrality as global_reaching_centrality, - local_reaching_centrality as local_reaching_centrality, -) -from .second_order import second_order_centrality as second_order_centrality -from .subgraph_alg import ( - communicability_betweenness_centrality as communicability_betweenness_centrality, - estrada_index as estrada_index, - subgraph_centrality as subgraph_centrality, - subgraph_centrality_exp as subgraph_centrality_exp, -) -from .trophic import ( - trophic_differences as trophic_differences, - trophic_incoherence_parameter as trophic_incoherence_parameter, - trophic_levels as trophic_levels, -) -from .voterank_alg import voterank as voterank diff --git a/stubs/networkx/algorithms/centrality/betweenness.pyi b/stubs/networkx/algorithms/centrality/betweenness.pyi deleted file mode 100644 index 5b76c540..00000000 --- a/stubs/networkx/algorithms/centrality/betweenness.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import warnings -from collections import deque -from collections.abc import Mapping -from heapq import heappop, heappush -from itertools import count - -from ...classes.graph import Graph -from ...utils import py_random_state -from ...utils.decorators import not_implemented_for - -__all__ = ["betweenness_centrality", "edge_betweenness_centrality", "edge_betweenness"] - -@py_random_state(5) -def betweenness_centrality( - G: Graph, - k=None, - normalized: bool = True, - weight=None, - endpoints: bool = False, - seed=None, -) -> Mapping: ... -@py_random_state(4) -def edge_betweenness_centrality(G: Graph, k=None, normalized: bool = True, weight=None, seed=None) -> Mapping: ... - -# obsolete name -def edge_betweenness(G: Graph, k=None, normalized=True, weight=None, seed=None): ... diff --git a/stubs/networkx/algorithms/centrality/betweenness_subset.pyi b/stubs/networkx/algorithms/centrality/betweenness_subset.pyi deleted file mode 100644 index 40f42f73..00000000 --- a/stubs/networkx/algorithms/centrality/betweenness_subset.pyi +++ /dev/null @@ -1,16 +0,0 @@ -import warnings -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = [ - "betweenness_centrality_subset", - "betweenness_centrality_source", - "edge_betweenness_centrality_subset", -] - -def betweenness_centrality_subset(G: Graph, sources, targets, normalized: bool = False, weight=None) -> Mapping: ... -def edge_betweenness_centrality_subset(G: Graph, sources, targets, normalized: bool = False, weight=None) -> Mapping: ... - -# obsolete name -def betweenness_centrality_source(G: Graph, normalized=True, weight=None, sources=None): ... diff --git a/stubs/networkx/algorithms/centrality/closeness.pyi b/stubs/networkx/algorithms/centrality/closeness.pyi deleted file mode 100644 index 435d1d46..00000000 --- a/stubs/networkx/algorithms/centrality/closeness.pyi +++ /dev/null @@ -1,17 +0,0 @@ -import functools -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...exception import NetworkXError -from ...utils.decorators import not_implemented_for - -__all__ = ["closeness_centrality", "incremental_closeness_centrality"] - -def closeness_centrality(G: Graph, u=None, distance=None, wf_improved=True) -> Mapping: ... -def incremental_closeness_centrality( - G: Graph, - edge: tuple, - prev_cc: Mapping | None = None, - insertion: bool = True, - wf_improved=True, -) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi b/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi deleted file mode 100644 index 2f61694d..00000000 --- a/stubs/networkx/algorithms/centrality/current_flow_betweenness.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for, py_random_state, reverse_cuthill_mckee_ordering -from .flow_matrix import CGInverseLaplacian, FullInverseLaplacian, SuperLUInverseLaplacian, flow_matrix_row - -__all__ = [ - "current_flow_betweenness_centrality", - "approximate_current_flow_betweenness_centrality", - "edge_current_flow_betweenness_centrality", -] - -@py_random_state(7) -def approximate_current_flow_betweenness_centrality( - G: Graph, - normalized=True, - weight=None, - dtype=..., - solver="full", - epsilon: float = 0.5, - kmax: int = 10000, - seed=None, -) -> Mapping: ... -def current_flow_betweenness_centrality(G: Graph, normalized=True, weight=None, dtype=..., solver="full") -> Mapping: ... -def edge_current_flow_betweenness_centrality(G: Graph, normalized=True, weight=None, dtype=..., solver="full") -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi b/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi deleted file mode 100644 index 4ec8c04a..00000000 --- a/stubs/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for, reverse_cuthill_mckee_ordering -from .flow_matrix import flow_matrix_row - -__all__ = [ - "current_flow_betweenness_centrality_subset", - "edge_current_flow_betweenness_centrality_subset", -] - -def current_flow_betweenness_centrality_subset( - G: Graph, sources, targets, normalized=True, weight=None, dtype=..., solver="lu" -) -> Mapping: ... -def edge_current_flow_betweenness_centrality_subset( - G: Graph, sources, targets, normalized=True, weight=None, dtype=..., solver="lu" -) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi b/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi deleted file mode 100644 index f92215f4..00000000 --- a/stubs/networkx/algorithms/centrality/current_flow_closeness.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for, reverse_cuthill_mckee_ordering -from .flow_matrix import CGInverseLaplacian, FullInverseLaplacian, SuperLUInverseLaplacian - -__all__ = ["current_flow_closeness_centrality", "information_centrality"] - -def current_flow_closeness_centrality(G: Graph, weight=None, dtype=..., solver="lu") -> Mapping: ... - -information_centrality = ... diff --git a/stubs/networkx/algorithms/centrality/degree_alg.pyi b/stubs/networkx/algorithms/centrality/degree_alg.pyi deleted file mode 100644 index 809aa1c5..00000000 --- a/stubs/networkx/algorithms/centrality/degree_alg.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = ["degree_centrality", "in_degree_centrality", "out_degree_centrality"] - -def degree_centrality(G: Graph) -> Mapping: ... -def in_degree_centrality(G: Graph) -> Mapping: ... -def out_degree_centrality(G: Graph) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/dispersion.pyi b/stubs/networkx/algorithms/centrality/dispersion.pyi deleted file mode 100644 index e001c8f5..00000000 --- a/stubs/networkx/algorithms/centrality/dispersion.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping -from itertools import combinations - -from ...classes.graph import Graph - -__all__ = ["dispersion"] - -def dispersion(G: Graph, u=None, v=None, normalized: bool = True, alpha=1.0, b=0.0, c=0.0) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/eigenvector.pyi b/stubs/networkx/algorithms/centrality/eigenvector.pyi deleted file mode 100644 index f70c344d..00000000 --- a/stubs/networkx/algorithms/centrality/eigenvector.pyi +++ /dev/null @@ -1,10 +0,0 @@ -import math -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = ["eigenvector_centrality", "eigenvector_centrality_numpy"] - -def eigenvector_centrality(G: Graph, max_iter=100, tol=1.0e-6, nstart=None, weight=None) -> Mapping: ... -def eigenvector_centrality_numpy(G: Graph, weight=None, max_iter=50, tol=0) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/flow_matrix.pyi b/stubs/networkx/algorithms/centrality/flow_matrix.pyi deleted file mode 100644 index 8e9f69d3..00000000 --- a/stubs/networkx/algorithms/centrality/flow_matrix.pyi +++ /dev/null @@ -1,33 +0,0 @@ -# Helpers for current-flow betweenness and current-flow closness -# Lazy computations for inverse Laplacian and flow-matrix rows. - -from ...classes.graph import Graph - -def flow_matrix_row(G: Graph, weight=None, dtype=..., solver="lu"): ... - -# Class to compute the inverse laplacian only for specified rows -# Allows computation of the current-flow matrix without storing entire -# inverse laplacian matrix -class InverseLaplacian: - def __init__(self, L, width=None, dtype=None): ... - def init_solver(self, L): ... - def solve(self, r): ... - def solve_inverse(self, r): ... - def get_rows(self, r1, r2): ... - def get_row(self, r): ... - def width(self, L): ... - -class FullInverseLaplacian(InverseLaplacian): - def init_solver(self, L): ... - def solve(self, rhs): ... - def solve_inverse(self, r): ... - -class SuperLUInverseLaplacian(InverseLaplacian): - def init_solver(self, L): ... - def solve_inverse(self, r): ... - def solve(self, rhs): ... - -class CGInverseLaplacian(InverseLaplacian): - def init_solver(self, L): ... - def solve(self, rhs): ... - def solve_inverse(self, r): ... diff --git a/stubs/networkx/algorithms/centrality/group.pyi b/stubs/networkx/algorithms/centrality/group.pyi deleted file mode 100644 index 24435757..00000000 --- a/stubs/networkx/algorithms/centrality/group.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from copy import deepcopy - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = [ - "group_betweenness_centrality", - "group_closeness_centrality", - "group_degree_centrality", - "group_in_degree_centrality", - "group_out_degree_centrality", - "prominent_group", -] - -def group_betweenness_centrality(G: Graph, C, normalized=True, weight=None, endpoints=False): ... -def prominent_group( - G: Graph, - k: int, - weight=None, - C=None, - endpoints=False, - normalized=True, - greedy=False, -) -> tuple[float, ArrayLike]: ... -def group_closeness_centrality(G: Graph, S: ArrayLike | set, weight=None) -> float: ... -def group_degree_centrality(G: Graph, S: ArrayLike | set) -> float: ... -def group_in_degree_centrality(G: Graph, S: ArrayLike | set) -> float: ... -def group_out_degree_centrality(G: Graph, S: ArrayLike | set) -> float: ... diff --git a/stubs/networkx/algorithms/centrality/harmonic.pyi b/stubs/networkx/algorithms/centrality/harmonic.pyi deleted file mode 100644 index 4368ead2..00000000 --- a/stubs/networkx/algorithms/centrality/harmonic.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping -from functools import partial - -from ...classes.graph import Graph - -__all__ = ["harmonic_centrality"] - -def harmonic_centrality(G: Graph, nbunch=None, distance=None, sources=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/katz.pyi b/stubs/networkx/algorithms/centrality/katz.pyi deleted file mode 100644 index b35850ee..00000000 --- a/stubs/networkx/algorithms/centrality/katz.pyi +++ /dev/null @@ -1,25 +0,0 @@ -import math -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = ["katz_centrality", "katz_centrality_numpy"] - -def katz_centrality( - G: Graph, - alpha: float = 0.1, - beta=1.0, - max_iter=1000, - tol=1.0e-6, - nstart: Mapping | None = None, - normalized=True, - weight=None, -) -> Mapping: ... -def katz_centrality_numpy( - G: Graph, - alpha: float = 0.1, - beta=1.0, - normalized: bool = True, - weight: str | None = None, -) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/load.pyi b/stubs/networkx/algorithms/centrality/load.pyi deleted file mode 100644 index 4d9c096b..00000000 --- a/stubs/networkx/algorithms/centrality/load.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from collections.abc import Mapping -from operator import itemgetter - -from ...classes.graph import Graph - -__all__ = ["load_centrality", "edge_load_centrality"] - -def newman_betweenness_centrality(G: Graph, v=None, cutoff=None, normalized=True, weight=None) -> Mapping: ... - -load_centrality = ... - -def edge_load_centrality(G: Graph, cutoff=False): ... diff --git a/stubs/networkx/algorithms/centrality/percolation.pyi b/stubs/networkx/algorithms/centrality/percolation.pyi deleted file mode 100644 index 5f3c3ec1..00000000 --- a/stubs/networkx/algorithms/centrality/percolation.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["percolation_centrality"] - -def percolation_centrality(G: Graph, attribute="percolation", states=None, weight=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/reaching.pyi b/stubs/networkx/algorithms/centrality/reaching.pyi deleted file mode 100644 index fa3f6d9f..00000000 --- a/stubs/networkx/algorithms/centrality/reaching.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ...classes.digraph import DiGraph -from ...classes.graph import Graph -from ...utils import pairwise - -__all__ = ["global_reaching_centrality", "local_reaching_centrality"] - -def global_reaching_centrality(G: DiGraph, weight=None, normalized=True) -> float: ... -def local_reaching_centrality(G: DiGraph, v, paths=None, weight=None, normalized=True) -> float: ... diff --git a/stubs/networkx/algorithms/centrality/second_order.pyi b/stubs/networkx/algorithms/centrality/second_order.pyi deleted file mode 100644 index 3140d0ed..00000000 --- a/stubs/networkx/algorithms/centrality/second_order.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -# Authors: Erwan Le Merrer (erwan.lemerrer@technicolor.com) - -__all__ = ["second_order_centrality"] - -def second_order_centrality(G: Graph) -> Mapping: ... diff --git a/stubs/networkx/algorithms/centrality/subgraph_alg.pyi b/stubs/networkx/algorithms/centrality/subgraph_alg.pyi deleted file mode 100644 index 14d6d104..00000000 --- a/stubs/networkx/algorithms/centrality/subgraph_alg.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = [ - "subgraph_centrality_exp", - "subgraph_centrality", - "communicability_betweenness_centrality", - "estrada_index", -] - -def subgraph_centrality_exp(G: Graph) -> Mapping: ... -def subgraph_centrality(G: Graph) -> Mapping: ... -def communicability_betweenness_centrality(G: Graph) -> Mapping: ... -def estrada_index(G: Graph) -> float: ... diff --git a/stubs/networkx/algorithms/centrality/trophic.pyi b/stubs/networkx/algorithms/centrality/trophic.pyi deleted file mode 100644 index a777102e..00000000 --- a/stubs/networkx/algorithms/centrality/trophic.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping - -from ...classes.digraph import DiGraph -from ...utils import not_implemented_for - -__all__ = ["trophic_levels", "trophic_differences", "trophic_incoherence_parameter"] - -def trophic_levels(G: DiGraph, weight="weight") -> Mapping: ... -def trophic_differences(G: DiGraph, weight="weight") -> Mapping: ... -def trophic_incoherence_parameter(G: DiGraph, weight="weight", cannibalism: bool = False) -> float: ... diff --git a/stubs/networkx/algorithms/centrality/voterank_alg.pyi b/stubs/networkx/algorithms/centrality/voterank_alg.pyi deleted file mode 100644 index a9de3b73..00000000 --- a/stubs/networkx/algorithms/centrality/voterank_alg.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = ["voterank"] - -def voterank(G: Graph, number_of_nodes=None) -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/chains.pyi b/stubs/networkx/algorithms/chains.pyi deleted file mode 100644 index bcd19701..00000000 --- a/stubs/networkx/algorithms/chains.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["chain_decomposition"] - -def chain_decomposition(G: Graph, root=None): ... diff --git a/stubs/networkx/algorithms/chordal.pyi b/stubs/networkx/algorithms/chordal.pyi deleted file mode 100644 index 9f0b0b35..00000000 --- a/stubs/networkx/algorithms/chordal.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import sys -import warnings - -from ..algorithms.components import connected_components -from ..classes.graph import Graph -from ..exception import NetworkXException -from ..utils import arbitrary_element, not_implemented_for - -__all__ = [ - "is_chordal", - "find_induced_nodes", - "chordal_graph_cliques", - "chordal_graph_treewidth", - "NetworkXTreewidthBoundExceeded", - "complete_to_chordal_graph", -] - -class NetworkXTreewidthBoundExceeded(NetworkXException): ... - -def is_chordal(G: Graph) -> bool: ... -def find_induced_nodes(G: Graph, s, t, treewidth_bound: float = ...): ... -def chordal_graph_cliques(G: Graph): ... -def chordal_graph_treewidth(G: Graph) -> int: ... -def complete_to_chordal_graph(G: Graph): ... diff --git a/stubs/networkx/algorithms/clique.pyi b/stubs/networkx/algorithms/clique.pyi deleted file mode 100644 index 473c4109..00000000 --- a/stubs/networkx/algorithms/clique.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = [ - "find_cliques", - "find_cliques_recursive", - "make_max_clique_graph", - "make_clique_bipartite", - "graph_clique_number", - "graph_number_of_cliques", - "node_clique_number", - "number_of_cliques", - "cliques_containing_node", - "enumerate_all_cliques", - "max_weight_clique", -] - -def enumerate_all_cliques(G: Graph): ... -def find_cliques(G: Graph, nodes=None): ... -def find_cliques_recursive(G: Graph, nodes=None): ... -def make_max_clique_graph(G: Graph, create_using=None): ... -def make_clique_bipartite(G: Graph, fpos: bool | None = None, create_using=None, name=None): ... -def graph_clique_number(G: Graph, cliques: ArrayLike | None = None) -> int: ... -def graph_number_of_cliques(G: Graph, cliques: ArrayLike | None = None) -> int: ... -def node_clique_number(G: Graph, nodes=None, cliques=None, separate_nodes=False) -> int | dict: ... -def number_of_cliques(G: Graph, nodes=None, cliques=None): ... -def cliques_containing_node(G: Graph, nodes=None, cliques=None): ... - -class MaxWeightClique: - def __init__(self, G: Graph, weight): ... - def update_incumbent_if_improved(self, C, C_weight): ... - def greedily_find_independent_set(self, P): ... - def find_branching_nodes(self, P, target): ... - def expand(self, C, C_weight, P): ... - def find_max_weight_clique(self): ... - -def max_weight_clique(G: Graph, weight="weight") -> tuple[ArrayLike, int]: ... diff --git a/stubs/networkx/algorithms/cluster.pyi b/stubs/networkx/algorithms/cluster.pyi deleted file mode 100644 index ce35a47a..00000000 --- a/stubs/networkx/algorithms/cluster.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections import Counter -from collections.abc import Mapping -from itertools import chain, combinations - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = [ - "triangles", - "average_clustering", - "clustering", - "transitivity", - "square_clustering", - "generalized_degree", -] - -def triangles(G: Graph, nodes=None) -> Mapping: ... -def average_clustering(G: Graph, nodes=None, weight=None, count_zeros: bool = True) -> float: ... -def clustering(G: Graph, nodes=None, weight=None) -> float | dict: ... -def transitivity(G: Graph) -> float: ... -def square_clustering(G: Graph, nodes=None) -> Mapping: ... -def generalized_degree(G: Graph, nodes=None): ... diff --git a/stubs/networkx/algorithms/coloring/__init__.pyi b/stubs/networkx/algorithms/coloring/__init__.pyi deleted file mode 100644 index d0b7324c..00000000 --- a/stubs/networkx/algorithms/coloring/__init__.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from .equitable_coloring import equitable_color as equitable_color -from .greedy_coloring import greedy_color as greedy_color diff --git a/stubs/networkx/algorithms/coloring/equitable_coloring.pyi b/stubs/networkx/algorithms/coloring/equitable_coloring.pyi deleted file mode 100644 index 19668e3b..00000000 --- a/stubs/networkx/algorithms/coloring/equitable_coloring.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections import defaultdict - -from ...classes.graph import Graph - -__all__ = ["equitable_color"] - -def is_coloring(G: Graph, coloring): ... -def is_equitable(G: Graph, coloring, num_colors=None): ... -def make_C_from_F(F): ... -def make_N_from_L_C(L, C): ... -def make_H_from_C_N(C, N): ... -def change_color(u, X, Y, N, H, F, C, L): ... -def move_witnesses(src_color, dst_color, N, H, F, C, T_cal, L): ... -def pad_graph(G: Graph, num_colors): ... -def procedure_P(V_minus, V_plus, N, H, F, C, L, excluded_colors=None): ... -def equitable_color(G: Graph, num_colors): ... diff --git a/stubs/networkx/algorithms/coloring/greedy_coloring.pyi b/stubs/networkx/algorithms/coloring/greedy_coloring.pyi deleted file mode 100644 index ea751ca7..00000000 --- a/stubs/networkx/algorithms/coloring/greedy_coloring.pyi +++ /dev/null @@ -1,49 +0,0 @@ -import itertools -from collections import defaultdict, deque - -from ...classes.graph import Graph -from ...utils import arbitrary_element, py_random_state - -__all__ = [ - "greedy_color", - "strategy_connected_sequential", - "strategy_connected_sequential_bfs", - "strategy_connected_sequential_dfs", - "strategy_independent_set", - "strategy_largest_first", - "strategy_random_sequential", - "strategy_saturation_largest_first", - "strategy_smallest_last", -] - -def strategy_largest_first(G: Graph, colors): ... -@py_random_state(2) -def strategy_random_sequential(G: Graph, colors, seed=None): ... -def strategy_smallest_last(G: Graph, colors): ... -def strategy_independent_set(G: Graph, colors): ... -def strategy_connected_sequential_bfs(G: Graph, colors): ... -def strategy_connected_sequential_dfs(G: Graph, colors): ... -def strategy_connected_sequential(G: Graph, colors, traversal="bfs"): ... -def strategy_saturation_largest_first(G: Graph, colors): ... - -#: Dictionary mapping name of a strategy as a string to the strategy function. -STRATEGIES: dict = ... - -def greedy_color(G: Graph, strategy="largest_first", interchange: bool = False): ... - -# Tools for coloring with interchanges -class _Node: - __slots__: list = ... - - def __init__(self, node_id, n): ... - def __repr__(self): ... - def assign_color(self, adj_entry, color): ... - def clear_color(self, adj_entry, color): ... - def iter_neighbors(self): ... - def iter_neighbors_color(self, color): ... - -class _AdjEntry: - __slots__: list = ... - - def __init__(self, node_id): ... - def __repr__(self): ... diff --git a/stubs/networkx/algorithms/communicability_alg.pyi b/stubs/networkx/algorithms/communicability_alg.pyi deleted file mode 100644 index ca3f2eba..00000000 --- a/stubs/networkx/algorithms/communicability_alg.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Mapping - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["communicability", "communicability_exp"] - -def communicability(G: Graph) -> dict[dict, dict]: ... -def communicability_exp(G: Graph) -> dict[dict, dict]: ... diff --git a/stubs/networkx/algorithms/community/__init__.pyi b/stubs/networkx/algorithms/community/__init__.pyi deleted file mode 100644 index fd1d0c64..00000000 --- a/stubs/networkx/algorithms/community/__init__.pyi +++ /dev/null @@ -1,11 +0,0 @@ -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 * -from networkx.algorithms.community.louvain import * -from networkx.algorithms.community.lukes import * -from networkx.algorithms.community.modularity_max import * -from networkx.algorithms.community.quality import * diff --git a/stubs/networkx/algorithms/community/asyn_fluid.pyi b/stubs/networkx/algorithms/community/asyn_fluid.pyi deleted file mode 100644 index f6da7844..00000000 --- a/stubs/networkx/algorithms/community/asyn_fluid.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from collections import Counter -from collections.abc import Iterable - -from ...algorithms.components import is_connected -from ...classes.graph import Graph -from ...exception import NetworkXError -from ...utils import groups, not_implemented_for, py_random_state - -__all__ = ["asyn_fluidc"] - -@py_random_state(3) -def asyn_fluidc(G: Graph, k, max_iter=100, seed=None) -> Iterable: ... diff --git a/stubs/networkx/algorithms/community/centrality.pyi b/stubs/networkx/algorithms/community/centrality.pyi deleted file mode 100644 index 019bcbfe..00000000 --- a/stubs/networkx/algorithms/community/centrality.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["girvan_newman"] - -def girvan_newman(G: Graph, most_valuable_edge=None): ... diff --git a/stubs/networkx/algorithms/community/community_utils.pyi b/stubs/networkx/algorithms/community/community_utils.pyi deleted file mode 100644 index ce2aae2d..00000000 --- a/stubs/networkx/algorithms/community/community_utils.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["is_partition"] - -def is_partition(G: Graph, communities): ... diff --git a/stubs/networkx/algorithms/community/divisive.pyi b/stubs/networkx/algorithms/community/divisive.pyi deleted file mode 100644 index c39616aa..00000000 --- a/stubs/networkx/algorithms/community/divisive.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["edge_betweenness_partition", "edge_current_flow_betweenness_partition"] - -def edge_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ... -def edge_current_flow_betweenness_partition(G: Graph, number_of_sets: int, *, weight: str | None = None) -> list: ... diff --git a/stubs/networkx/algorithms/community/kclique.pyi b/stubs/networkx/algorithms/community/kclique.pyi deleted file mode 100644 index 4afb1fcd..00000000 --- a/stubs/networkx/algorithms/community/kclique.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from collections import defaultdict - -from ...classes.graph import Graph - -__all__ = ["k_clique_communities"] - -def k_clique_communities(G: Graph, k: int, cliques=None): ... diff --git a/stubs/networkx/algorithms/community/kernighan_lin.pyi b/stubs/networkx/algorithms/community/kernighan_lin.pyi deleted file mode 100644 index d58b6b2f..00000000 --- a/stubs/networkx/algorithms/community/kernighan_lin.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from itertools import count - -from ...classes.graph import Graph -from ...utils import BinaryHeap, not_implemented_for, py_random_state -from .community_utils import is_partition - -__all__ = ["kernighan_lin_bisection"] - -@py_random_state(4) -def kernighan_lin_bisection( - G: Graph, - partition: tuple | None = None, - max_iter: int = 10, - weight="weight", - seed=None, -) -> tuple: ... diff --git a/stubs/networkx/algorithms/community/label_propagation.pyi b/stubs/networkx/algorithms/community/label_propagation.pyi deleted file mode 100644 index 5ed1beac..00000000 --- a/stubs/networkx/algorithms/community/label_propagation.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections import Counter, defaultdict -from collections.abc import Iterable - -from ...classes.graph import Graph -from ...utils import groups, not_implemented_for, py_random_state - -__all__ = ["label_propagation_communities", "asyn_lpa_communities"] - -@py_random_state(2) -def asyn_lpa_communities(G: Graph, weight: str | None = None, seed=None) -> Iterable: ... -def label_propagation_communities(G: Graph) -> Iterable: ... diff --git a/stubs/networkx/algorithms/community/louvain.pyi b/stubs/networkx/algorithms/community/louvain.pyi deleted file mode 100644 index b38b90a5..00000000 --- a/stubs/networkx/algorithms/community/louvain.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from collections import defaultdict, deque - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import py_random_state - -__all__ = ["louvain_communities", "louvain_partitions"] - -@py_random_state("seed") -def louvain_communities(G: Graph, weight="weight", resolution=1, threshold=0.0000001, seed=None) -> ArrayLike: ... -@py_random_state("seed") -def louvain_partitions(G: Graph, weight="weight", resolution=1, threshold=0.0000001, seed=None): ... diff --git a/stubs/networkx/algorithms/community/lukes.pyi b/stubs/networkx/algorithms/community/lukes.pyi deleted file mode 100644 index eec2879d..00000000 --- a/stubs/networkx/algorithms/community/lukes.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from copy import deepcopy -from functools import lru_cache -from random import choice - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = ["lukes_partitioning"] - -D_EDGE_W: str = ... -D_EDGE_VALUE: float = ... -D_NODE_W: str = ... -D_NODE_VALUE: int = ... -PKEY: str = ... -CLUSTER_EVAL_CACHE_SIZE: int = ... - -def lukes_partitioning(G: Graph, max_size: int, node_weight=None, edge_weight=None) -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/community/modularity_max.pyi b/stubs/networkx/algorithms/community/modularity_max.pyi deleted file mode 100644 index 8e758e9f..00000000 --- a/stubs/networkx/algorithms/community/modularity_max.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections import defaultdict - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import not_implemented_for -from ...utils.mapped_queue import MappedQueue -from .quality import modularity - -__all__ = [ - "greedy_modularity_communities", - "naive_greedy_modularity_communities", - "_naive_greedy_modularity_communities", -] - -def greedy_modularity_communities( - G: Graph, weight=None, resolution=1, cutoff=1, best_n=None, n_communities=None -) -> ArrayLike: ... -def naive_greedy_modularity_communities(G: Graph, resolution=1, weight=None) -> ArrayLike: ... - -# old name -_naive_greedy_modularity_communities = ... diff --git a/stubs/networkx/algorithms/community/quality.pyi b/stubs/networkx/algorithms/community/quality.pyi deleted file mode 100644 index fc17f91e..00000000 --- a/stubs/networkx/algorithms/community/quality.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from collections.abc import Callable, Sequence -from itertools import combinations -from typing import TypeVar - -from networkx import NetworkXError - -from ...classes.graph import Graph -from ...utils import not_implemented_for -from ...utils.decorators import argmap -from .community_utils import is_partition - -__all__ = ["coverage", "modularity", "performance", "partition_quality"] - -class NotAPartition(NetworkXError): - def __init__(self, G: Graph, collection): ... - -require_partition: argmap - -def intra_community_edges(G: Graph, partition): ... -def inter_community_edges(G: Graph, partition): ... -def inter_community_non_edges(G: Graph, partition): ... -@require_partition -def performance(G: Graph, partition: Sequence) -> float: ... -@require_partition -def coverage(G: Graph, partition: Sequence) -> float: ... -def modularity(G: Graph, communities, weight="weight", resolution=1) -> float: ... -@require_partition -def partition_quality(G: Graph, partition: Sequence): ... diff --git a/stubs/networkx/algorithms/components/__init__.pyi b/stubs/networkx/algorithms/components/__init__.pyi deleted file mode 100644 index e093c535..00000000 --- a/stubs/networkx/algorithms/components/__init__.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from .attracting import ( - attracting_components as attracting_components, - is_attracting_component as is_attracting_component, - number_attracting_components as number_attracting_components, -) -from .biconnected import ( - articulation_points as articulation_points, - biconnected_component_edges as biconnected_component_edges, - biconnected_components as biconnected_components, - is_biconnected as is_biconnected, -) -from .connected import ( - connected_components as connected_components, - is_connected as is_connected, - node_connected_component as node_connected_component, - number_connected_components as number_connected_components, -) -from .semiconnected import is_semiconnected as is_semiconnected -from .strongly_connected import ( - condensation as condensation, - is_strongly_connected as is_strongly_connected, - kosaraju_strongly_connected_components as kosaraju_strongly_connected_components, - number_strongly_connected_components as number_strongly_connected_components, - strongly_connected_components as strongly_connected_components, - strongly_connected_components_recursive as strongly_connected_components_recursive, -) -from .weakly_connected import ( - is_weakly_connected as is_weakly_connected, - number_weakly_connected_components as number_weakly_connected_components, - weakly_connected_components as weakly_connected_components, -) diff --git a/stubs/networkx/algorithms/components/attracting.pyi b/stubs/networkx/algorithms/components/attracting.pyi deleted file mode 100644 index edb3570f..00000000 --- a/stubs/networkx/algorithms/components/attracting.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from ...classes.digraph import DiGraph -from ...classes.multidigraph import MultiDiGraph -from ...utils.decorators import not_implemented_for - -__all__ = [ - "number_attracting_components", - "attracting_components", - "is_attracting_component", -] - -def attracting_components(G: DiGraph | MultiDiGraph): ... -def number_attracting_components(G: DiGraph | MultiDiGraph) -> int: ... -def is_attracting_component(G: DiGraph | MultiDiGraph) -> bool: ... diff --git a/stubs/networkx/algorithms/components/biconnected.pyi b/stubs/networkx/algorithms/components/biconnected.pyi deleted file mode 100644 index 5e352749..00000000 --- a/stubs/networkx/algorithms/components/biconnected.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from itertools import chain - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = [ - "biconnected_components", - "biconnected_component_edges", - "is_biconnected", - "articulation_points", -] - -def is_biconnected(G: Graph) -> bool: ... -def biconnected_component_edges(G: Graph): ... -def biconnected_components(G: Graph): ... -def articulation_points(G: Graph): ... diff --git a/stubs/networkx/algorithms/components/connected.pyi b/stubs/networkx/algorithms/components/connected.pyi deleted file mode 100644 index b22156da..00000000 --- a/stubs/networkx/algorithms/components/connected.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from ...classes.graph import Graph -from ...utils import arbitrary_element -from ...utils.decorators import not_implemented_for - -__all__ = [ - "number_connected_components", - "connected_components", - "is_connected", - "node_connected_component", -] - -def connected_components(G: Graph): ... -def number_connected_components(G: Graph): ... -def is_connected(G: Graph) -> bool: ... -def node_connected_component(G: Graph, n) -> set: ... diff --git a/stubs/networkx/algorithms/components/semiconnected.pyi b/stubs/networkx/algorithms/components/semiconnected.pyi deleted file mode 100644 index 5f9b6588..00000000 --- a/stubs/networkx/algorithms/components/semiconnected.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils import not_implemented_for, pairwise - -__all__ = ["is_semiconnected"] - -def is_semiconnected(G: Graph, topo_order: ArrayLike | tuple | None = None) -> bool: ... diff --git a/stubs/networkx/algorithms/components/strongly_connected.pyi b/stubs/networkx/algorithms/components/strongly_connected.pyi deleted file mode 100644 index ce5293dd..00000000 --- a/stubs/networkx/algorithms/components/strongly_connected.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = [ - "number_strongly_connected_components", - "strongly_connected_components", - "is_strongly_connected", - "strongly_connected_components_recursive", - "kosaraju_strongly_connected_components", - "condensation", -] - -def strongly_connected_components(G: Graph): ... -def kosaraju_strongly_connected_components(G: Graph, source=None): ... -def strongly_connected_components_recursive(G: Graph): ... -def number_strongly_connected_components(G: Graph): ... -def is_strongly_connected(G: Graph) -> bool: ... -def condensation(G: Graph, scc=None): ... diff --git a/stubs/networkx/algorithms/components/weakly_connected.pyi b/stubs/networkx/algorithms/components/weakly_connected.pyi deleted file mode 100644 index 70f328c8..00000000 --- a/stubs/networkx/algorithms/components/weakly_connected.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = [ - "number_weakly_connected_components", - "weakly_connected_components", - "is_weakly_connected", -] - -def weakly_connected_components(G: Graph): ... -def number_weakly_connected_components(G: Graph): ... -def is_weakly_connected(G: Graph) -> bool: ... diff --git a/stubs/networkx/algorithms/connectivity/__init__.pyi b/stubs/networkx/algorithms/connectivity/__init__.pyi deleted file mode 100644 index 1ce81f84..00000000 --- a/stubs/networkx/algorithms/connectivity/__init__.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from .connectivity import ( - all_pairs_node_connectivity as all_pairs_node_connectivity, - average_node_connectivity as average_node_connectivity, - edge_connectivity as edge_connectivity, - local_edge_connectivity as local_edge_connectivity, - local_node_connectivity as local_node_connectivity, - node_connectivity as node_connectivity, -) -from .cuts import ( - minimum_edge_cut as minimum_edge_cut, - minimum_node_cut as minimum_node_cut, - minimum_st_edge_cut as minimum_st_edge_cut, - minimum_st_node_cut as minimum_st_node_cut, -) -from .disjoint_paths import edge_disjoint_paths as edge_disjoint_paths, node_disjoint_paths as node_disjoint_paths -from .edge_augmentation import ( - is_k_edge_connected as is_k_edge_connected, - is_locally_k_edge_connected as is_locally_k_edge_connected, - k_edge_augmentation as k_edge_augmentation, -) -from .edge_kcomponents import ( - EdgeComponentAuxGraph as EdgeComponentAuxGraph, - bridge_components as bridge_components, - k_edge_components as k_edge_components, - k_edge_subgraphs as k_edge_subgraphs, -) -from .kcomponents import k_components as k_components -from .kcutsets import all_node_cuts as all_node_cuts -from .stoerwagner import stoer_wagner as stoer_wagner -from .utils import ( - build_auxiliary_edge_connectivity as build_auxiliary_edge_connectivity, - build_auxiliary_node_connectivity as build_auxiliary_node_connectivity, -) diff --git a/stubs/networkx/algorithms/connectivity/connectivity.pyi b/stubs/networkx/algorithms/connectivity/connectivity.pyi deleted file mode 100644 index 67f1a6a8..00000000 --- a/stubs/networkx/algorithms/connectivity/connectivity.pyi +++ /dev/null @@ -1,27 +0,0 @@ -import itertools -from collections.abc import Mapping -from operator import itemgetter - -# Define the default maximum flow function to use in all flow based -# connectivity algorithms. -from ...algorithms.flow import boykov_kolmogorov, build_residual_network, dinitz, edmonds_karp, shortest_augmenting_path -from ...classes.graph import Graph -from .utils import build_auxiliary_edge_connectivity, build_auxiliary_node_connectivity - -default_flow_func = ... - -__all__ = [ - "average_node_connectivity", - "local_node_connectivity", - "node_connectivity", - "local_edge_connectivity", - "edge_connectivity", - "all_pairs_node_connectivity", -] - -def local_node_connectivity(G: Graph, s, t, flow_func=None, auxiliary=None, residual=None, cutoff=None): ... -def node_connectivity(G: Graph, s=None, t=None, flow_func=None): ... -def average_node_connectivity(G: Graph, flow_func=None) -> float: ... -def all_pairs_node_connectivity(G: Graph, nbunch=None, flow_func=None) -> Mapping: ... -def local_edge_connectivity(G: Graph, s, t, flow_func=None, auxiliary=None, residual=None, cutoff=None): ... -def edge_connectivity(G: Graph, s=None, t=None, flow_func=None, cutoff=None): ... diff --git a/stubs/networkx/algorithms/connectivity/cuts.pyi b/stubs/networkx/algorithms/connectivity/cuts.pyi deleted file mode 100644 index 1bf3dde7..00000000 --- a/stubs/networkx/algorithms/connectivity/cuts.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import itertools - -# Define the default maximum flow function to use in all flow based -# cut algorithms. -from ...algorithms.flow import build_residual_network, edmonds_karp -from ...classes.graph import Graph -from .utils import build_auxiliary_edge_connectivity, build_auxiliary_node_connectivity - -default_flow_func = ... - -__all__ = [ - "minimum_st_node_cut", - "minimum_node_cut", - "minimum_st_edge_cut", - "minimum_edge_cut", -] - -def minimum_st_edge_cut(G: Graph, s, t, flow_func=None, auxiliary=None, residual=None) -> set: ... -def minimum_st_node_cut(G: Graph, s, t, flow_func=None, auxiliary=None, residual=None) -> set: ... -def minimum_node_cut(G: Graph, s=None, t=None, flow_func=None) -> set: ... -def minimum_edge_cut(G: Graph, s=None, t=None, flow_func=None) -> set: ... diff --git a/stubs/networkx/algorithms/connectivity/disjoint_paths.pyi b/stubs/networkx/algorithms/connectivity/disjoint_paths.pyi deleted file mode 100644 index e51a3ce6..00000000 --- a/stubs/networkx/algorithms/connectivity/disjoint_paths.pyi +++ /dev/null @@ -1,33 +0,0 @@ -# Define the default maximum flow function to use for the undelying -# maximum flow computations -from itertools import filterfalse as _filterfalse - -from ...algorithms.flow import edmonds_karp, preflow_push, shortest_augmenting_path -from ...classes.graph import Graph -from ...exception import NetworkXNoPath - -# Functions to build auxiliary data structures. -from .utils import build_auxiliary_edge_connectivity, build_auxiliary_node_connectivity - -default_flow_func = ... - -__all__ = ["edge_disjoint_paths", "node_disjoint_paths"] - -def edge_disjoint_paths( - G: Graph, - s, - t, - flow_func=None, - cutoff: int | None = None, - auxiliary=None, - residual=None, -): ... -def node_disjoint_paths( - G: Graph, - s, - t, - flow_func=None, - cutoff: int | None = None, - auxiliary=None, - residual=None, -): ... diff --git a/stubs/networkx/algorithms/connectivity/edge_augmentation.pyi b/stubs/networkx/algorithms/connectivity/edge_augmentation.pyi deleted file mode 100644 index a635a33a..00000000 --- a/stubs/networkx/algorithms/connectivity/edge_augmentation.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import itertools as it -import math -from collections import defaultdict, namedtuple - -from ...classes.graph import Graph -from ...utils import not_implemented_for, py_random_state - -__all__ = ["k_edge_augmentation", "is_k_edge_connected", "is_locally_k_edge_connected"] - -def is_k_edge_connected(G: Graph, k) -> bool: ... -def is_locally_k_edge_connected(G: Graph, s, t, k) -> bool: ... -def k_edge_augmentation(G: Graph, k, avail=None, weight: str | None = None, partial: bool = False): ... -def partial_k_edge_augmentation(G: Graph, k, avail, weight: str | None = None): ... -def one_edge_augmentation(G: Graph, avail=None, weight: str | None = None, partial: bool = False): ... -def bridge_augmentation(G: Graph, avail=None, weight: str | None = None): ... - -# --- Algorithms and Helpers --- - -MetaEdge = ... - -def unconstrained_one_edge_augmentation(G: Graph): ... -def weighted_one_edge_augmentation(G: Graph, avail, weight: str | None = None, partial: bool = False): ... -def unconstrained_bridge_augmentation(G: Graph): ... -def weighted_bridge_augmentation(G: Graph, avail, weight: str | None = None): ... -def collapse(G: Graph, grouped_nodes): ... -def complement_edges(G: Graph): ... -@py_random_state(4) -def greedy_k_edge_augmentation(G: Graph, k, avail=None, weight: str | None = None, seed=None): ... diff --git a/stubs/networkx/algorithms/connectivity/edge_kcomponents.pyi b/stubs/networkx/algorithms/connectivity/edge_kcomponents.pyi deleted file mode 100644 index 76b85319..00000000 --- a/stubs/networkx/algorithms/connectivity/edge_kcomponents.pyi +++ /dev/null @@ -1,25 +0,0 @@ -import itertools as it -from functools import partial - -from ...algorithms import bridges -from ...classes.graph import Graph -from ...utils import arbitrary_element, not_implemented_for - -__all__ = [ - "k_edge_components", - "k_edge_subgraphs", - "bridge_components", - "EdgeComponentAuxGraph", -] - -def k_edge_components(G: Graph, k): ... -def k_edge_subgraphs(G: Graph, k): ... -def bridge_components(G: Graph): ... - -class EdgeComponentAuxGraph: - @classmethod - def construct(cls, G: Graph): ... - def k_edge_components(self, k): ... - def k_edge_subgraphs(self, k): ... - -def general_k_edge_subgraphs(G: Graph, k): ... diff --git a/stubs/networkx/algorithms/connectivity/kcomponents.pyi b/stubs/networkx/algorithms/connectivity/kcomponents.pyi deleted file mode 100644 index 01751f99..00000000 --- a/stubs/networkx/algorithms/connectivity/kcomponents.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping -from itertools import combinations -from operator import itemgetter - -# Define the default maximum flow function. -from ...algorithms.flow import edmonds_karp -from ...classes.graph import Graph -from ...utils import not_implemented_for - -default_flow_func = ... - -__all__ = ["k_components"] - -def k_components(G: Graph, flow_func=None) -> Mapping: ... -def build_k_number_dict(kcomps): ... diff --git a/stubs/networkx/algorithms/connectivity/kcutsets.pyi b/stubs/networkx/algorithms/connectivity/kcutsets.pyi deleted file mode 100644 index b44fb207..00000000 --- a/stubs/networkx/algorithms/connectivity/kcutsets.pyi +++ /dev/null @@ -1,14 +0,0 @@ -import copy -from collections import defaultdict -from itertools import combinations -from operator import itemgetter - -from ...algorithms.flow import build_residual_network, edmonds_karp, shortest_augmenting_path -from ...classes.graph import Graph -from .utils import build_auxiliary_node_connectivity - -default_flow_func = ... - -__all__ = ["all_node_cuts"] - -def all_node_cuts(G: Graph, k=None, flow_func=None): ... diff --git a/stubs/networkx/algorithms/connectivity/stoerwagner.pyi b/stubs/networkx/algorithms/connectivity/stoerwagner.pyi deleted file mode 100644 index 36eef474..00000000 --- a/stubs/networkx/algorithms/connectivity/stoerwagner.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from itertools import islice - -from ...classes.graph import Graph -from ...utils import BinaryHeap, arbitrary_element, not_implemented_for - -__all__ = ["stoer_wagner"] - -def stoer_wagner(G: Graph, weight: str = "weight", heap=...): ... diff --git a/stubs/networkx/algorithms/connectivity/utils.pyi b/stubs/networkx/algorithms/connectivity/utils.pyi deleted file mode 100644 index cc69d6c6..00000000 --- a/stubs/networkx/algorithms/connectivity/utils.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["build_auxiliary_node_connectivity", "build_auxiliary_edge_connectivity"] - -def build_auxiliary_node_connectivity(G: Graph): ... -def build_auxiliary_edge_connectivity(G: Graph): ... diff --git a/stubs/networkx/algorithms/core.pyi b/stubs/networkx/algorithms/core.pyi deleted file mode 100644 index dba7cfc7..00000000 --- a/stubs/networkx/algorithms/core.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from collections.abc import Mapping - -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..utils import not_implemented_for - -__all__ = [ - "core_number", - "find_cores", - "k_core", - "k_shell", - "k_crust", - "k_corona", - "k_truss", - "onion_layers", -] - -def core_number(G: Graph) -> Mapping: ... -def find_cores(G: Graph): ... -def k_core(G: Graph, k: int | None = None, core_number: Mapping | None = None): ... -def k_shell(G: Graph, k: int | None = None, core_number: Mapping | None = None): ... -def k_crust(G: Graph, k: int | None = None, core_number: Mapping | None = None): ... -def k_corona(G: Graph, k: int, core_number: Mapping | None = None): ... -def k_truss(G: Graph, k: int): ... -def onion_layers(G: Graph) -> Mapping: ... diff --git a/stubs/networkx/algorithms/covering.pyi b/stubs/networkx/algorithms/covering.pyi deleted file mode 100644 index b72c02f1..00000000 --- a/stubs/networkx/algorithms/covering.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from functools import partial -from itertools import chain - -from ..classes.graph import Graph -from ..utils import arbitrary_element, not_implemented_for - -__all__ = ["min_edge_cover", "is_edge_cover"] - -def min_edge_cover(G: Graph, matching_algorithm=None) -> set: ... -def is_edge_cover(G: Graph, cover: set) -> bool: ... diff --git a/stubs/networkx/algorithms/cuts.pyi b/stubs/networkx/algorithms/cuts.pyi deleted file mode 100644 index 7e4951a4..00000000 --- a/stubs/networkx/algorithms/cuts.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Any - -from ..classes.graph import Graph - -__all__ = [ - "boundary_expansion", - "conductance", - "cut_size", - "edge_expansion", - "mixing_expansion", - "node_expansion", - "normalized_cut_size", - "volume", -] - -def cut_size(G: Graph, S, T=None, weight: Any = None): ... -def volume(G: Graph, S, weight: Any = None): ... -def normalized_cut_size(G: Graph, S, T=None, weight: Any = None): ... -def conductance(G: Graph, S, T=None, weight: Any = None): ... -def edge_expansion(G: Graph, S, T=None, weight: Any = None): ... -def mixing_expansion(G: Graph, S, T=None, weight: Any = None): ... -def node_expansion(G: Graph, S): ... -def boundary_expansion(G: Graph, S): ... diff --git a/stubs/networkx/algorithms/cycles.pyi b/stubs/networkx/algorithms/cycles.pyi deleted file mode 100644 index f663de73..00000000 --- a/stubs/networkx/algorithms/cycles.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from collections import defaultdict - -from ..classes.graph import Graph -from ..utils import not_implemented_for, pairwise - -__all__ = [ - "cycle_basis", - "simple_cycles", - "recursive_simple_cycles", - "find_cycle", - "minimum_cycle_basis", -] - -def cycle_basis(G: Graph, root=None): ... -def simple_cycles(G: Graph): ... -def recursive_simple_cycles(G: Graph): ... -def find_cycle(G: Graph, source=None, orientation=None): ... -def minimum_cycle_basis(G: Graph, weight: str | None = None): ... diff --git a/stubs/networkx/algorithms/d_separation.pyi b/stubs/networkx/algorithms/d_separation.pyi deleted file mode 100644 index c9b7a774..00000000 --- a/stubs/networkx/algorithms/d_separation.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections import deque - -from ..classes.graph import Graph -from ..utils import UnionFind, not_implemented_for - -__all__ = ["d_separated"] - -def d_separated(G: Graph, x: set, y: set, z: set) -> bool: ... diff --git a/stubs/networkx/algorithms/dag.pyi b/stubs/networkx/algorithms/dag.pyi deleted file mode 100644 index fac38ead..00000000 --- a/stubs/networkx/algorithms/dag.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import heapq -from collections import deque -from functools import partial -from itertools import chain, product, starmap -from math import gcd - -from numpy.typing import ArrayLike - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..utils import arbitrary_element, not_implemented_for, pairwise - -__all__ = [ - "descendants", - "ancestors", - "topological_sort", - "lexicographical_topological_sort", - "all_topological_sorts", - "topological_generations", - "is_directed_acyclic_graph", - "is_aperiodic", - "transitive_closure", - "transitive_closure_dag", - "transitive_reduction", - "antichains", - "dag_longest_path", - "dag_longest_path_length", - "dag_to_branching", -] - -chaini = ... - -def descendants(G: Graph, source): ... -def ancestors(G: Graph, source): ... -def has_cycle(G: Graph): ... -def is_directed_acyclic_graph(G: Graph) -> bool: ... -def topological_generations(G: Graph): ... -def topological_sort(G: Graph): ... -def lexicographical_topological_sort(G: Graph, key=None): ... -def all_topological_sorts(G: Graph): ... -def is_aperiodic(G: Graph) -> bool: ... -def transitive_closure(G: Graph, reflexive=False): ... -def transitive_closure_dag(G: Graph, topo_order: ArrayLike | tuple | None = None): ... -def transitive_reduction(G: Graph): ... -def antichains(G: Graph, topo_order: ArrayLike | tuple | None = None): ... -def dag_longest_path( - G: Graph, - weight: str = "weight", - default_weight: int = 1, - topo_order: ArrayLike | tuple | None = None, -) -> ArrayLike: ... -def dag_longest_path_length(G: Graph, weight: str = "weight", default_weight: int = 1) -> int: ... -def root_to_leaf_paths(G: Graph): ... -def dag_to_branching(G: Graph) -> DiGraph: ... diff --git a/stubs/networkx/algorithms/distance_measures.pyi b/stubs/networkx/algorithms/distance_measures.pyi deleted file mode 100644 index f33fe690..00000000 --- a/stubs/networkx/algorithms/distance_measures.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = [ - "extrema_bounding", - "eccentricity", - "diameter", - "radius", - "periphery", - "center", - "barycenter", - "resistance_distance", -] - -def extrema_bounding(G: Graph, compute="diameter"): ... -def eccentricity(G: Graph, v=None, sp=None) -> Mapping: ... -def diameter(G: Graph, e=None, usebounds=False): ... -def periphery(G: Graph, e=None, usebounds=False) -> ArrayLike: ... -def radius(G: Graph, e=None, usebounds=False): ... -def center(G: Graph, e=None, usebounds=False) -> ArrayLike: ... -def barycenter(G: Graph, weight=None, attr=None, sp=None) -> ArrayLike: ... -def resistance_distance(G: Graph, nodeA, nodeB, weight=None, invert_weight=True) -> float: ... diff --git a/stubs/networkx/algorithms/distance_regular.pyi b/stubs/networkx/algorithms/distance_regular.pyi deleted file mode 100644 index 6e0d25c0..00000000 --- a/stubs/networkx/algorithms/distance_regular.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Iterable - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = [ - "is_distance_regular", - "is_strongly_regular", - "intersection_array", - "global_parameters", -] - -def is_distance_regular(G: Graph) -> bool: ... -def global_parameters(b: ArrayLike, c: ArrayLike) -> Iterable: ... -def intersection_array(G: Graph): ... -def is_strongly_regular(G: Graph) -> bool: ... diff --git a/stubs/networkx/algorithms/dominance.pyi b/stubs/networkx/algorithms/dominance.pyi deleted file mode 100644 index 4be6cb49..00000000 --- a/stubs/networkx/algorithms/dominance.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from functools import reduce - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["immediate_dominators", "dominance_frontiers"] - -def immediate_dominators(G: Graph, start): ... -def dominance_frontiers(G: Graph, start): ... diff --git a/stubs/networkx/algorithms/dominating.pyi b/stubs/networkx/algorithms/dominating.pyi deleted file mode 100644 index d47abb00..00000000 --- a/stubs/networkx/algorithms/dominating.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Iterable -from itertools import chain - -from ..classes.graph import Graph -from ..utils import arbitrary_element - -__all__ = ["dominating_set", "is_dominating_set"] - -def dominating_set(G: Graph, start_with=None) -> set: ... -def is_dominating_set(G: Graph, nbunch: Iterable): ... diff --git a/stubs/networkx/algorithms/efficiency_measures.pyi b/stubs/networkx/algorithms/efficiency_measures.pyi deleted file mode 100644 index df808234..00000000 --- a/stubs/networkx/algorithms/efficiency_measures.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from ..classes.graph import Graph -from ..exception import NetworkXNoPath -from ..utils import not_implemented_for - -__all__ = ["efficiency", "local_efficiency", "global_efficiency"] - -def efficiency(G: Graph, u, v) -> float: ... -def global_efficiency(G: Graph) -> float: ... -def local_efficiency(G: Graph) -> float: ... diff --git a/stubs/networkx/algorithms/euler.pyi b/stubs/networkx/algorithms/euler.pyi deleted file mode 100644 index cbc9f83c..00000000 --- a/stubs/networkx/algorithms/euler.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from itertools import combinations - -from ..classes.graph import Graph -from ..utils import arbitrary_element, not_implemented_for - -__all__ = [ - "is_eulerian", - "eulerian_circuit", - "eulerize", - "is_semieulerian", - "has_eulerian_path", - "eulerian_path", -] - -def is_eulerian(G: Graph): ... -def is_semieulerian(G: Graph): ... -def eulerian_circuit(G: Graph, source=None, keys: bool = False): ... -def has_eulerian_path(G: Graph, source=None): ... -def eulerian_path(G: Graph, source=None, keys=False): ... -def eulerize(G: Graph): ... diff --git a/stubs/networkx/algorithms/flow/__init__.pyi b/stubs/networkx/algorithms/flow/__init__.pyi deleted file mode 100644 index 405884a8..00000000 --- a/stubs/networkx/algorithms/flow/__init__.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from .boykovkolmogorov import boykov_kolmogorov as boykov_kolmogorov -from .capacityscaling import capacity_scaling as capacity_scaling -from .dinitz_alg import dinitz as dinitz -from .edmondskarp import edmonds_karp as edmonds_karp -from .gomory_hu import gomory_hu_tree as gomory_hu_tree -from .maxflow import ( - maximum_flow as maximum_flow, - maximum_flow_value as maximum_flow_value, - minimum_cut as minimum_cut, - minimum_cut_value as minimum_cut_value, -) -from .mincost import ( - cost_of_flow as cost_of_flow, - max_flow_min_cost as max_flow_min_cost, - min_cost_flow as min_cost_flow, - min_cost_flow_cost as min_cost_flow_cost, -) -from .networksimplex import network_simplex as network_simplex -from .preflowpush import preflow_push as preflow_push -from .shortestaugmentingpath import shortest_augmenting_path as shortest_augmenting_path -from .utils import build_flow_dict as build_flow_dict, build_residual_network as build_residual_network diff --git a/stubs/networkx/algorithms/flow/boykovkolmogorov.pyi b/stubs/networkx/algorithms/flow/boykovkolmogorov.pyi deleted file mode 100644 index dd77229f..00000000 --- a/stubs/networkx/algorithms/flow/boykovkolmogorov.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from collections import deque -from operator import itemgetter - -from ...algorithms.flow.utils import build_residual_network -from ...classes.graph import Graph - -__all__ = ["boykov_kolmogorov"] - -def boykov_kolmogorov( - G: Graph, - s, - t, - capacity: str = "capacity", - residual=None, - value_only: bool = False, - cutoff=None, -): ... -def boykov_kolmogorov_impl(G: Graph, s, t, capacity, residual, cutoff): ... diff --git a/stubs/networkx/algorithms/flow/capacityscaling.pyi b/stubs/networkx/algorithms/flow/capacityscaling.pyi deleted file mode 100644 index 46a4ac90..00000000 --- a/stubs/networkx/algorithms/flow/capacityscaling.pyi +++ /dev/null @@ -1,15 +0,0 @@ -__all__ = ["capacity_scaling"] - -from itertools import chain -from math import log - -from ...classes.graph import Graph -from ...utils import BinaryHeap, arbitrary_element, not_implemented_for - -def capacity_scaling( - G: Graph, - demand: str = "demand", - capacity: str = "capacity", - weight: str = "weight", - heap=..., -): ... diff --git a/stubs/networkx/algorithms/flow/dinitz_alg.pyi b/stubs/networkx/algorithms/flow/dinitz_alg.pyi deleted file mode 100644 index 5e347158..00000000 --- a/stubs/networkx/algorithms/flow/dinitz_alg.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from collections import deque - -from ...algorithms.flow.utils import build_residual_network -from ...classes.graph import Graph -from ...utils import pairwise - -__all__ = ["dinitz"] - -def dinitz( - G: Graph, - s, - t, - capacity: str = "capacity", - residual=None, - value_only: bool = False, - cutoff=None, -): ... -def dinitz_impl(G: Graph, s, t, capacity, residual, cutoff): ... diff --git a/stubs/networkx/algorithms/flow/edmondskarp.pyi b/stubs/networkx/algorithms/flow/edmondskarp.pyi deleted file mode 100644 index 43e424b8..00000000 --- a/stubs/networkx/algorithms/flow/edmondskarp.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from ...algorithms.flow.utils import build_residual_network -from ...classes.graph import Graph - -__all__ = ["edmonds_karp"] - -def edmonds_karp_core(R, s, t, cutoff): ... -def edmonds_karp_impl(G: Graph, s, t, capacity, residual, cutoff): ... -def edmonds_karp( - G: Graph, - s, - t, - capacity: str = "capacity", - residual=None, - value_only: bool = False, - cutoff=None, -): ... diff --git a/stubs/networkx/algorithms/flow/gomory_hu.pyi b/stubs/networkx/algorithms/flow/gomory_hu.pyi deleted file mode 100644 index 6527385a..00000000 --- a/stubs/networkx/algorithms/flow/gomory_hu.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from ...classes.graph import Graph -from ...utils import not_implemented_for -from .edmondskarp import edmonds_karp -from .utils import build_residual_network - -default_flow_func = ... - -__all__ = ["gomory_hu_tree"] - -def gomory_hu_tree(G: Graph, capacity: str = "capacity", flow_func=None): ... diff --git a/stubs/networkx/algorithms/flow/maxflow.pyi b/stubs/networkx/algorithms/flow/maxflow.pyi deleted file mode 100644 index 7fd0e379..00000000 --- a/stubs/networkx/algorithms/flow/maxflow.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from ...classes.graph import Graph -from .boykovkolmogorov import boykov_kolmogorov -from .dinitz_alg import dinitz -from .edmondskarp import edmonds_karp -from .preflowpush import preflow_push -from .shortestaugmentingpath import shortest_augmenting_path -from .utils import build_flow_dict - -# Define the default flow function for computing maximum flow. -default_flow_func = ... -# Functions that don't support cutoff for minimum cut computations. -flow_funcs: list = ... - -__all__ = ["maximum_flow", "maximum_flow_value", "minimum_cut", "minimum_cut_value"] - -def maximum_flow(flowG: Graph, _s, _t, capacity: str = "capacity", flow_func=None, **kwargs): ... -def maximum_flow_value(flowG: Graph, _s, _t, capacity: str = "capacity", flow_func=None, **kwargs): ... -def minimum_cut(flowG: Graph, _s, _t, capacity: str = "capacity", flow_func=None, **kwargs): ... -def minimum_cut_value(flowG: Graph, _s, _t, capacity: str = "capacity", flow_func=None, **kwargs): ... diff --git a/stubs/networkx/algorithms/flow/mincost.pyi b/stubs/networkx/algorithms/flow/mincost.pyi deleted file mode 100644 index 87453fa6..00000000 --- a/stubs/networkx/algorithms/flow/mincost.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["min_cost_flow_cost", "min_cost_flow", "cost_of_flow", "max_flow_min_cost"] - -def min_cost_flow_cost(G: Graph, demand: str = "demand", capacity: str = "capacity", weight: str = "weight"): ... -def min_cost_flow(G: Graph, demand: str = "demand", capacity: str = "capacity", weight: str = "weight") -> Mapping: ... -def cost_of_flow(G: Graph, flowDict: Mapping, weight: str = "weight"): ... -def max_flow_min_cost(G: Graph, s, t, capacity: str = "capacity", weight: str = "weight") -> Mapping: ... diff --git a/stubs/networkx/algorithms/flow/networksimplex.pyi b/stubs/networkx/algorithms/flow/networksimplex.pyi deleted file mode 100644 index 09c55f43..00000000 --- a/stubs/networkx/algorithms/flow/networksimplex.pyi +++ /dev/null @@ -1,33 +0,0 @@ -__all__ = ["network_simplex"] - -from itertools import chain, islice, repeat -from math import ceil, sqrt - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -class _DataEssentialsAndFunctions: - def __init__( - self, - G: Graph, - multigraph, - demand="demand", - capacity="capacity", - weight="weight", - ): ... - def initialize_spanning_tree(self, n, faux_inf): ... - def find_apex(self, p, q): ... - def trace_path(self, p, w): ... - def find_cycle(self, i, p, q): ... - def augment_flow(self, Wn, We, f): ... - def trace_subtree(self, p): ... - def remove_edge(self, s, t): ... - def make_root(self, q): ... - def add_edge(self, i, p, q): ... - def update_potentials(self, i, p, q): ... - def reduced_cost(self, i): ... - def find_entering_edges(self): ... - def residual_capacity(self, i, p): ... - def find_leaving_edge(self, Wn, We): ... - -def network_simplex(G: Graph, demand: str = "demand", capacity: str = "capacity", weight: str = "weight"): ... diff --git a/stubs/networkx/algorithms/flow/preflowpush.pyi b/stubs/networkx/algorithms/flow/preflowpush.pyi deleted file mode 100644 index 5e1844e8..00000000 --- a/stubs/networkx/algorithms/flow/preflowpush.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from collections import deque -from itertools import islice - -from ...classes.graph import Graph -from ...utils import arbitrary_element -from .utils import CurrentEdge, GlobalRelabelThreshold, Level, build_residual_network, detect_unboundedness - -__all__ = ["preflow_push"] - -def preflow_push_impl(G: Graph, s, t, capacity, residual, global_relabel_freq, value_only): ... -def preflow_push( - G: Graph, - s, - t, - capacity: str = "capacity", - residual=None, - global_relabel_freq=1, - value_only: bool = False, -): ... diff --git a/stubs/networkx/algorithms/flow/shortestaugmentingpath.pyi b/stubs/networkx/algorithms/flow/shortestaugmentingpath.pyi deleted file mode 100644 index abf9da7f..00000000 --- a/stubs/networkx/algorithms/flow/shortestaugmentingpath.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from collections import deque - -from ...classes.graph import Graph -from .edmondskarp import edmonds_karp_core -from .utils import CurrentEdge, build_residual_network - -__all__ = ["shortest_augmenting_path"] - -def shortest_augmenting_path_impl(G: Graph, s, t, capacity, residual, two_phase, cutoff): ... -def shortest_augmenting_path( - G: Graph, - s, - t, - capacity: str = "capacity", - residual=None, - value_only: bool = False, - two_phase: bool = False, - cutoff=None, -): ... diff --git a/stubs/networkx/algorithms/flow/utils.pyi b/stubs/networkx/algorithms/flow/utils.pyi deleted file mode 100644 index 5a94581c..00000000 --- a/stubs/networkx/algorithms/flow/utils.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from collections import deque - -from ...classes.graph import Graph - -__all__ = [ - "CurrentEdge", - "Level", - "GlobalRelabelThreshold", - "build_residual_network", - "detect_unboundedness", - "build_flow_dict", -] - -class CurrentEdge: - __slots__ = ... - - def __init__(self, edges): ... - def get(self): ... - def move_to_next(self): ... - def _rewind(self): ... - -class Level: - __slots__ = ... - - def __init__(self): ... - -class GlobalRelabelThreshold: - def __init__(self, n, m, freq): ... - def add_work(self, work): ... - def is_reached(self): ... - def clear_work(self): ... - -def build_residual_network(G: Graph, capacity): ... -def detect_unboundedness(R, s, t): ... -def build_flow_dict(G: Graph, R): ... diff --git a/stubs/networkx/algorithms/graph_hashing.pyi b/stubs/networkx/algorithms/graph_hashing.pyi deleted file mode 100644 index 7777170c..00000000 --- a/stubs/networkx/algorithms/graph_hashing.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections import Counter, defaultdict -from collections.abc import Mapping -from hashlib import blake2b - -from ..classes.graph import Graph - -__all__ = ["weisfeiler_lehman_graph_hash", "weisfeiler_lehman_subgraph_hashes"] - -def weisfeiler_lehman_graph_hash( - G: Graph, - edge_attr: str | None = None, - node_attr: str | None = None, - iterations: int = 3, - digest_size: int = 16, -) -> str: ... -def weisfeiler_lehman_subgraph_hashes( - G: Graph, - edge_attr: str | None = None, - node_attr: str | None = None, - iterations: int = 3, - digest_size: int = 16, -) -> Mapping: ... diff --git a/stubs/networkx/algorithms/graphical.pyi b/stubs/networkx/algorithms/graphical.pyi deleted file mode 100644 index a9a3e2be..00000000 --- a/stubs/networkx/algorithms/graphical.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import heapq - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = [ - "is_graphical", - "is_multigraphical", - "is_pseudographical", - "is_digraphical", - "is_valid_degree_sequence_erdos_gallai", - "is_valid_degree_sequence_havel_hakimi", -] - -def is_graphical(sequence, method="eg") -> bool: ... -def is_valid_degree_sequence_havel_hakimi(deg_sequence: ArrayLike) -> bool: ... -def is_valid_degree_sequence_erdos_gallai(deg_sequence: ArrayLike) -> bool: ... -def is_multigraphical(sequence: ArrayLike) -> bool: ... -def is_pseudographical(sequence) -> bool: ... -def is_digraphical(in_sequence, out_sequence) -> bool: ... diff --git a/stubs/networkx/algorithms/hierarchy.pyi b/stubs/networkx/algorithms/hierarchy.pyi deleted file mode 100644 index 57824cd9..00000000 --- a/stubs/networkx/algorithms/hierarchy.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ..classes.digraph import DiGraph -from ..classes.multidigraph import MultiDiGraph - -__all__ = ["flow_hierarchy"] - -def flow_hierarchy(G: DiGraph | MultiDiGraph, weight=None) -> float: ... diff --git a/stubs/networkx/algorithms/hybrid.pyi b/stubs/networkx/algorithms/hybrid.pyi deleted file mode 100644 index efb95950..00000000 --- a/stubs/networkx/algorithms/hybrid.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import copy - -from ..classes.graph import Graph - -__all__ = ["kl_connected_subgraph", "is_kl_connected"] - -def kl_connected_subgraph(G: Graph, k, l, low_memory: bool = False, same_as_graph: bool = False): ... -def is_kl_connected(G: Graph, k, l, low_memory: bool = False) -> bool: ... diff --git a/stubs/networkx/algorithms/isolate.pyi b/stubs/networkx/algorithms/isolate.pyi deleted file mode 100644 index 60db475a..00000000 --- a/stubs/networkx/algorithms/isolate.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes.graph import Graph - -__all__ = ["is_isolate", "isolates", "number_of_isolates"] - -def is_isolate(G: Graph, n) -> bool: ... -def isolates(G: Graph): ... -def number_of_isolates(G: Graph) -> int: ... diff --git a/stubs/networkx/algorithms/isomorphism/__init__.pyi b/stubs/networkx/algorithms/isomorphism/__init__.pyi deleted file mode 100644 index 83ccfe41..00000000 --- a/stubs/networkx/algorithms/isomorphism/__init__.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from .ismags import ISMAGS as ISMAGS -from .isomorph import ( - could_be_isomorphic as could_be_isomorphic, - fast_could_be_isomorphic as fast_could_be_isomorphic, - faster_could_be_isomorphic as faster_could_be_isomorphic, - is_isomorphic as is_isomorphic, -) -from .matchhelpers import ( - categorical_edge_match as categorical_edge_match, - categorical_multiedge_match as categorical_multiedge_match, - categorical_node_match as categorical_node_match, - generic_edge_match as generic_edge_match, - generic_multiedge_match as generic_multiedge_match, - generic_node_match as generic_node_match, - numerical_edge_match as numerical_edge_match, - numerical_multiedge_match as numerical_multiedge_match, - numerical_node_match as numerical_node_match, -) -from .temporalisomorphvf2 import ( - TimeRespectingDiGraphMatcher as TimeRespectingDiGraphMatcher, - TimeRespectingGraphMatcher as TimeRespectingGraphMatcher, -) -from .tree_isomorphism import rooted_tree_isomorphism as rooted_tree_isomorphism, tree_isomorphism as tree_isomorphism -from .vf2userfunc import ( - DiGraphMatcher as DiGraphMatcher, - GraphMatcher as GraphMatcher, - MultiDiGraphMatcher as MultiDiGraphMatcher, - MultiGraphMatcher as MultiGraphMatcher, -) diff --git a/stubs/networkx/algorithms/isomorphism/ismags.pyi b/stubs/networkx/algorithms/isomorphism/ismags.pyi deleted file mode 100644 index af69cdac..00000000 --- a/stubs/networkx/algorithms/isomorphism/ismags.pyi +++ /dev/null @@ -1,95 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["ISMAGS"] - -import itertools -from collections import Counter, defaultdict -from functools import reduce, wraps - -def are_all_equal(iterable) -> bool: ... -def make_partitions(items, test): ... -def partition_to_color(partitions) -> Mapping: ... -def intersect(collection_of_sets) -> set: ... - -class ISMAGS: - def __init__( - self, - graph: Graph, - subgraph: Graph, - node_match=None, - edge_match=None, - cache=None, - ): ... - @property - def _sgn_partitions(self): ... - @property - def _sge_partitions(self): ... - @property - def _gn_partitions(self): ... - @property - def _ge_partitions(self): ... - @property - def _sgn_colors(self): ... - @property - def _sge_colors(self): ... - @property - def _gn_colors(self): ... - @property - def _ge_colors(self): ... - @property - def _node_compatibility(self): ... - @property - def _edge_compatibility(self): ... - @staticmethod - def _node_match_maker(cmp): ... - @staticmethod - def _edge_match_maker(cmp): ... - def find_isomorphisms(self, symmetry: bool = True): ... - @staticmethod - def _find_neighbor_color_count(graph, node, node_color, edge_color): ... - def _get_lookahead_candidates(self): ... - def largest_common_subgraph(self, symmetry: bool = True): ... - def analyze_symmetry(self, graph: Graph, node_partitions, edge_colors): ... - def is_isomorphic(self, symmetry=False) -> bool: ... - def subgraph_is_isomorphic(self, symmetry=False) -> bool: ... - def isomorphisms_iter(self, symmetry=True): ... - def subgraph_isomorphisms_iter(self, symmetry=True): ... - def _find_nodecolor_candidates(self): ... - @staticmethod - def _make_constraints(cosets): ... - @staticmethod - def _find_node_edge_color(graph, node_colors, edge_colors): ... - @staticmethod - def _get_permutations_by_length(items): ... - @classmethod - def _refine_node_partitions(cls, graph, node_partitions, edge_colors, branch=False): ... - def _edges_of_same_color(self, sgn1, sgn2): ... - def _map_nodes(self, sgn, candidates, constraints, mapping=None, to_be_mapped=None): ... - def _largest_common_subgraph(self, candidates, constraints, to_be_mapped=None): ... - @staticmethod - def _remove_node(node, nodes, constraints): ... - @staticmethod - def _find_permutations(top_partitions, bottom_partitions): ... - @staticmethod - def _update_orbits(orbits, permutations): ... - def _couple_nodes( - self, - top_partitions, - bottom_partitions, - pair_idx, - t_node, - b_node, - graph, - edge_colors, - ): ... - def _process_ordered_pair_partitions( - self, - graph, - top_partitions, - bottom_partitions, - edge_colors, - orbits=None, - cosets=None, - ): ... diff --git a/stubs/networkx/algorithms/isomorphism/isomorph.pyi b/stubs/networkx/algorithms/isomorphism/isomorph.pyi deleted file mode 100644 index b4f51af3..00000000 --- a/stubs/networkx/algorithms/isomorphism/isomorph.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from typing import Callable - -from ...classes.graph import Graph -from ...exception import NetworkXError - -__all__ = [ - "could_be_isomorphic", - "fast_could_be_isomorphic", - "faster_could_be_isomorphic", - "is_isomorphic", -] - -def could_be_isomorphic(G1: Graph, G2: Graph): ... - -graph_could_be_isomorphic = ... - -def fast_could_be_isomorphic(G1: Graph, G2: Graph): ... - -fast_graph_could_be_isomorphic = ... - -def faster_could_be_isomorphic(G1: Graph, G2: Graph): ... - -faster_graph_could_be_isomorphic = ... - -def is_isomorphic( - G1: Graph, - G2: Graph, - node_match: Callable | None = None, - edge_match: Callable | None = None, -): ... diff --git a/stubs/networkx/algorithms/isomorphism/isomorphvf2.pyi b/stubs/networkx/algorithms/isomorphism/isomorphvf2.pyi deleted file mode 100644 index d6e8752a..00000000 --- a/stubs/networkx/algorithms/isomorphism/isomorphvf2.pyi +++ /dev/null @@ -1,45 +0,0 @@ -# This work was originally coded by Christopher Ellison -# as part of the Computational Mechanics Python (CMPy) project. -# James P. Crutchfield, principal investigator. -# Complexity Sciences Center and Physics Department, UC Davis. - -import sys - -from ...classes.graph import Graph - -__all__ = ["GraphMatcher", "DiGraphMatcher"] - -class GraphMatcher: - def __init__(self, G1: Graph, G2: Graph): ... - def reset_recursion_limit(self): ... - def candidate_pairs_iter(self): ... - def initialize(self): ... - def is_isomorphic(self): ... - def isomorphisms_iter(self): ... - def match(self): ... - def semantic_feasibility(self, G1_node, G2_node): ... - def subgraph_is_isomorphic(self): ... - def subgraph_is_monomorphic(self): ... - - # subgraph_is_isomorphic.__doc__ += "\n" + subgraph.replace('\n','\n'+indent) - - def subgraph_isomorphisms_iter(self): ... - def subgraph_monomorphisms_iter(self): ... - - # subgraph_isomorphisms_iter.__doc__ += "\n" + subgraph.replace('\n','\n'+indent) - - def syntactic_feasibility(self, G1_node, G2_node): ... - -class DiGraphMatcher(GraphMatcher): - def __init__(self, G1: Graph, G2: Graph): ... - def candidate_pairs_iter(self): ... - def initialize(self): ... - def syntactic_feasibility(self, G1_node, G2_node): ... - -class GMState: - def __init__(self, GM, G1_node=None, G2_node=None): ... - def restore(self): ... - -class DiGMState: - def __init__(self, GM, G1_node=None, G2_node=None): ... - def restore(self): ... diff --git a/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi b/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi deleted file mode 100644 index 5a2cbe08..00000000 --- a/stubs/networkx/algorithms/isomorphism/matchhelpers.pyi +++ /dev/null @@ -1,63 +0,0 @@ -import math -import types -from itertools import permutations -from typing import Callable - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = [ - "categorical_node_match", - "categorical_edge_match", - "categorical_multiedge_match", - "numerical_node_match", - "numerical_edge_match", - "numerical_multiedge_match", - "generic_node_match", - "generic_edge_match", - "generic_multiedge_match", -] - -def copyfunc(f, name=None): ... -def allclose(x, y, rtol: float = ..., atol: float = 1e-08): ... - -categorical_doc: str = ... - -def categorical_node_match(attr: str | ArrayLike, default): ... - -categorical_edge_match = ... - -def categorical_multiedge_match(attr: str | ArrayLike, default): ... - -# Docstrings for categorical functions. -tmpdoc = ... - -numerical_doc: str = ... - -def numerical_node_match( - attr: str | ArrayLike, - default, - rtol: float = ..., - atol: float = 1e-08, -): ... - -numerical_edge_match = ... - -def numerical_multiedge_match( - attr: str | ArrayLike, - default, - rtol: float = ..., - atol: float = 1e-08, -): ... - -# Docstrings for numerical functions. -tmpdoc = ... - -generic_doc: str = ... - -def generic_node_match(attr: str | ArrayLike, default, op: ArrayLike | Callable): ... - -generic_edge_match = ... - -def generic_multiedge_match(attr: str | ArrayLike, default, op: ArrayLike | Callable): ... diff --git a/stubs/networkx/algorithms/isomorphism/temporalisomorphvf2.pyi b/stubs/networkx/algorithms/isomorphism/temporalisomorphvf2.pyi deleted file mode 100644 index 969e35de..00000000 --- a/stubs/networkx/algorithms/isomorphism/temporalisomorphvf2.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from ...classes.graph import Graph -from .isomorphvf2 import DiGraphMatcher, GraphMatcher - -__all__ = ["TimeRespectingGraphMatcher", "TimeRespectingDiGraphMatcher"] - -class TimeRespectingGraphMatcher(GraphMatcher): - def __init__(self, G1: Graph, G2: Graph, temporal_attribute_name, delta): ... - def one_hop(self, Gx, Gx_node, neighbors): ... - def two_hop(self, Gx, core_x, Gx_node, neighbors): ... - def semantic_feasibility(self, G1_node, G2_node): ... - -class TimeRespectingDiGraphMatcher(DiGraphMatcher): - def __init__(self, G1: Graph, G2: Graph, temporal_attribute_name, delta): ... - def get_pred_dates(self, Gx, Gx_node, core_x, pred): ... - def get_succ_dates(self, Gx, Gx_node, core_x, succ): ... - def one_hop(self, Gx, Gx_node, core_x, pred, succ): ... - def two_hop_pred(self, Gx, Gx_node, core_x, pred): ... - def two_hop_succ(self, Gx, Gx_node, core_x, succ): ... - def preds(self, Gx, core_x, v, Gx_node=None): ... - def succs(self, Gx, core_x, v, Gx_node=None): ... - def test_one(self, pred_dates, succ_dates): ... - def test_two(self, pred_dates, succ_dates): ... - def semantic_feasibility(self, G1_node, G2_node): ... diff --git a/stubs/networkx/algorithms/isomorphism/tree_isomorphism.pyi b/stubs/networkx/algorithms/isomorphism/tree_isomorphism.pyi deleted file mode 100644 index bf754a1f..00000000 --- a/stubs/networkx/algorithms/isomorphism/tree_isomorphism.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = ["rooted_tree_isomorphism", "tree_isomorphism"] - -def root_trees(t1, root1, t2, root2): ... - -# figure out the level of each node, with 0 at root -def assign_levels(G: Graph, root): ... - -# now group the nodes at each level -def group_by_levels(levels): ... - -# now lets get the isomorphism by walking the ordered_children -def generate_isomorphism(v, w, M, ordered_children): ... -def rooted_tree_isomorphism(t1, root1, t2, root2) -> ArrayLike: ... -def tree_isomorphism(t1, t2) -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi b/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi deleted file mode 100644 index 69552a04..00000000 --- a/stubs/networkx/algorithms/isomorphism/vf2userfunc.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Callable - -from ...classes.graph import Graph -from . import isomorphvf2 as vf2 - -__all__ = ["GraphMatcher", "DiGraphMatcher", "MultiGraphMatcher", "MultiDiGraphMatcher"] - -class GraphMatcher(vf2.GraphMatcher): - def __init__( - self, - G1: Graph, - G2: Graph, - node_match: Callable | None = None, - edge_match: Callable | None = None, - ): ... - - semantic_feasibility = ... - -class DiGraphMatcher(vf2.DiGraphMatcher): - def __init__( - self, - G1: Graph, - G2: Graph, - node_match: Callable | None = None, - edge_match: Callable | None = None, - ): ... - def semantic_feasibility(self, G1_node, G2_node): ... - -# The "semantics" of edge_match are different for multi(di)graphs, but -# the implementation is the same. So, technically we do not need to -# provide "multi" versions, but we do so to match NetworkX's base classes. - -class MultiGraphMatcher(GraphMatcher): ... -class MultiDiGraphMatcher(DiGraphMatcher): ... diff --git a/stubs/networkx/algorithms/link_analysis/__init__.pyi b/stubs/networkx/algorithms/link_analysis/__init__.pyi deleted file mode 100644 index ff7c4952..00000000 --- a/stubs/networkx/algorithms/link_analysis/__init__.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from ...algorithms.link_analysis.hits_alg import ( - authority_matrix as authority_matrix, - hits as hits, - hits_numpy as hits_numpy, - hits_scipy as hits_scipy, - hub_matrix as hub_matrix, -) -from ...algorithms.link_analysis.pagerank_alg import ( - google_matrix as google_matrix, - pagerank as pagerank, - pagerank_numpy as pagerank_numpy, - pagerank_scipy as pagerank_scipy, -) diff --git a/stubs/networkx/algorithms/link_analysis/hits_alg.pyi b/stubs/networkx/algorithms/link_analysis/hits_alg.pyi deleted file mode 100644 index ae1b7344..00000000 --- a/stubs/networkx/algorithms/link_analysis/hits_alg.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["hits", "hits_numpy", "hits_scipy", "authority_matrix", "hub_matrix"] - -def hits( - G: Graph, - max_iter=100, - tol: float = 1.0e-8, - nstart: Mapping | None = None, - normalized=True, -): ... -def authority_matrix(G: Graph, nodelist=None): ... -def hub_matrix(G: Graph, nodelist=None): ... -def hits_numpy(G: Graph, normalized=True): ... -def hits_scipy( - G: Graph, - max_iter=100, - tol: float = 1.0e-6, - nstart: Mapping | None = None, - normalized=True, -): ... diff --git a/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi b/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi deleted file mode 100644 index 65ff7cca..00000000 --- a/stubs/networkx/algorithms/link_analysis/pagerank_alg.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from collections.abc import Mapping -from warnings import warn - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = ["pagerank", "pagerank_numpy", "pagerank_scipy", "google_matrix"] - -def pagerank( - G: Graph, - alpha: float = 0.85, - personalization: Mapping | None = None, - max_iter=100, - tol: float = 1.0e-6, - nstart: Mapping | None = None, - weight="weight", - dangling: Mapping | None = None, -) -> Mapping: ... -def google_matrix( - G: Graph, - alpha: float = 0.85, - personalization: Mapping | None = None, - nodelist: ArrayLike | None = None, - weight="weight", - dangling: Mapping | None = None, -): ... -def pagerank_numpy( - G: Graph, - alpha: float = 0.85, - personalization: Mapping | None = None, - weight="weight", - dangling: Mapping | None = None, -) -> Mapping: ... -def pagerank_scipy( - G: Graph, - alpha: float = 0.85, - personalization: Mapping | None = None, - max_iter=100, - tol: float = 1.0e-6, - nstart: Mapping | None = None, - weight="weight", - dangling: Mapping | None = None, -) -> Mapping: ... diff --git a/stubs/networkx/algorithms/link_prediction.pyi b/stubs/networkx/algorithms/link_prediction.pyi deleted file mode 100644 index 1f0e01e3..00000000 --- a/stubs/networkx/algorithms/link_prediction.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from math import log - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = [ - "resource_allocation_index", - "jaccard_coefficient", - "adamic_adar_index", - "preferential_attachment", - "cn_soundarajan_hopcroft", - "ra_index_soundarajan_hopcroft", - "within_inter_cluster", - "common_neighbor_centrality", -] - -def resource_allocation_index(G: Graph, ebunch=None): ... -def jaccard_coefficient(G: Graph, ebunch=None): ... -def adamic_adar_index(G: Graph, ebunch=None): ... -def common_neighbor_centrality(G: Graph, ebunch=None, alpha=0.8): ... -def preferential_attachment(G: Graph, ebunch=None): ... -def cn_soundarajan_hopcroft(G: Graph, ebunch=None, community="community"): ... -def ra_index_soundarajan_hopcroft(G: Graph, ebunch=None, community="community"): ... -def within_inter_cluster(G: Graph, ebunch=None, delta=0.001, community="community"): ... diff --git a/stubs/networkx/algorithms/lowest_common_ancestors.pyi b/stubs/networkx/algorithms/lowest_common_ancestors.pyi deleted file mode 100644 index 840e6729..00000000 --- a/stubs/networkx/algorithms/lowest_common_ancestors.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping, Set as AbstractSet -from itertools import combinations_with_replacement -from typing import Any - -from ..classes.graph import Graph -from ..utils import UnionFind, arbitrary_element, not_implemented_for - -__all__ = [ - "all_pairs_lowest_common_ancestor", - "tree_all_pairs_lowest_common_ancestor", - "lowest_common_ancestor", -] - -def all_pairs_lowest_common_ancestor(G: Graph, pairs=None): ... -def lowest_common_ancestor(G: Graph, node1, node2, default: Any = None): ... -def tree_all_pairs_lowest_common_ancestor(G: Graph, root=None, pairs=None): ... diff --git a/stubs/networkx/algorithms/matching.pyi b/stubs/networkx/algorithms/matching.pyi deleted file mode 100644 index 795a0965..00000000 --- a/stubs/networkx/algorithms/matching.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections import Counter -from collections.abc import Mapping -from itertools import combinations, repeat - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = [ - "is_matching", - "is_maximal_matching", - "is_perfect_matching", - "max_weight_matching", - "min_weight_matching", - "maximal_matching", -] - -def maximal_matching(G: Graph) -> set: ... -def matching_dict_to_set(matching): ... -def is_matching(G: Graph, matching: Mapping | set) -> bool: ... -def is_maximal_matching(G: Graph, matching: Mapping | set) -> bool: ... -def is_perfect_matching(G: Graph, matching: Mapping | set) -> bool: ... -def min_weight_matching(G: Graph, maxcardinality: bool | None = None, weight="weight") -> set: ... -def max_weight_matching(G: Graph, maxcardinality=False, weight="weight") -> set: ... diff --git a/stubs/networkx/algorithms/minors/__init__.pyi b/stubs/networkx/algorithms/minors/__init__.pyi deleted file mode 100644 index 5ea777b3..00000000 --- a/stubs/networkx/algorithms/minors/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ...algorithms.minors.contraction import ( - contracted_edge as contracted_edge, - contracted_nodes as contracted_nodes, - equivalence_classes as equivalence_classes, - identified_nodes as identified_nodes, - quotient_graph as quotient_graph, -) diff --git a/stubs/networkx/algorithms/minors/contraction.pyi b/stubs/networkx/algorithms/minors/contraction.pyi deleted file mode 100644 index 0099f884..00000000 --- a/stubs/networkx/algorithms/minors/contraction.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from itertools import chain, combinations, permutations, product - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...exception import NetworkXException -from ...utils import arbitrary_element - -__all__ = [ - "contracted_edge", - "contracted_nodes", - "equivalence_classes", - "identified_nodes", - "quotient_graph", -] - -chaini = ... - -def equivalence_classes(iterable: ArrayLike | tuple | set, relation): ... -def quotient_graph( - G: Graph, - partition, - edge_relation=None, - node_data=None, - edge_data=None, - relabel: bool = False, - create_using=None, -): ... -def contracted_nodes(G: Graph, u, v, self_loops: bool = True, copy: bool = True): ... - -identified_nodes = ... - -def contracted_edge(G: Graph, edge: tuple, self_loops: bool = True, copy=True): ... diff --git a/stubs/networkx/algorithms/mis.pyi b/stubs/networkx/algorithms/mis.pyi deleted file mode 100644 index 66e15c9c..00000000 --- a/stubs/networkx/algorithms/mis.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Iterable - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import not_implemented_for, py_random_state - -__all__ = ["maximal_independent_set"] - -@py_random_state(2) -def maximal_independent_set(G: Graph, nodes: ArrayLike | Iterable | None = None, seed=None) -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/moral.pyi b/stubs/networkx/algorithms/moral.pyi deleted file mode 100644 index bc8b7e18..00000000 --- a/stubs/networkx/algorithms/moral.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import itertools - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["moral_graph"] - -def moral_graph(G: Graph): ... diff --git a/stubs/networkx/algorithms/node_classification/__init__.pyi b/stubs/networkx/algorithms/node_classification/__init__.pyi deleted file mode 100644 index 3dda347a..00000000 --- a/stubs/networkx/algorithms/node_classification/__init__.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from .hmn import harmonic_function as harmonic_function -from .lgc import local_and_global_consistency as local_and_global_consistency diff --git a/stubs/networkx/algorithms/node_classification/hmn.pyi b/stubs/networkx/algorithms/node_classification/hmn.pyi deleted file mode 100644 index c0c483ba..00000000 --- a/stubs/networkx/algorithms/node_classification/hmn.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = ["harmonic_function"] - -def harmonic_function(G: Graph, max_iter: int = 30, label_name: str = "label") -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/node_classification/lgc.pyi b/stubs/networkx/algorithms/node_classification/lgc.pyi deleted file mode 100644 index 34ab3fea..00000000 --- a/stubs/networkx/algorithms/node_classification/lgc.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = ["local_and_global_consistency"] - -def local_and_global_consistency(G: Graph, alpha: float = 0.99, max_iter: int = 30, label_name: str = "label") -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/node_classification/utils.pyi b/stubs/networkx/algorithms/node_classification/utils.pyi deleted file mode 100644 index 38d8c0f0..00000000 --- a/stubs/networkx/algorithms/node_classification/utils.pyi +++ /dev/null @@ -1 +0,0 @@ -from ...classes.graph import Graph diff --git a/stubs/networkx/algorithms/non_randomness.pyi b/stubs/networkx/algorithms/non_randomness.pyi deleted file mode 100644 index 8f84a93f..00000000 --- a/stubs/networkx/algorithms/non_randomness.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import math - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["non_randomness"] - -def non_randomness(G: Graph, k: int | None = None, weight="weight"): ... diff --git a/stubs/networkx/algorithms/operators/__init__.pyi b/stubs/networkx/algorithms/operators/__init__.pyi deleted file mode 100644 index fd5db7bc..00000000 --- a/stubs/networkx/algorithms/operators/__init__.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from .all import ( - compose_all as compose_all, - disjoint_union_all as disjoint_union_all, - intersection_all as intersection_all, - union_all as union_all, -) -from .binary import ( - compose as compose, - difference as difference, - disjoint_union as disjoint_union, - full_join as full_join, - intersection as intersection, - symmetric_difference as symmetric_difference, - union as union, -) -from .product import ( - cartesian_product as cartesian_product, - lexicographic_product as lexicographic_product, - power as power, - rooted_product as rooted_product, - strong_product as strong_product, - tensor_product as tensor_product, -) -from .unary import complement as complement, reverse as reverse diff --git a/stubs/networkx/algorithms/operators/all.pyi b/stubs/networkx/algorithms/operators/all.pyi deleted file mode 100644 index be40d292..00000000 --- a/stubs/networkx/algorithms/operators/all.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from itertools import zip_longest - -from numpy.typing import ArrayLike - -__all__ = ["union_all", "compose_all", "disjoint_union_all", "intersection_all"] - -def union_all(graphs, rename: bool = ...): ... -def disjoint_union_all(graphs: ArrayLike): ... -def compose_all(graphs: ArrayLike): ... -def intersection_all(graphs: ArrayLike): ... diff --git a/stubs/networkx/algorithms/operators/binary.pyi b/stubs/networkx/algorithms/operators/binary.pyi deleted file mode 100644 index 31d25f48..00000000 --- a/stubs/networkx/algorithms/operators/binary.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from ...classes.graph import Graph - -__all__ = [ - "union", - "compose", - "disjoint_union", - "intersection", - "difference", - "symmetric_difference", - "full_join", -] - -def union(G: Graph, H, rename: tuple = ..., name: str | None = None): ... -def disjoint_union(G: Graph, H): ... -def intersection(G: Graph, H): ... -def difference(G: Graph, H): ... -def symmetric_difference(G: Graph, H): ... -def compose(G: Graph, H): ... -def full_join(G: Graph, H, rename: tuple = ...): ... diff --git a/stubs/networkx/algorithms/operators/product.pyi b/stubs/networkx/algorithms/operators/product.pyi deleted file mode 100644 index 7e426e72..00000000 --- a/stubs/networkx/algorithms/operators/product.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from itertools import product - -from ...classes.graph import Graph -from ...utils import not_implemented_for - -__all__ = [ - "tensor_product", - "cartesian_product", - "lexicographic_product", - "strong_product", - "power", - "rooted_product", -] - -# Generators for producting graph products - -def tensor_product(G: Graph, H): ... -def cartesian_product(G: Graph, H): ... -def lexicographic_product(G: Graph, H): ... -def strong_product(G: Graph, H): ... -def power(G: Graph, k): ... -def rooted_product(G: Graph, H, root): ... diff --git a/stubs/networkx/algorithms/operators/unary.pyi b/stubs/networkx/algorithms/operators/unary.pyi deleted file mode 100644 index d1e265c2..00000000 --- a/stubs/networkx/algorithms/operators/unary.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["complement", "reverse"] - -def complement(G: Graph): ... -def reverse(G: Graph, copy: bool = True): ... diff --git a/stubs/networkx/algorithms/planar_drawing.pyi b/stubs/networkx/algorithms/planar_drawing.pyi deleted file mode 100644 index 9af7f867..00000000 --- a/stubs/networkx/algorithms/planar_drawing.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = ["combinatorial_embedding_to_pos"] - -def combinatorial_embedding_to_pos(embedding, fully_triangulate: bool = False) -> Mapping: ... -def set_position(parent, tree, remaining_nodes, delta_x, y_coordinate, pos): ... -def get_canonical_ordering(embedding, outer_face: ArrayLike) -> ArrayLike: ... -def triangulate_face(embedding, v1, v2): ... -def triangulate_embedding(embedding, fully_triangulate: bool = True): ... -def make_bi_connected(embedding, starting_node, outgoing_node, edges_counted: set) -> ArrayLike: ... diff --git a/stubs/networkx/algorithms/planarity.pyi b/stubs/networkx/algorithms/planarity.pyi deleted file mode 100644 index b1d05e0e..00000000 --- a/stubs/networkx/algorithms/planarity.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph - -__all__ = ["check_planarity", "is_planar", "PlanarEmbedding"] - -def is_planar(G: Graph) -> bool: ... -def check_planarity(G: Graph, counterexample: bool = False): ... -def check_planarity_recursive(G: Graph, counterexample=False): ... -def get_counterexample(G: Graph): ... -def get_counterexample_recursive(G: Graph): ... - -class Interval: - def __init__(self, low=None, high=None): ... - def empty(self): ... - def copy(self): ... - def conflicting(self, b, planarity_state): ... - -class ConflictPair: - def __init__(self, left=..., right=...): ... - def swap(self): ... - def lowest(self, planarity_state): ... - -def top_of_stack(l): ... - -class LRPlanarity: - __slots__: list = ... - - def __init__(self, G): ... - def lr_planarity(self) -> Mapping: ... - def lr_planarity_recursive(self): ... - def dfs_orientation(self, v): ... - def dfs_orientation_recursive(self, v): ... - def dfs_testing(self, v): ... - def dfs_testing_recursive(self, v): ... - def add_constraints(self, ei, e): ... - def remove_back_edges(self, e): ... - def dfs_embedding(self, v): ... - def dfs_embedding_recursive(self, v): ... - def sign(self, e): ... - def sign_recursive(self, e): ... - -class PlanarEmbedding(DiGraph): - def get_data(self) -> Mapping: ... - def set_data(self, data: Mapping): ... - def neighbors_cw_order(self, v): ... - def check_structure(self): ... - def add_half_edge_ccw(self, start_node, end_node, reference_neighbor): ... - def add_half_edge_cw(self, start_node, end_node, reference_neighbor): ... - def connect_components(self, v, w): ... - def add_half_edge_first(self, start_node, end_node): ... - def next_face_half_edge(self, v, w) -> tuple: ... - def traverse_face(self, v, w, mark_half_edges: set | None = None) -> ArrayLike: ... - def is_directed(self): ... diff --git a/stubs/networkx/algorithms/polynomials.pyi b/stubs/networkx/algorithms/polynomials.pyi deleted file mode 100644 index 24e4a7ba..00000000 --- a/stubs/networkx/algorithms/polynomials.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections import deque - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["tutte_polynomial", "chromatic_polynomial"] - -def tutte_polynomial(G: Graph): ... -def chromatic_polynomial(G: Graph): ... diff --git a/stubs/networkx/algorithms/reciprocity.pyi b/stubs/networkx/algorithms/reciprocity.pyi deleted file mode 100644 index 3966f04c..00000000 --- a/stubs/networkx/algorithms/reciprocity.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Mapping - -from networkx import NetworkXError - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["reciprocity", "overall_reciprocity"] - -def reciprocity(G: Graph, nodes=None) -> Mapping: ... -def overall_reciprocity(G: Graph): ... diff --git a/stubs/networkx/algorithms/regular.pyi b/stubs/networkx/algorithms/regular.pyi deleted file mode 100644 index 71c9b657..00000000 --- a/stubs/networkx/algorithms/regular.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["is_regular", "is_k_regular", "k_factor"] - -def is_regular(G: Graph) -> bool: ... -def is_k_regular(G: Graph, k) -> bool: ... -def k_factor(G: Graph, k, matching_weight="weight"): ... diff --git a/stubs/networkx/algorithms/richclub.pyi b/stubs/networkx/algorithms/richclub.pyi deleted file mode 100644 index 957209e3..00000000 --- a/stubs/networkx/algorithms/richclub.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Mapping -from itertools import accumulate - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["rich_club_coefficient"] - -def rich_club_coefficient(G: Graph, normalized=True, Q=100, seed=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/shortest_paths/__init__.pyi b/stubs/networkx/algorithms/shortest_paths/__init__.pyi deleted file mode 100644 index 293fe213..00000000 --- a/stubs/networkx/algorithms/shortest_paths/__init__.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from .astar import astar_path as astar_path, astar_path_length as astar_path_length -from .dense import ( - floyd_warshall as floyd_warshall, - floyd_warshall_numpy as floyd_warshall_numpy, - floyd_warshall_predecessor_and_distance as floyd_warshall_predecessor_and_distance, - reconstruct_path as reconstruct_path, -) -from .generic import ( - all_shortest_paths as all_shortest_paths, - average_shortest_path_length as average_shortest_path_length, - has_path as has_path, - shortest_path as shortest_path, - shortest_path_length as shortest_path_length, -) -from .unweighted import ( - all_pairs_shortest_path as all_pairs_shortest_path, - all_pairs_shortest_path_length as all_pairs_shortest_path_length, - bidirectional_shortest_path as bidirectional_shortest_path, - predecessor as predecessor, - single_source_shortest_path as single_source_shortest_path, - single_source_shortest_path_length as single_source_shortest_path_length, - single_target_shortest_path as single_target_shortest_path, - single_target_shortest_path_length as single_target_shortest_path_length, -) -from .weighted import ( - all_pairs_bellman_ford_path as all_pairs_bellman_ford_path, - all_pairs_bellman_ford_path_length as all_pairs_bellman_ford_path_length, - all_pairs_dijkstra as all_pairs_dijkstra, - all_pairs_dijkstra_path as all_pairs_dijkstra_path, - all_pairs_dijkstra_path_length as all_pairs_dijkstra_path_length, - bellman_ford_path as bellman_ford_path, - bellman_ford_path_length as bellman_ford_path_length, - bellman_ford_predecessor_and_distance as bellman_ford_predecessor_and_distance, - bidirectional_dijkstra as bidirectional_dijkstra, - dijkstra_path as dijkstra_path, - dijkstra_path_length as dijkstra_path_length, - dijkstra_predecessor_and_distance as dijkstra_predecessor_and_distance, - find_negative_cycle as find_negative_cycle, - goldberg_radzik as goldberg_radzik, - johnson as johnson, - multi_source_dijkstra as multi_source_dijkstra, - multi_source_dijkstra_path as multi_source_dijkstra_path, - multi_source_dijkstra_path_length as multi_source_dijkstra_path_length, - negative_edge_cycle as negative_edge_cycle, - single_source_bellman_ford as single_source_bellman_ford, - single_source_bellman_ford_path as single_source_bellman_ford_path, - single_source_bellman_ford_path_length as single_source_bellman_ford_path_length, - single_source_dijkstra as single_source_dijkstra, - single_source_dijkstra_path as single_source_dijkstra_path, - single_source_dijkstra_path_length as single_source_dijkstra_path_length, -) diff --git a/stubs/networkx/algorithms/shortest_paths/astar.pyi b/stubs/networkx/algorithms/shortest_paths/astar.pyi deleted file mode 100644 index c22932db..00000000 --- a/stubs/networkx/algorithms/shortest_paths/astar.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from heapq import heappop, heappush -from itertools import count - -from ...classes.graph import Graph - -__all__ = ["astar_path", "astar_path_length"] - -def astar_path(G: Graph, source, target, heuristic=None, weight="weight"): ... -def astar_path_length(G: Graph, source, target, heuristic=None, weight="weight"): ... diff --git a/stubs/networkx/algorithms/shortest_paths/dense.pyi b/stubs/networkx/algorithms/shortest_paths/dense.pyi deleted file mode 100644 index 84ee24cd..00000000 --- a/stubs/networkx/algorithms/shortest_paths/dense.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = [ - "floyd_warshall", - "floyd_warshall_predecessor_and_distance", - "reconstruct_path", - "floyd_warshall_numpy", -] - -def floyd_warshall_numpy(G: Graph, nodelist=None, weight="weight"): ... -def floyd_warshall_predecessor_and_distance(G: Graph, weight="weight") -> dict: ... -def reconstruct_path(source, target, predecessors: Mapping) -> ArrayLike: ... -def floyd_warshall(G: Graph, weight="weight") -> Mapping: ... diff --git a/stubs/networkx/algorithms/shortest_paths/generic.pyi b/stubs/networkx/algorithms/shortest_paths/generic.pyi deleted file mode 100644 index 2784fe4d..00000000 --- a/stubs/networkx/algorithms/shortest_paths/generic.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from ...classes.graph import Graph - -__all__ = [ - "shortest_path", - "all_shortest_paths", - "shortest_path_length", - "average_shortest_path_length", - "has_path", -] - -def has_path(G: Graph, source, target): ... -def shortest_path(G: Graph, source=None, target=None, weight=None, method="dijkstra") -> list | dict: ... -def shortest_path_length(G: Graph, source=None, target=None, weight=None, method="dijkstra"): ... -def average_shortest_path_length(G: Graph, weight=None, method=None): ... -def all_shortest_paths(G: Graph, source, target, weight=None, method="dijkstra"): ... diff --git a/stubs/networkx/algorithms/shortest_paths/unweighted.pyi b/stubs/networkx/algorithms/shortest_paths/unweighted.pyi deleted file mode 100644 index bd40b033..00000000 --- a/stubs/networkx/algorithms/shortest_paths/unweighted.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = [ - "bidirectional_shortest_path", - "single_source_shortest_path", - "single_source_shortest_path_length", - "single_target_shortest_path", - "single_target_shortest_path_length", - "all_pairs_shortest_path", - "all_pairs_shortest_path_length", - "predecessor", -] - -def single_source_shortest_path_length(G: Graph, source, cutoff=None) -> Mapping: ... -def single_target_shortest_path_length(G: Graph, target, cutoff=None): ... -def all_pairs_shortest_path_length(G: Graph, cutoff=None): ... -def bidirectional_shortest_path(G: Graph, source, target) -> ArrayLike: ... -def single_source_shortest_path(G: Graph, source, cutoff=None) -> Mapping: ... -def single_target_shortest_path(G: Graph, target, cutoff=None) -> Mapping: ... -def all_pairs_shortest_path(G: Graph, cutoff=None) -> Mapping: ... -def predecessor(G: Graph, source, target=None, cutoff=None, return_seen=None) -> Mapping: ... diff --git a/stubs/networkx/algorithms/shortest_paths/weighted.pyi b/stubs/networkx/algorithms/shortest_paths/weighted.pyi deleted file mode 100644 index 7e758d2d..00000000 --- a/stubs/networkx/algorithms/shortest_paths/weighted.pyi +++ /dev/null @@ -1,62 +0,0 @@ -from collections import deque -from collections.abc import Mapping -from heapq import heappop, heappush -from itertools import count - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = [ - "dijkstra_path", - "dijkstra_path_length", - "bidirectional_dijkstra", - "single_source_dijkstra", - "single_source_dijkstra_path", - "single_source_dijkstra_path_length", - "multi_source_dijkstra", - "multi_source_dijkstra_path", - "multi_source_dijkstra_path_length", - "all_pairs_dijkstra", - "all_pairs_dijkstra_path", - "all_pairs_dijkstra_path_length", - "dijkstra_predecessor_and_distance", - "bellman_ford_path", - "bellman_ford_path_length", - "single_source_bellman_ford", - "single_source_bellman_ford_path", - "single_source_bellman_ford_path_length", - "all_pairs_bellman_ford_path", - "all_pairs_bellman_ford_path_length", - "bellman_ford_predecessor_and_distance", - "negative_edge_cycle", - "find_negative_cycle", - "goldberg_radzik", - "johnson", -] - -def dijkstra_path(G: Graph, source, target, weight="weight") -> ArrayLike: ... -def dijkstra_path_length(G: Graph, source, target, weight="weight"): ... -def single_source_dijkstra_path(G: Graph, source, cutoff=None, weight="weight") -> Mapping: ... -def single_source_dijkstra_path_length(G: Graph, source, cutoff=None, weight="weight") -> Mapping: ... -def single_source_dijkstra(G: Graph, source, target=None, cutoff=None, weight="weight"): ... -def multi_source_dijkstra_path(G: Graph, sources, cutoff=None, weight="weight") -> Mapping: ... -def multi_source_dijkstra_path_length(G: Graph, sources, cutoff=None, weight="weight") -> Mapping: ... -def multi_source_dijkstra(G: Graph, sources, target=None, cutoff=None, weight="weight"): ... -def dijkstra_predecessor_and_distance(G: Graph, source, cutoff=None, weight="weight") -> dict: ... -def all_pairs_dijkstra(G: Graph, cutoff=None, weight="weight"): ... -def all_pairs_dijkstra_path_length(G: Graph, cutoff=None, weight="weight"): ... -def all_pairs_dijkstra_path(G: Graph, cutoff=None, weight="weight") -> Mapping: ... -def bellman_ford_predecessor_and_distance(G: Graph, source, target=None, weight="weight", heuristic: bool = False) -> dict: ... -def bellman_ford_path(G: Graph, source, target, weight="weight") -> ArrayLike: ... -def bellman_ford_path_length(G: Graph, source, target, weight="weight"): ... -def single_source_bellman_ford_path(G: Graph, source, weight="weight") -> Mapping: ... -def single_source_bellman_ford_path_length(G: Graph, source, weight="weight"): ... -def single_source_bellman_ford(G: Graph, source, target=None, weight="weight"): ... -def all_pairs_bellman_ford_path_length(G: Graph, weight="weight"): ... -def all_pairs_bellman_ford_path(G: Graph, weight="weight") -> Mapping: ... -def goldberg_radzik(G: Graph, source, weight="weight") -> dict: ... -def negative_edge_cycle(G: Graph, weight="weight", heuristic: bool = True) -> bool: ... -def find_negative_cycle(G: Graph, source, weight="weight") -> ArrayLike: ... -def bidirectional_dijkstra(G: Graph, source, target, weight="weight"): ... -def johnson(G: Graph, weight="weight") -> Mapping: ... diff --git a/stubs/networkx/algorithms/similarity.pyi b/stubs/networkx/algorithms/similarity.pyi deleted file mode 100644 index a0f28002..00000000 --- a/stubs/networkx/algorithms/similarity.pyi +++ /dev/null @@ -1,98 +0,0 @@ -import math -import time -import warnings -from collections.abc import Mapping -from functools import reduce -from itertools import product -from operator import mul -from typing import Callable - -from ..classes.graph import Graph - -__all__ = [ - "graph_edit_distance", - "optimal_edit_paths", - "optimize_graph_edit_distance", - "optimize_edit_paths", - "simrank_similarity", - "simrank_similarity_numpy", - "panther_similarity", - "generate_random_paths", -] - -def debug_print(*args, **kwargs): ... -def graph_edit_distance( - G1, - G2, - node_match: Callable | None = None, - edge_match: Callable | None = None, - node_subst_cost: Callable | None = None, - node_del_cost: Callable | None = None, - node_ins_cost: Callable | None = None, - edge_subst_cost: Callable | None = None, - edge_del_cost: Callable | None = None, - edge_ins_cost: Callable | None = None, - roots=None, - upper_bound=None, - timeout=None, -): ... -def optimal_edit_paths( - G1, - G2, - node_match: Callable | None = None, - edge_match: Callable | None = None, - node_subst_cost: Callable | None = None, - node_del_cost: Callable | None = None, - node_ins_cost: Callable | None = None, - edge_subst_cost: Callable | None = None, - edge_del_cost: Callable | None = None, - edge_ins_cost: Callable | None = None, - upper_bound=None, -): ... -def optimize_graph_edit_distance( - G1, - G2, - node_match: Callable | None = None, - edge_match: Callable | None = None, - node_subst_cost: Callable | None = None, - node_del_cost: Callable | None = None, - node_ins_cost: Callable | None = None, - edge_subst_cost: Callable | None = None, - edge_del_cost: Callable | None = None, - edge_ins_cost: Callable | None = None, - upper_bound=None, -): ... -def optimize_edit_paths( - G1, - G2, - node_match: Callable | None = None, - edge_match: Callable | None = None, - node_subst_cost: Callable | None = None, - node_del_cost: Callable | None = None, - node_ins_cost: Callable | None = None, - edge_subst_cost: Callable | None = None, - edge_del_cost: Callable | None = None, - edge_ins_cost: Callable | None = None, - upper_bound=None, - strictly_decreasing: bool = True, - roots=None, - timeout=None, -): ... -def simrank_similarity( - G: Graph, - source=None, - target=None, - importance_factor: float = 0.9, - max_iterations=1000, - tolerance: float = 1e-4, -) -> dict | float: ... -def simrank_similarity_numpy( - G: Graph, - source=None, - target=None, - importance_factor=0.9, - max_iterations=100, - tolerance=1e-4, -): ... -def panther_similarity(G: Graph, source, k=5, path_length=5, c=0.5, delta=0.1, eps=None) -> Mapping: ... -def generate_random_paths(G: Graph, sample_size, path_length=5, index_map: Mapping | None = None): ... diff --git a/stubs/networkx/algorithms/simple_paths.pyi b/stubs/networkx/algorithms/simple_paths.pyi deleted file mode 100644 index 7d9b8ca2..00000000 --- a/stubs/networkx/algorithms/simple_paths.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from heapq import heappop, heappush -from itertools import count - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import not_implemented_for, pairwise - -__all__ = [ - "all_simple_paths", - "is_simple_path", - "shortest_simple_paths", - "all_simple_edge_paths", -] - -def is_simple_path(G: Graph, nodes: ArrayLike) -> bool: ... -def all_simple_paths(G: Graph, source, target, cutoff=None): ... -def all_simple_edge_paths(G: Graph, source, target, cutoff=None): ... -def shortest_simple_paths(G: Graph, source, target, weight=None): ... - -class PathBuffer: - def __init__(self): ... - def __len__(self): ... - def push(self, cost, path): ... - def pop(self): ... diff --git a/stubs/networkx/algorithms/smallworld.pyi b/stubs/networkx/algorithms/smallworld.pyi deleted file mode 100644 index efba650d..00000000 --- a/stubs/networkx/algorithms/smallworld.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from ..classes.graph import Graph -from ..utils import not_implemented_for, py_random_state - -__all__ = ["random_reference", "lattice_reference", "sigma", "omega"] - -@py_random_state(3) -def random_reference(G: Graph, niter=1, connectivity=True, seed=None): ... -@py_random_state(4) -def lattice_reference(G: Graph, niter=5, D=None, connectivity=True, seed=None): ... -@py_random_state(3) -def sigma(G: Graph, niter=100, nrand=10, seed=None) -> float: ... -@py_random_state(3) -def omega(G: Graph, niter=5, nrand=10, seed=None) -> float: ... diff --git a/stubs/networkx/algorithms/smetric.pyi b/stubs/networkx/algorithms/smetric.pyi deleted file mode 100644 index 3b48dcfd..00000000 --- a/stubs/networkx/algorithms/smetric.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from ..classes.graph import Graph - -__all__ = ["s_metric"] - -def s_metric(G: Graph, normalized=True) -> float: ... diff --git a/stubs/networkx/algorithms/sparsifiers.pyi b/stubs/networkx/algorithms/sparsifiers.pyi deleted file mode 100644 index 6006431c..00000000 --- a/stubs/networkx/algorithms/sparsifiers.pyi +++ /dev/null @@ -1,10 +0,0 @@ -import math -from typing import Any - -from ..classes.graph import Graph -from ..utils import not_implemented_for, py_random_state - -__all__ = ["spanner"] - -@py_random_state(3) -def spanner(G: Graph, stretch: float, weight: Any = None, seed=None): ... diff --git a/stubs/networkx/algorithms/structuralholes.pyi b/stubs/networkx/algorithms/structuralholes.pyi deleted file mode 100644 index 15a0e933..00000000 --- a/stubs/networkx/algorithms/structuralholes.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Mapping - -from ..classes.graph import Graph - -__all__ = ["constraint", "local_constraint", "effective_size"] - -def mutual_weight(G: Graph, u, v, weight=None): ... -def normalized_mutual_weight(G: Graph, u, v, norm=..., weight=None): ... -def effective_size(G: Graph, nodes=None, weight: str | None = None) -> Mapping: ... -def constraint(G: Graph, nodes=None, weight: str | None = None) -> Mapping: ... -def local_constraint(G: Graph, u, v, weight: str | None = None) -> float: ... diff --git a/stubs/networkx/algorithms/summarization.pyi b/stubs/networkx/algorithms/summarization.pyi deleted file mode 100644 index c148fd2e..00000000 --- a/stubs/networkx/algorithms/summarization.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections import Counter, defaultdict -from collections.abc import Iterable - -from ..classes.graph import Graph - -__all__ = ["dedensify", "snap_aggregation"] - -def dedensify(G: Graph, threshold: int, prefix=None, copy=True): ... -def snap_aggregation( - G: Graph, - node_attributes, - edge_attributes: Iterable = ..., - prefix: str = "Supernode-", - supernode_attribute: str = "group", - superedge_attribute: str = "types", -): ... diff --git a/stubs/networkx/algorithms/swap.pyi b/stubs/networkx/algorithms/swap.pyi deleted file mode 100644 index 0cfd84ba..00000000 --- a/stubs/networkx/algorithms/swap.pyi +++ /dev/null @@ -1,11 +0,0 @@ -import math - -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = ["double_edge_swap", "connected_double_edge_swap"] - -@py_random_state(3) -def double_edge_swap(G: Graph, nswap=1, max_tries=100, seed=None): ... -@py_random_state(3) -def connected_double_edge_swap(G: Graph, nswap=1, _window_threshold=3, seed=None) -> int: ... diff --git a/stubs/networkx/algorithms/threshold.pyi b/stubs/networkx/algorithms/threshold.pyi deleted file mode 100644 index 3bd1d743..00000000 --- a/stubs/networkx/algorithms/threshold.pyi +++ /dev/null @@ -1,47 +0,0 @@ -from math import sqrt - -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = ["is_threshold_graph", "find_threshold_graph"] - -def is_threshold_graph(G: Graph) -> bool: ... -def is_threshold_sequence(degree_sequence): ... -def creation_sequence(degree_sequence, with_labels=False, compact=False): ... -def make_compact(creation_sequence): ... -def uncompact(creation_sequence): ... -def creation_sequence_to_weights(creation_sequence): ... -def weights_to_creation_sequence(weights, threshold=1, with_labels=False, compact=False): ... - -# Manipulating NetworkX.Graphs in context of threshold graphs -def threshold_graph(creation_sequence, create_using=None): ... -def find_alternating_4_cycle(G: Graph): ... -def find_threshold_graph(G: Graph, create_using=None): ... -def find_creation_sequence(G: Graph): ... - -# Properties of Threshold Graphs -def triangles(creation_sequence): ... -def triangle_sequence(creation_sequence): ... -def cluster_sequence(creation_sequence): ... -def degree_sequence(creation_sequence): ... -def density(creation_sequence): ... -def degree_correlation(creation_sequence): ... -def shortest_path(creation_sequence, u, v): ... -def shortest_path_length(creation_sequence, i): ... -def betweenness_sequence(creation_sequence, normalized=True): ... -def eigenvectors(creation_sequence): ... -def spectral_projection(u, eigenpairs): ... -def eigenvalues(creation_sequence): ... - -# Threshold graph creation routines - -@py_random_state(2) -def random_threshold_sequence(n, p, seed=None): ... - -# maybe *_d_threshold_sequence routines should -# be (or be called from) a single routine with a more descriptive name -# and a keyword parameter? -def right_d_threshold_sequence(n, m): ... -def left_d_threshold_sequence(n, m): ... -@py_random_state(3) -def swap_d(cs, p_split=1.0, p_combine=1.0, seed=None): ... diff --git a/stubs/networkx/algorithms/tournament.pyi b/stubs/networkx/algorithms/tournament.pyi deleted file mode 100644 index d9459ac0..00000000 --- a/stubs/networkx/algorithms/tournament.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from itertools import combinations - -from numpy.typing import ArrayLike - -from ..algorithms.simple_paths import is_simple_path as is_path -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..utils import arbitrary_element, not_implemented_for, py_random_state - -__all__ = [ - "hamiltonian_path", - "is_reachable", - "is_strongly_connected", - "is_tournament", - "random_tournament", - "score_sequence", -] - -def index_satisfying(iterable, condition): ... -def is_tournament(G: Graph) -> bool: ... -def hamiltonian_path(G: Graph) -> ArrayLike: ... -@py_random_state(1) -def random_tournament(n: int, seed=None) -> DiGraph: ... -def score_sequence(G: Graph) -> ArrayLike: ... -def tournament_matrix(G: Graph): ... -def is_reachable(G: Graph, s, t) -> bool: ... -def is_strongly_connected(G: Graph) -> bool: ... diff --git a/stubs/networkx/algorithms/traversal/__init__.pyi b/stubs/networkx/algorithms/traversal/__init__.pyi deleted file mode 100644 index 0f0b8503..00000000 --- a/stubs/networkx/algorithms/traversal/__init__.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from .beamsearch import bfs_beam_edges as bfs_beam_edges -from .breadth_first_search import ( - bfs_edges as bfs_edges, - bfs_layers as bfs_layers, - bfs_predecessors as bfs_predecessors, - bfs_successors as bfs_successors, - bfs_tree as bfs_tree, - descendants_at_distance as descendants_at_distance, -) -from .depth_first_search import ( - dfs_edges as dfs_edges, - dfs_labeled_edges as dfs_labeled_edges, - dfs_postorder_nodes as dfs_postorder_nodes, - dfs_predecessors as dfs_predecessors, - dfs_preorder_nodes as dfs_preorder_nodes, - dfs_successors as dfs_successors, - dfs_tree as dfs_tree, -) -from .edgebfs import edge_bfs as edge_bfs -from .edgedfs import edge_dfs as edge_dfs diff --git a/stubs/networkx/algorithms/traversal/beamsearch.pyi b/stubs/networkx/algorithms/traversal/beamsearch.pyi deleted file mode 100644 index c89ceb84..00000000 --- a/stubs/networkx/algorithms/traversal/beamsearch.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ...classes.graph import Graph -from .breadth_first_search import generic_bfs_edges - -__all__ = ["bfs_beam_edges"] - -def bfs_beam_edges(G: Graph, source, value, width=None): ... diff --git a/stubs/networkx/algorithms/traversal/breadth_first_search.pyi b/stubs/networkx/algorithms/traversal/breadth_first_search.pyi deleted file mode 100644 index 9af0193c..00000000 --- a/stubs/networkx/algorithms/traversal/breadth_first_search.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from collections import deque - -from ...classes.graph import Graph - -__all__ = [ - "bfs_edges", - "bfs_tree", - "bfs_predecessors", - "bfs_successors", - "descendants_at_distance", - "bfs_layers", -] - -def generic_bfs_edges(G: Graph, source, neighbors=None, depth_limit=None, sort_neighbors=None): ... -def bfs_edges(G: Graph, source, reverse: bool = False, depth_limit=None, sort_neighbors=None): ... -def bfs_tree(G: Graph, source, reverse: bool = False, depth_limit=None, sort_neighbors=None): ... -def bfs_predecessors(G: Graph, source, depth_limit=None, sort_neighbors=None): ... -def bfs_successors(G: Graph, source, depth_limit=None, sort_neighbors=None): ... -def bfs_layers(G: Graph, sources): ... -def descendants_at_distance(G: Graph, source, distance): ... diff --git a/stubs/networkx/algorithms/traversal/depth_first_search.pyi b/stubs/networkx/algorithms/traversal/depth_first_search.pyi deleted file mode 100644 index ccbb5736..00000000 --- a/stubs/networkx/algorithms/traversal/depth_first_search.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = [ - "dfs_edges", - "dfs_tree", - "dfs_predecessors", - "dfs_successors", - "dfs_preorder_nodes", - "dfs_postorder_nodes", - "dfs_labeled_edges", -] - -def dfs_edges(G: Graph, source=None, depth_limit=None): ... -def dfs_tree(G: Graph, source=None, depth_limit=None): ... -def dfs_predecessors(G: Graph, source=None, depth_limit=None) -> Mapping: ... -def dfs_successors(G: Graph, source=None, depth_limit=None) -> Mapping: ... -def dfs_postorder_nodes(G: Graph, source=None, depth_limit=None): ... -def dfs_preorder_nodes(G: Graph, source=None, depth_limit=None): ... -def dfs_labeled_edges(G: Graph, source=None, depth_limit=None): ... diff --git a/stubs/networkx/algorithms/traversal/edgebfs.pyi b/stubs/networkx/algorithms/traversal/edgebfs.pyi deleted file mode 100644 index d32f50fa..00000000 --- a/stubs/networkx/algorithms/traversal/edgebfs.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections import deque - -from ...classes.graph import Graph - -FORWARD: str = ... -REVERSE: str = ... - -__all__ = ["edge_bfs"] - -def edge_bfs(G: Graph, source=None, orientation=None): ... diff --git a/stubs/networkx/algorithms/traversal/edgedfs.pyi b/stubs/networkx/algorithms/traversal/edgedfs.pyi deleted file mode 100644 index 3b9686c0..00000000 --- a/stubs/networkx/algorithms/traversal/edgedfs.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ...classes.graph import Graph - -FORWARD: str = ... -REVERSE: str = ... - -__all__ = ["edge_dfs"] - -def edge_dfs(G: Graph, source=None, orientation=None): ... diff --git a/stubs/networkx/algorithms/tree/__init__.pyi b/stubs/networkx/algorithms/tree/__init__.pyi deleted file mode 100644 index c5eae234..00000000 --- a/stubs/networkx/algorithms/tree/__init__.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from .branchings import ( - ArborescenceIterator as ArborescenceIterator, - Edmonds as Edmonds, - branching_weight as branching_weight, - greedy_branching as greedy_branching, - maximum_branching as maximum_branching, - maximum_spanning_arborescence as maximum_spanning_arborescence, - minimum_branching as minimum_branching, - minimum_spanning_arborescence as minimum_spanning_arborescence, -) -from .coding import ( - NotATree as NotATree, - from_nested_tuple as from_nested_tuple, - from_prufer_sequence as from_prufer_sequence, - to_nested_tuple as to_nested_tuple, - to_prufer_sequence as to_prufer_sequence, -) -from .decomposition import junction_tree as junction_tree -from .mst import ( - EdgePartition as EdgePartition, - SpanningTreeIterator as SpanningTreeIterator, - maximum_spanning_edges as maximum_spanning_edges, - maximum_spanning_tree as maximum_spanning_tree, - minimum_spanning_edges as minimum_spanning_edges, - minimum_spanning_tree as minimum_spanning_tree, - partition_spanning_tree as partition_spanning_tree, - random_spanning_tree as random_spanning_tree, -) -from .operations import join as join -from .recognition import ( - is_arborescence as is_arborescence, - is_branching as is_branching, - is_forest as is_forest, - is_tree as is_tree, -) diff --git a/stubs/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/algorithms/tree/branchings.pyi deleted file mode 100644 index b11a5712..00000000 --- a/stubs/networkx/algorithms/tree/branchings.pyi +++ /dev/null @@ -1,102 +0,0 @@ -from typing import Literal - -from ...classes.digraph import DiGraph -from ...classes.graph import Graph -from ...classes.multidigraph import MultiDiGraph -from ...utils import py_random_state -from .recognition import is_arborescence, is_branching - -__all__ = [ - "branching_weight", - "greedy_branching", - "maximum_branching", - "minimum_branching", - "maximum_spanning_arborescence", - "minimum_spanning_arborescence", - "ArborescenceIterator", - "Edmonds", -] - -KINDS: set = ... - -STYLES: dict = ... - -INF = ... - -@py_random_state(1) -def random_string(L=15, seed=None): ... -def branching_weight(G: DiGraph, attr: str = "weight", default: float = 1) -> int | float: ... -@py_random_state(4) -def greedy_branching(G: DiGraph, attr: str = "weight", default: float = 1, kind: str = "max", seed=None): ... - -class MultiDiGraph_EdgeKey(MultiDiGraph): - def __init__(self, incoming_graph_data=None, **attr): ... - def remove_node(self, n): ... - def remove_nodes_from(self, nbunch): ... - def add_edge(self, u_for_edge, v_for_edge, key_for_edge, **attr): ... - def add_edges_from(self, ebunch_to_add, **attr): ... - def remove_edge_with_key(self, key): ... - def remove_edges_from(self, ebunch): ... - -def get_path(G: Graph, u, v): ... - -class Edmonds: - def __init__(self, G: Graph, seed=None): ... - def _init(self, attr, default, kind, style, preserve_attrs, seed, partition): ... - def find_optimum( - self, - attr: str = "weight", - default: float = 1, - kind: Literal["min", "max"] = "max", - style: Literal["branching", "arborescence"] = "branching", - preserve_attrs: bool = False, - partition: str | None = None, - seed=None, - ): ... - -def maximum_branching( - G: Graph, - attr: str = "weight", - default: float = 1, - preserve_attrs: bool = False, - partition: str | None = None, -): ... -def minimum_branching( - G: Graph, - attr: str = "weight", - default: float = 1, - preserve_attrs: bool = False, - partition: str | None = None, -): ... -def maximum_spanning_arborescence( - G: Graph, - attr: str = "weight", - default: float = 1, - preserve_attrs: bool = False, - partition: str | None = None, -): ... -def minimum_spanning_arborescence( - G: Graph, - attr: str = "weight", - default: float = 1, - preserve_attrs: bool = False, - partition: str | None = None, -): ... - -docstring_branching: str = ... - -docstring_arborescence = ... - -class ArborescenceIterator: - def __init__( - self, - G: Graph, - weight: str = "weight", - minimum: bool = True, - init_partition: tuple | None = None, - ): ... - def __iter__(self) -> ArborescenceIterator: ... - def __next__(self): ... - def _partition(self, partition, partition_arborescence): ... - def _write_partition(self, partition): ... - def _clear_partition(self, G): ... diff --git a/stubs/networkx/algorithms/tree/coding.pyi b/stubs/networkx/algorithms/tree/coding.pyi deleted file mode 100644 index fa66886f..00000000 --- a/stubs/networkx/algorithms/tree/coding.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections import Counter -from itertools import chain - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph -from ...exception import NetworkXException -from ...utils import not_implemented_for - -__all__ = [ - "from_nested_tuple", - "from_prufer_sequence", - "NotATree", - "to_nested_tuple", - "to_prufer_sequence", -] - -class NotATree(NetworkXException): ... - -def to_nested_tuple(T, root, canonical_form: bool = False) -> tuple: ... -def from_nested_tuple(sequence: tuple, sensible_relabeling: bool = False): ... -def to_prufer_sequence(T) -> ArrayLike: ... -def from_prufer_sequence(sequence: ArrayLike): ... diff --git a/stubs/networkx/algorithms/tree/decomposition.pyi b/stubs/networkx/algorithms/tree/decomposition.pyi deleted file mode 100644 index fd5b62a0..00000000 --- a/stubs/networkx/algorithms/tree/decomposition.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from itertools import combinations - -from networkx import Graph - -from ...algorithms import chordal_graph_cliques, complete_to_chordal_graph, moral -from ...utils import not_implemented_for - -__all__ = ["junction_tree"] - -def junction_tree(G: Graph) -> Graph: ... diff --git a/stubs/networkx/algorithms/tree/mst.pyi b/stubs/networkx/algorithms/tree/mst.pyi deleted file mode 100644 index e9ad1104..00000000 --- a/stubs/networkx/algorithms/tree/mst.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from dataclasses import dataclass, field -from enum import Enum -from heapq import heappop, heappush -from itertools import count -from math import isnan -from operator import itemgetter -from queue import PriorityQueue - -from ...classes.graph import Graph -from ...utils import UnionFind, not_implemented_for, py_random_state - -__all__ = [ - "minimum_spanning_edges", - "maximum_spanning_edges", - "minimum_spanning_tree", - "maximum_spanning_tree", - "random_spanning_tree", - "partition_spanning_tree", - "EdgePartition", - "SpanningTreeIterator", -] - -class EdgePartition(Enum): - OPEN = ... - INCLUDED = ... - EXCLUDED = ... - -def boruvka_mst_edges(G: Graph, minimum=True, weight="weight", keys=False, data=True, ignore_nan=False): ... -def kruskal_mst_edges( - G: Graph, - minimum, - weight="weight", - keys=True, - data=True, - ignore_nan=False, - partition=None, -): ... -def prim_mst_edges(G: Graph, minimum, weight="weight", keys=True, data=True, ignore_nan=False): ... - -ALGORITHMS: dict = ... - -def minimum_spanning_edges( - G: Graph, - algorithm: str = "kruskal", - weight: str = "weight", - keys: bool = True, - data: bool = True, - ignore_nan=False, -): ... -def maximum_spanning_edges( - G: Graph, - algorithm: str = "kruskal", - weight: str = "weight", - keys: bool = True, - data: bool = True, - ignore_nan=False, -): ... -def minimum_spanning_tree(G: Graph, weight: str = "weight", algorithm: str = "kruskal", ignore_nan=False): ... -def partition_spanning_tree( - G: Graph, - minimum=True, - weight: str = "weight", - partition: str = "partition", - ignore_nan=False, -): ... -def maximum_spanning_tree(G: Graph, weight: str = "weight", algorithm: str = "kruskal", ignore_nan=False): ... -@py_random_state(3) -def random_spanning_tree(G: Graph, weight: str | None = None, *, multiplicative: bool = True, seed=None): ... - -class SpanningTreeIterator: - def __init__( - self, - G: Graph, - weight: str = "weight", - minimum: bool = True, - ignore_nan: bool = False, - ): ... - def __iter__(self) -> SpanningTreeIterator: ... - def __next__(self): ... - def _partition(self, partition, partition_tree): ... - def _write_partition(self, partition): ... - def _clear_partition(self, G): ... diff --git a/stubs/networkx/algorithms/tree/operations.pyi b/stubs/networkx/algorithms/tree/operations.pyi deleted file mode 100644 index 09cd3d2c..00000000 --- a/stubs/networkx/algorithms/tree/operations.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from functools import partial -from itertools import accumulate, chain - -from numpy.typing import ArrayLike - -from ...classes.graph import Graph - -__all__ = ["join"] - -def join(rooted_trees: ArrayLike, label_attribute: str | None = None): ... diff --git a/stubs/networkx/algorithms/tree/recognition.pyi b/stubs/networkx/algorithms/tree/recognition.pyi deleted file mode 100644 index 4a6ac6c7..00000000 --- a/stubs/networkx/algorithms/tree/recognition.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ...classes.graph import Graph - -__all__ = ["is_arborescence", "is_branching", "is_forest", "is_tree"] - -def is_arborescence(G: Graph) -> bool: ... -def is_branching(G: Graph) -> bool: ... -def is_forest(G: Graph) -> bool: ... -def is_tree(G: Graph) -> bool: ... diff --git a/stubs/networkx/algorithms/triads.pyi b/stubs/networkx/algorithms/triads.pyi deleted file mode 100644 index b7c489a2..00000000 --- a/stubs/networkx/algorithms/triads.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from collections import defaultdict -from collections.abc import Mapping -from itertools import combinations, permutations -from random import sample - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -# See https://github.com/networkx/networkx/pull/1474 -# Copyright 2011 Reya Group -# Copyright 2011 Alex Levenson -# Copyright 2011 Diederik van Liere - -__all__ = [ - "triadic_census", - "is_triad", - "all_triplets", - "all_triads", - "triads_by_type", - "triad_type", - "random_triad", -] - -#: The integer codes representing each type of triad. -#: -#: Triads that are the same up to symmetry have the same code. -TRICODES = ... - -#: The names of each type of triad. The order of the elements is -#: important: it corresponds to the tricodes given in :data:`TRICODES`. -TRIAD_NAMES = ... - -#: A dictionary mapping triad code to triad name. -TRICODE_TO_NAME: dict = ... - -def triadic_census(G: Graph, nodelist: ArrayLike | None = None) -> Mapping: ... -def is_triad(G: Graph) -> bool: ... -def all_triplets(G: Graph): ... -def all_triads(G: Graph): ... -def triads_by_type(G: Graph) -> Mapping: ... -def triad_type(G: Graph) -> str: ... -def random_triad(G: Graph): ... diff --git a/stubs/networkx/algorithms/vitality.pyi b/stubs/networkx/algorithms/vitality.pyi deleted file mode 100644 index 053849ec..00000000 --- a/stubs/networkx/algorithms/vitality.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from functools import partial -from typing import Any - -from ..classes.graph import Graph - -__all__ = ["closeness_vitality"] - -def closeness_vitality(G: Graph, node: Any = None, weight: str | None = None, wiener_index=None) -> dict | float: ... diff --git a/stubs/networkx/algorithms/voronoi.pyi b/stubs/networkx/algorithms/voronoi.pyi deleted file mode 100644 index 821d1eda..00000000 --- a/stubs/networkx/algorithms/voronoi.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping - -from ..classes.graph import Graph -from ..utils import groups - -__all__ = ["voronoi_cells"] - -def voronoi_cells(G: Graph, center_nodes: set, weight="weight") -> Mapping: ... diff --git a/stubs/networkx/algorithms/wiener.pyi b/stubs/networkx/algorithms/wiener.pyi deleted file mode 100644 index 60ff51c9..00000000 --- a/stubs/networkx/algorithms/wiener.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from itertools import chain -from typing import Any - -from ..classes.graph import Graph -from .components import is_connected, is_strongly_connected -from .shortest_paths import shortest_path_length as spl - -__all__ = ["wiener_index"] - -#: Rename the :func:`chain.from_iterable` function for the sake of -#: brevity. -chaini = ... - -def wiener_index(G: Graph, weight: Any = None) -> float: ... diff --git a/stubs/networkx/classes/__init__.pyi b/stubs/networkx/classes/__init__.pyi deleted file mode 100644 index aee69427..00000000 --- a/stubs/networkx/classes/__init__.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from . import coreviews as coreviews, filters as filters, graphviews as graphviews, reportviews as reportviews -from .digraph import DiGraph as DiGraph -from .function import ( - add_cycle as add_cycle, - add_path as add_path, - add_star as add_star, - all_neighbors as all_neighbors, - common_neighbors as common_neighbors, - create_empty_copy as create_empty_copy, - degree as degree, - degree_histogram as degree_histogram, - density as density, - edge_subgraph as edge_subgraph, - edges as edges, - freeze as freeze, - get_edge_attributes as get_edge_attributes, - get_node_attributes as get_node_attributes, - induced_subgraph as induced_subgraph, - info as info, - is_directed as is_directed, - is_empty as is_empty, - is_frozen as is_frozen, - is_negatively_weighted as is_negatively_weighted, - is_path as is_path, - is_weighted as is_weighted, - neighbors as neighbors, - nodes as nodes, - nodes_with_selfloops as nodes_with_selfloops, - non_edges as non_edges, - non_neighbors as non_neighbors, - number_of_edges as number_of_edges, - number_of_nodes as number_of_nodes, - number_of_selfloops as number_of_selfloops, - path_weight as path_weight, - restricted_view as restricted_view, - reverse_view as reverse_view, - selfloop_edges as selfloop_edges, - set_edge_attributes as set_edge_attributes, - set_node_attributes as set_node_attributes, - subgraph as subgraph, - subgraph_view as subgraph_view, - to_directed as to_directed, - to_undirected as to_undirected, -) -from .graph import Graph as Graph -from .multidigraph import MultiDiGraph as MultiDiGraph -from .multigraph import MultiGraph as MultiGraph -from .ordered import * diff --git a/stubs/networkx/classes/coreviews.pyi b/stubs/networkx/classes/coreviews.pyi deleted file mode 100644 index 9bc00ce1..00000000 --- a/stubs/networkx/classes/coreviews.pyi +++ /dev/null @@ -1,101 +0,0 @@ -import warnings -from collections.abc import Mapping - -__all__ = [ - "AtlasView", - "AdjacencyView", - "MultiAdjacencyView", - "UnionAtlas", - "UnionAdjacency", - "UnionMultiInner", - "UnionMultiAdjacency", - "FilterAtlas", - "FilterAdjacency", - "FilterMultiInner", - "FilterMultiAdjacency", -] - -class AtlasView(Mapping): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, d): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, key): ... - def copy(self): ... - def __str__(self): ... - def __repr__(self): ... - -class AdjacencyView(AtlasView): - __slots__ = ... # Still uses AtlasView slots names _atlas - - def __getitem__(self, name): ... - def copy(self): ... - -class MultiAdjacencyView(AdjacencyView): - __slots__ = ... # Still uses AtlasView slots names _atlas - - def __getitem__(self, name): ... - def copy(self): ... - -class UnionAtlas(Mapping): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, succ, pred): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, key): ... - def copy(self): ... - def __str__(self): ... - def __repr__(self): ... - -class UnionAdjacency(Mapping): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, succ, pred): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, nbr): ... - def copy(self): ... - def __str__(self): ... - def __repr__(self): ... - -class UnionMultiInner(UnionAtlas): - __slots__ = ... # Still uses UnionAtlas slots names _succ, _pred - - def __getitem__(self, node): ... - def copy(self): ... - -class UnionMultiAdjacency(UnionAdjacency): - __slots__ = ... # Still uses UnionAdjacency slots names _succ, _pred - - def __getitem__(self, node): ... - -class FilterAtlas(Mapping): # nodedict, nbrdict, keydict - def __init__(self, d, NODE_OK): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, key): ... - def __str__(self): ... - def __repr__(self): ... - -class FilterAdjacency(Mapping): # edgedict - def __init__(self, d, NODE_OK, EDGE_OK): ... - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, node): ... - def __str__(self): ... - def __repr__(self): ... - -class FilterMultiInner(FilterAdjacency): # muliedge_seconddict - def __iter__(self): ... - def __getitem__(self, nbr): ... - -class FilterMultiAdjacency(FilterAdjacency): # multiedgedict - def __getitem__(self, node): ... diff --git a/stubs/networkx/classes/digraph.pyi b/stubs/networkx/classes/digraph.pyi deleted file mode 100644 index 826b3a8f..00000000 --- a/stubs/networkx/classes/digraph.pyi +++ /dev/null @@ -1,62 +0,0 @@ -from functools import cached_property - -from ..classes.graph import Graph -from ..classes.reportviews import DiDegreeView, InEdgeView, OutEdgeView - -__all__ = ["DiGraph"] - -class _CachedPropertyResetterAdjAndSucc: - def __set__(self, obj, value): ... - -class _CachedPropertyResetterPred: - def __set__(self, obj, value): ... - -class DiGraph(Graph): - graph = ... - _adj = ... - _succ = ... - _pred = ... - - def __init__(self, incoming_graph_data=None, **attr): ... - @cached_property - def adj(self): ... - @cached_property - def succ(self): ... - @cached_property - def pred(self): ... - def add_node(self, node_for_adding, **attr): ... - def add_nodes_from(self, nodes_for_adding, **attr): ... - def remove_node(self, n): ... - def remove_nodes_from(self, nodes): ... - def add_edge(self, u_of_edge, v_of_edge, **attr): ... - def add_edges_from(self, ebunch_to_add, **attr): ... - def remove_edge(self, u, v): ... - def remove_edges_from(self, ebunch): ... - def has_successor(self, u, v): ... - def has_predecessor(self, u, v): ... - def successors(self, n): ... - - # digraph definitions - neighbors = successors - - def predecessors(self, n): ... - @cached_property - def edges(self) -> OutEdgeView: ... - - # alias out_edges to edges - @cached_property - def out_edges(self) -> OutEdgeView: ... - @cached_property - def in_edges(self) -> InEdgeView: ... - @cached_property - def degree(self) -> DiDegreeView | int: ... - @cached_property - def in_degree(self): ... - @cached_property - def out_degree(self): ... - def clear(self): ... - def clear_edges(self): ... - def is_multigraph(self): ... - def is_directed(self): ... - def to_undirected(self, reciprocal=False, as_view=False) -> Graph: ... - def reverse(self, copy=True): ... diff --git a/stubs/networkx/classes/filters.pyi b/stubs/networkx/classes/filters.pyi deleted file mode 100644 index 61ababe4..00000000 --- a/stubs/networkx/classes/filters.pyi +++ /dev/null @@ -1,30 +0,0 @@ -__all__ = [ - "no_filter", - "hide_nodes", - "hide_edges", - "hide_multiedges", - "hide_diedges", - "hide_multidiedges", - "show_nodes", - "show_edges", - "show_multiedges", - "show_diedges", - "show_multidiedges", -] - -def no_filter(*items): ... -def hide_nodes(nodes): ... -def hide_diedges(edges): ... -def hide_edges(edges): ... -def hide_multidiedges(edges): ... -def hide_multiedges(edges): ... - -# write show_nodes as a class to make SubGraph pickleable -class show_nodes: - def __init__(self, nodes): ... - def __call__(self, node): ... - -def show_diedges(edges): ... -def show_edges(edges): ... -def show_multidiedges(edges): ... -def show_multiedges(edges): ... diff --git a/stubs/networkx/classes/function.pyi b/stubs/networkx/classes/function.pyi deleted file mode 100644 index 2fbdafc3..00000000 --- a/stubs/networkx/classes/function.pyi +++ /dev/null @@ -1,92 +0,0 @@ -from collections import Counter -from collections.abc import Iterable -from itertools import chain - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..classes.graphviews import reverse_view, subgraph_view -from ..utils import not_implemented_for, pairwise - -__all__ = [ - "nodes", - "edges", - "degree", - "degree_histogram", - "neighbors", - "number_of_nodes", - "number_of_edges", - "density", - "is_directed", - "info", - "freeze", - "is_frozen", - "subgraph", - "subgraph_view", - "induced_subgraph", - "reverse_view", - "edge_subgraph", - "restricted_view", - "to_directed", - "to_undirected", - "add_star", - "add_path", - "add_cycle", - "create_empty_copy", - "set_node_attributes", - "get_node_attributes", - "set_edge_attributes", - "get_edge_attributes", - "all_neighbors", - "non_neighbors", - "non_edges", - "common_neighbors", - "is_weighted", - "is_negatively_weighted", - "is_empty", - "selfloop_edges", - "nodes_with_selfloops", - "number_of_selfloops", - "path_weight", - "is_path", -] - -def nodes(G: Graph): ... -def edges(G: Graph, nbunch=None): ... -def degree(G: Graph, nbunch=None, weight=None): ... -def neighbors(G: Graph, n): ... -def number_of_nodes(G: Graph): ... -def number_of_edges(G: Graph): ... -def density(G: Graph): ... -def degree_histogram(G: Graph) -> ArrayLike: ... -def is_directed(G: Graph): ... -def frozen(*args, **kwargs): ... -def freeze(G: Graph): ... -def is_frozen(G: Graph): ... -def add_star(G_to_add_to, nodes_for_star, **attr): ... -def add_path(G_to_add_to, nodes_for_path, **attr): ... -def add_cycle(G_to_add_to, nodes_for_cycle, **attr): ... -def subgraph(G: Graph, nbunch: ArrayLike | Iterable): ... -def induced_subgraph(G: Graph, nbunch): ... -def edge_subgraph(G: Graph, edges: Iterable): ... -def restricted_view(G: Graph, nodes: Iterable, edges: Iterable): ... -def to_directed(graph): ... -def to_undirected(graph): ... -def create_empty_copy(G: Graph, with_data=True): ... -def info(G: Graph, n=None) -> str: ... -def set_node_attributes(G: Graph, values, name=None): ... -def get_node_attributes(G: Graph, name: str): ... -def set_edge_attributes(G: Graph, values, name=None): ... -def get_edge_attributes(G: Graph, name: str): ... -def all_neighbors(graph, node): ... -def non_neighbors(graph, node): ... -def non_edges(graph): ... -def common_neighbors(G: Graph, u, v): ... -def is_weighted(G: Graph, edge: tuple | None = None, weight: str = "weight") -> bool: ... -def is_negatively_weighted(G: Graph, edge: tuple | None = None, weight: str = "weight") -> bool: ... -def is_empty(G: Graph) -> bool: ... -def nodes_with_selfloops(G: Graph): ... -def selfloop_edges(G: Graph, data=False, keys=False, default=None): ... -def number_of_selfloops(G: Graph) -> int: ... -def is_path(G: Graph, path: ArrayLike) -> bool: ... -def path_weight(G: Graph, path: ArrayLike, weight: str) -> int | float: ... diff --git a/stubs/networkx/classes/graph.pyi b/stubs/networkx/classes/graph.pyi deleted file mode 100644 index 81c08846..00000000 --- a/stubs/networkx/classes/graph.pyi +++ /dev/null @@ -1,80 +0,0 @@ -from collections.abc import Iterable, Mapping -from copy import deepcopy -from functools import cached_property - -import networkx.convert as convert -from numpy.typing import ArrayLike - -from ..classes.coreviews import AdjacencyView -from ..classes.digraph import DiGraph -from ..classes.reportviews import DegreeView, EdgeView, NodeView -from ..exception import NetworkXError - -__all__ = ["Graph"] - -class _CachedPropertyResetterAdj: - def __set__(self, obj, value): ... - -class _CachedPropertyResetterNode: - def __set__(self, obj, value): ... - -class Graph: - graph = ... - _adj = ... - _node = ... - - node_dict_factory = ... - node_attr_dict_factory = ... - adjlist_outer_dict_factory = ... - adjlist_inner_dict_factory = ... - edge_attr_dict_factory = ... - graph_attr_dict_factory = ... - - def to_directed_class(self): ... - def to_undirected_class(self): ... - def __init__(self, incoming_graph_data=None, **attr): ... - @cached_property - def adj(self): ... - @property - def name(self): ... - @name.setter - def name(self, s): ... - def __iter__(self): ... - def __contains__(self, n): ... - def __len__(self) -> int: ... - def __getitem__(self, n) -> Mapping: ... - def add_node(self, node_for_adding, **attr): ... - def add_nodes_from(self, nodes_for_adding, **attr): ... - def remove_node(self, n): ... - def remove_nodes_from(self, nodes): ... - @cached_property - def nodes(self) -> NodeView: ... - def number_of_nodes(self) -> int: ... - def order(self) -> int: ... - def has_node(self, n): ... - def add_edge(self, u_of_edge, v_of_edge, **attr): ... - def add_edges_from(self, ebunch_to_add, **attr): ... - def add_weighted_edges_from(self, ebunch_to_add, weight="weight", **attr): ... - def remove_edge(self, u, v): ... - def remove_edges_from(self, ebunch): ... - def update(self, edges=None, nodes=None): ... - def has_edge(self, u, v) -> bool: ... - def neighbors(self, n): ... - @cached_property - def edges(self) -> EdgeView: ... - def get_edge_data(self, u, v, default=None) -> Mapping: ... - def adjacency(self): ... - @cached_property - def degree(self) -> DegreeView | int: ... - def clear(self): ... - def clear_edges(self): ... - def is_multigraph(self): ... - def is_directed(self): ... - def copy(self, as_view=False) -> Graph: ... - def to_directed(self, as_view=False) -> DiGraph: ... - def to_undirected(self, as_view=False): ... - def subgraph(self, nodes: ArrayLike | Iterable): ... - def edge_subgraph(self, edges: Iterable) -> Graph: ... - def size(self, weight=None): ... - def number_of_edges(self, u=None, v=None) -> int: ... - def nbunch_iter(self, nbunch=None): ... diff --git a/stubs/networkx/classes/graphviews.pyi b/stubs/networkx/classes/graphviews.pyi deleted file mode 100644 index ffd62a6f..00000000 --- a/stubs/networkx/classes/graphviews.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Callable - -from networkx import DiGraph, Graph - -from ..classes.coreviews import FilterAdjacency, FilterAtlas, FilterMultiAdjacency, UnionAdjacency, UnionMultiAdjacency -from ..classes.filters import no_filter -from ..exception import NetworkXError -from ..utils import not_implemented_for - -__all__ = ["generic_graph_view", "subgraph_view", "reverse_view"] - -def generic_graph_view(G: Graph, create_using=None): ... -def subgraph_view(G: Graph, filter_node: Callable = ..., filter_edge: Callable = ...) -> Graph: ... -def reverse_view(G: DiGraph) -> DiGraph: ... diff --git a/stubs/networkx/classes/multidigraph.pyi b/stubs/networkx/classes/multidigraph.pyi deleted file mode 100644 index 353a09a9..00000000 --- a/stubs/networkx/classes/multidigraph.pyi +++ /dev/null @@ -1,47 +0,0 @@ -from copy import deepcopy -from functools import cached_property - -import networkx.convert as convert - -from ..classes.coreviews import MultiAdjacencyView -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..classes.multigraph import MultiGraph -from ..classes.reportviews import DiMultiDegreeView, InMultiDegreeView, InMultiEdgeView, OutMultiDegreeView, OutMultiEdgeView -from ..exception import NetworkXError - -__all__ = ["MultiDiGraph"] - -class MultiDiGraph(MultiGraph, DiGraph): - # node_dict_factory = dict # already assigned in Graph - # adjlist_outer_dict_factory = dict - # adjlist_inner_dict_factory = dict - edge_key_dict_factory = ... - # edge_attr_dict_factory = dict - def __init__(self, incoming_graph_data=None, multigraph_input=None, **attr): ... - @cached_property - def adj(self): ... - @cached_property - def succ(self): ... - @cached_property - def pred(self): ... - def add_edge(self, u_for_edge, v_for_edge, key=None, **attr): ... - def remove_edge(self, u, v, key=None): ... - @cached_property - def edges(self) -> OutMultiEdgeView: ... - - # alias out_edges to edges - @cached_property - def out_edges(self) -> OutMultiEdgeView: ... - @cached_property - def in_edges(self) -> InMultiEdgeView: ... - @cached_property - def degree(self) -> DiMultiDegreeView | int: ... - @cached_property - def in_degree(self): ... - @cached_property - def out_degree(self): ... - def is_multigraph(self): ... - def is_directed(self): ... - def to_undirected(self, reciprocal=False, as_view=False) -> MultiGraph: ... - def reverse(self, copy=True): ... diff --git a/stubs/networkx/classes/multigraph.pyi b/stubs/networkx/classes/multigraph.pyi deleted file mode 100644 index 58ed6804..00000000 --- a/stubs/networkx/classes/multigraph.pyi +++ /dev/null @@ -1,42 +0,0 @@ -from collections.abc import Mapping -from copy import deepcopy -from functools import cached_property - -import networkx.convert as convert -from networkx import NetworkXError - -from ..classes.coreviews import MultiAdjacencyView -from ..classes.graph import Graph -from ..classes.multidigraph import MultiDiGraph -from ..classes.reportviews import MultiDegreeView, MultiEdgeView - -__all__ = ["MultiGraph"] - -class MultiGraph(Graph): - # node_dict_factory = dict # already assigned in Graph - # adjlist_outer_dict_factory = dict - # adjlist_inner_dict_factory = dict - edge_key_dict_factory = ... - # edge_attr_dict_factory = dict - def to_directed_class(self): ... - def to_undirected_class(self): ... - def __init__(self, incoming_graph_data=None, multigraph_input=None, **attr): ... - @cached_property - def adj(self): ... - def new_edge_key(self, u, v) -> int: ... - def add_edge(self, u_for_edge, v_for_edge, key=None, **attr): ... - def add_edges_from(self, ebunch_to_add, **attr): ... - def remove_edge(self, u, v, key=None): ... - def remove_edges_from(self, ebunch): ... - def has_edge(self, u, v, key=None) -> bool: ... - @cached_property - def edges(self) -> MultiEdgeView: ... - def get_edge_data(self, u, v, key=None, default=None) -> Mapping: ... - @cached_property - def degree(self) -> MultiDegreeView | int: ... - def is_multigraph(self): ... - def is_directed(self): ... - def copy(self, as_view=False) -> Graph: ... - def to_directed(self, as_view=False) -> MultiDiGraph: ... - def to_undirected(self, as_view=False): ... - def number_of_edges(self, u=None, v=None) -> int: ... diff --git a/stubs/networkx/classes/ordered.pyi b/stubs/networkx/classes/ordered.pyi deleted file mode 100644 index ecc0e3ee..00000000 --- a/stubs/networkx/classes/ordered.pyi +++ /dev/null @@ -1,43 +0,0 @@ -import warnings -from collections import OrderedDict - -from .digraph import DiGraph -from .graph import Graph -from .multidigraph import MultiDiGraph -from .multigraph import MultiGraph - -__all__: list[str] = [] - -class OrderedGraph(Graph): - node_dict_factory = ... - adjlist_outer_dict_factory = ... - adjlist_inner_dict_factory = ... - edge_attr_dict_factory = ... - - def __init__(self, incoming_graph_data=None, **attr): ... - -class OrderedDiGraph(DiGraph): - node_dict_factory = ... - adjlist_outer_dict_factory = ... - adjlist_inner_dict_factory = ... - edge_attr_dict_factory = ... - - def __init__(self, incoming_graph_data=None, **attr): ... - -class OrderedMultiGraph(MultiGraph): - node_dict_factory = ... - adjlist_outer_dict_factory = ... - adjlist_inner_dict_factory = ... - edge_key_dict_factory = ... - edge_attr_dict_factory = ... - - def __init__(self, incoming_graph_data=None, **attr): ... - -class OrderedMultiDiGraph(MultiDiGraph): - node_dict_factory = ... - adjlist_outer_dict_factory = ... - adjlist_inner_dict_factory = ... - edge_key_dict_factory = ... - edge_attr_dict_factory = ... - - def __init__(self, incoming_graph_data=None, **attr): ... diff --git a/stubs/networkx/classes/reportviews.pyi b/stubs/networkx/classes/reportviews.pyi deleted file mode 100644 index 9c1843b9..00000000 --- a/stubs/networkx/classes/reportviews.pyi +++ /dev/null @@ -1,236 +0,0 @@ -from collections.abc import Mapping, Set as AbstractSet -from typing import Any - -from ..classes.graph import Graph - -__all__ = [ - "NodeView", - "NodeDataView", - "EdgeView", - "OutEdgeView", - "InEdgeView", - "EdgeDataView", - "OutEdgeDataView", - "InEdgeDataView", - "MultiEdgeView", - "OutMultiEdgeView", - "InMultiEdgeView", - "MultiEdgeDataView", - "OutMultiEdgeDataView", - "InMultiEdgeDataView", - "DegreeView", - "DiDegreeView", - "InDegreeView", - "OutDegreeView", - "MultiDegreeView", - "DiMultiDegreeView", - "InMultiDegreeView", - "OutMultiDegreeView", -] - -# NodeViews -class NodeView(Mapping, AbstractSet): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, graph): ... - - # Mapping methods - def __len__(self): ... - def __iter__(self): ... - def __getitem__(self, n): ... - - # Set methods - def __contains__(self, n): ... - @classmethod - def _from_iterable(cls, it): ... - - # DataView method - def __call__(self, data=False, default=None): ... - def data(self, data=True, default: Any = None) -> NodeDataView: ... - def __str__(self): ... - def __repr__(self): ... - -class NodeDataView(AbstractSet): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, nodedict, data=False, default=None): ... - @classmethod - def _from_iterable(cls, it): ... - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, n): ... - def __getitem__(self, n): ... - def __str__(self): ... - def __repr__(self): ... - -# DegreeViews -class DiDegreeView: - def __init__(self, G: Graph, nbunch=None, weight=None): ... - def __call__(self, nbunch=None, weight=None): ... - def __getitem__(self, n): ... - def __iter__(self): ... - def __len__(self): ... - def __str__(self): ... - def __repr__(self): ... - -class DegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class OutDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class InDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class MultiDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class DiMultiDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class InMultiDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -class OutMultiDegreeView(DiDegreeView): - def __getitem__(self, n): ... - def __iter__(self): ... - -# EdgeDataViews -class OutEdgeDataView: - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, viewer, nbunch=None, data=False, default=None): ... - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - def __str__(self): ... - def __repr__(self): ... - -class EdgeDataView(OutEdgeDataView): - __slots__ = ... - - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - -class InEdgeDataView(OutEdgeDataView): - __slots__ = ... - - def __iter__(self): ... - def __contains__(self, e): ... - -class OutMultiEdgeDataView(OutEdgeDataView): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - def __init__(self, viewer, nbunch=None, data=False, keys=False, default=None): ... - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - -class MultiEdgeDataView(OutMultiEdgeDataView): - __slots__ = ... - - def __iter__(self): ... - def __contains__(self, e): ... - -class InMultiEdgeDataView(OutMultiEdgeDataView): - __slots__ = ... - - def __iter__(self): ... - def __contains__(self, e): ... - -# EdgeViews have set operations and no data reported -class OutEdgeView(AbstractSet, Mapping): - __slots__ = ... - - def __getstate__(self): ... - def __setstate__(self, state): ... - @classmethod - def _from_iterable(cls, it): ... - - dataview = ... - - def __init__(self, G): ... - - # Set methods - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - - # Mapping Methods - def __getitem__(self, e): ... - - # EdgeDataView methods - def __call__(self, nbunch=None, data=False, default=None): ... - def data(self, data=True, default: Any = None, nbunch=None): ... - - # String Methods - def __str__(self): ... - def __repr__(self): ... - -class EdgeView(OutEdgeView): - __slots__ = ... - - dataview = ... - - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - -class InEdgeView(OutEdgeView): - __slots__ = ... - - def __setstate__(self, state): ... - - dataview = ... - - def __init__(self, G): ... - def __iter__(self): ... - def __contains__(self, e): ... - def __getitem__(self, e): ... - -class OutMultiEdgeView(OutEdgeView): - __slots__ = ... - - dataview = ... - - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, e): ... - def __getitem__(self, e): ... - def __call__(self, nbunch=None, data=False, keys=False, default=None): ... - def data(self, data=True, keys=False, default: Any = None, nbunch=None): ... - -class MultiEdgeView(OutMultiEdgeView): - __slots__ = ... - - dataview = ... - - def __len__(self): ... - def __iter__(self): ... - -class InMultiEdgeView(OutMultiEdgeView): - __slots__ = ... - - def __setstate__(self, state): ... - - dataview = ... - - def __init__(self, G): ... - def __iter__(self): ... - def __contains__(self, e): ... - def __getitem__(self, e): ... diff --git a/stubs/networkx/conftest.pyi b/stubs/networkx/conftest.pyi deleted file mode 100644 index 2f6b8d35..00000000 --- a/stubs/networkx/conftest.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import pytest - -def pytest_addoption(parser): ... -def pytest_configure(config): ... -def pytest_collection_modifyitems(config, items): ... -@pytest.fixture(autouse=True) -def set_warnings(): ... -@pytest.fixture(autouse=True) -def add_nx(doctest_namespace): ... - -# List of files that pytest should ignore - -collect_ignore: list = ... - -needs_numpy: list = ... -needs_scipy: list = ... -needs_matplotlib: list = ... -needs_pandas: list = ... -needs_yaml: list = ... -needs_pygraphviz: list = ... -needs_pydot: list = ... -needs_ogr: list = ... -needs_sympy: list = ... diff --git a/stubs/networkx/convert.pyi b/stubs/networkx/convert.pyi deleted file mode 100644 index ec398e3a..00000000 --- a/stubs/networkx/convert.pyi +++ /dev/null @@ -1,25 +0,0 @@ -import warnings -from collections.abc import Collection, Generator, Iterator, Mapping - -from numpy.typing import ArrayLike - -from ._typing import Scalar -from .classes.graph import Graph - -__all__ = [ - "to_networkx_graph", - "from_dict_of_dicts", - "to_dict_of_dicts", - "from_dict_of_lists", - "to_dict_of_lists", - "from_edgelist", - "to_edgelist", -] - -def to_networkx_graph(data, create_using=None, multigraph_input=False): ... -def to_dict_of_lists(G: Graph, nodelist: ArrayLike | None = None): ... -def from_dict_of_lists(d, create_using=None): ... -def to_dict_of_dicts(G: Graph, nodelist: ArrayLike | None = None, edge_data: Scalar | None = None) -> Mapping: ... -def from_dict_of_dicts(d: dict[dict, dict], create_using=None, multigraph_input=False): ... -def to_edgelist(G: Graph, nodelist: ArrayLike | None = None): ... -def from_edgelist(edgelist, create_using=None): ... diff --git a/stubs/networkx/convert_matrix.pyi b/stubs/networkx/convert_matrix.pyi deleted file mode 100644 index 0cd0fd54..00000000 --- a/stubs/networkx/convert_matrix.pyi +++ /dev/null @@ -1,95 +0,0 @@ -import itertools -import warnings -from collections import defaultdict -from typing import Callable, Literal - -from numpy.typing import ArrayLike - -from .classes.graph import Graph -from .utils import not_implemented_for - -__all__ = [ - "from_numpy_matrix", - "to_numpy_matrix", - "from_pandas_adjacency", - "to_pandas_adjacency", - "from_pandas_edgelist", - "to_pandas_edgelist", - "to_numpy_recarray", - "from_scipy_sparse_array", - "from_scipy_sparse_matrix", - "to_scipy_sparse_array", - "to_scipy_sparse_matrix", - "from_numpy_array", - "to_numpy_array", -] - -def to_pandas_adjacency( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - order=None, - multigraph_weight=..., - weight: str | None = "weight", - nonedge: float = 0.0, -): ... -def from_pandas_adjacency(df, create_using=None): ... -def to_pandas_edgelist( - G: Graph, - source: str | int = "source", - target: str | int = "target", - nodelist: ArrayLike | None = None, - dtype=None, - order=None, - edge_key=None, -): ... -def from_pandas_edgelist( - df, - source: str | int = "source", - target: str | int = "target", - edge_attr=None, - create_using=None, - edge_key=None, -): ... -def to_numpy_matrix( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - order: Literal["C", "F"] | None = None, - multigraph_weight=..., - weight="weight", - nonedge=0.0, -): ... -def from_numpy_matrix(A, parallel_edges: bool = False, create_using=None): ... -def to_numpy_recarray( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - order: Literal["C", "F"] | None = None, -): ... -def to_scipy_sparse_array( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - weight="weight", - format="csr", -): ... -def to_scipy_sparse_matrix( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - weight="weight", - format="csr", -): ... -def from_scipy_sparse_matrix(A, parallel_edges: bool = False, create_using=None, edge_attribute: str = "weight"): ... -def from_scipy_sparse_array(A, parallel_edges: bool = False, create_using=None, edge_attribute: str = "weight"): ... -def to_numpy_array( - G: Graph, - nodelist: ArrayLike | None = None, - dtype=None, - order: Literal["C", "F"] | None = None, - multigraph_weight: Callable = ..., - weight="weight", - nonedge=0.0, -): ... -def from_numpy_array(A, parallel_edges: bool = False, create_using=None): ... diff --git a/stubs/networkx/drawing/__init__.pyi b/stubs/networkx/drawing/__init__.pyi deleted file mode 100644 index 641d1e57..00000000 --- a/stubs/networkx/drawing/__init__.pyi +++ /dev/null @@ -1,33 +0,0 @@ -# graph drawing and interface to graphviz - -from . import nx_agraph as nx_agraph, nx_pydot as nx_pydot -from .layout import ( - bipartite_layout as bipartite_layout, - circular_layout as circular_layout, - fruchterman_reingold_layout as fruchterman_reingold_layout, - kamada_kawai_layout as kamada_kawai_layout, - multipartite_layout as multipartite_layout, - planar_layout as planar_layout, - random_layout as random_layout, - rescale_layout as rescale_layout, - rescale_layout_dict as rescale_layout_dict, - shell_layout as shell_layout, - spectral_layout as spectral_layout, - spiral_layout as spiral_layout, - spring_layout as spring_layout, -) -from .nx_pylab import ( - draw as draw, - draw_circular as draw_circular, - draw_kamada_kawai as draw_kamada_kawai, - draw_networkx as draw_networkx, - draw_networkx_edge_labels as draw_networkx_edge_labels, - draw_networkx_edges as draw_networkx_edges, - draw_networkx_labels as draw_networkx_labels, - draw_networkx_nodes as draw_networkx_nodes, - draw_planar as draw_planar, - draw_random as draw_random, - draw_shell as draw_shell, - draw_spectral as draw_spectral, - draw_spring as draw_spring, -) diff --git a/stubs/networkx/drawing/layout.pyi b/stubs/networkx/drawing/layout.pyi deleted file mode 100644 index 8b4dfecb..00000000 --- a/stubs/networkx/drawing/layout.pyi +++ /dev/null @@ -1,87 +0,0 @@ -from collections.abc import Mapping - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import np_random_state - -__all__ = [ - "bipartite_layout", - "circular_layout", - "kamada_kawai_layout", - "random_layout", - "rescale_layout", - "rescale_layout_dict", - "shell_layout", - "spring_layout", - "spectral_layout", - "planar_layout", - "fruchterman_reingold_layout", - "spiral_layout", - "multipartite_layout", -] - -@np_random_state(3) -def random_layout(G: Graph, center: ArrayLike | None = None, dim: int = 2, seed=None) -> Mapping: ... -def circular_layout(G: Graph, scale=1, center: ArrayLike | None = None, dim: int = 2) -> Mapping: ... -def shell_layout( - G: Graph, - nlist=None, - rotate=None, - scale=1, - center: ArrayLike | None = None, - dim: int = 2, -) -> Mapping: ... -def bipartite_layout( - G: Graph, - nodes, - align="vertical", - scale=1, - center: ArrayLike | None = None, - aspect_ratio=..., -) -> Mapping: ... -@np_random_state(10) -def spring_layout( - G: Graph, - k=None, - pos=None, - fixed=None, - iterations=50, - threshold=1e-4, - weight="weight", - scale=1, - center: ArrayLike | None = None, - dim: int = 2, - seed=None, -) -> Mapping: ... - -fruchterman_reingold_layout = ... - -def kamada_kawai_layout( - G: Graph, - dist=None, - pos=None, - weight="weight", - scale=1, - center: ArrayLike | None = None, - dim: int = 2, -) -> Mapping: ... -def spectral_layout(G: Graph, weight="weight", scale=1, center: ArrayLike | None = None, dim: int = 2) -> Mapping: ... -def planar_layout(G: Graph, scale=1, center: ArrayLike | None = None, dim: int = 2) -> Mapping: ... -def spiral_layout( - G: Graph, - scale=1, - center: ArrayLike | None = None, - dim: int = 2, - resolution: float = 0.35, - equidistant: bool = False, -) -> Mapping: ... -def multipartite_layout( - G: Graph, - subset_key="subset", - align="vertical", - scale=1, - center: ArrayLike | None = None, -) -> Mapping: ... -def rescale_layout(pos, scale=1): ... -def rescale_layout_dict(pos, scale=1): ... diff --git a/stubs/networkx/drawing/nx_agraph.pyi b/stubs/networkx/drawing/nx_agraph.pyi deleted file mode 100644 index 1ccd1f83..00000000 --- a/stubs/networkx/drawing/nx_agraph.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import os -import tempfile -from collections.abc import Mapping -from typing import Callable - -from ..classes.graph import Graph - -__all__ = [ - "from_agraph", - "to_agraph", - "write_dot", - "read_dot", - "graphviz_layout", - "pygraphviz_layout", - "view_pygraphviz", -] - -def from_agraph(A, create_using=None): ... -def to_agraph(N): ... -def write_dot(G: Graph, path): ... -def read_dot(path): ... -def graphviz_layout(G: Graph, prog: str = "neato", root: str | None = None, args: str = ""): ... -def pygraphviz_layout(G: Graph, prog: str = "neato", root: str | None = None, args: str = "") -> Mapping: ... -def view_pygraphviz( - G: Graph, - edgelabel: str | Callable | None = None, - prog: str = "dot", - args: str = "", - suffix: str = "", - path: str | None = None, - show: bool = True, -): ... -def display_pygraphviz(graph, path, format: str | None = None, prog: str | None = None, args: str = ""): ... diff --git a/stubs/networkx/drawing/nx_pydot.pyi b/stubs/networkx/drawing/nx_pydot.pyi deleted file mode 100644 index f792a014..00000000 --- a/stubs/networkx/drawing/nx_pydot.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import warnings -from collections.abc import Mapping -from locale import getpreferredencoding - -from ..classes.graph import Graph -from ..classes.multidigraph import MultiDiGraph -from ..classes.multigraph import MultiGraph -from ..utils import open_file - -__all__ = [ - "write_dot", - "read_dot", - "graphviz_layout", - "pydot_layout", - "to_pydot", - "from_pydot", -] - -def write_dot(G: Graph, path): ... -def read_dot(path) -> MultiGraph | MultiDiGraph: ... -def from_pydot(P): ... -def to_pydot(N): ... -def graphviz_layout(G: Graph, prog="neato", root=None): ... -def pydot_layout(G: Graph, prog="neato", root=None) -> Mapping: ... diff --git a/stubs/networkx/drawing/nx_pylab.pyi b/stubs/networkx/drawing/nx_pylab.pyi deleted file mode 100644 index 3545ae53..00000000 --- a/stubs/networkx/drawing/nx_pylab.pyi +++ /dev/null @@ -1,121 +0,0 @@ -from collections.abc import Mapping -from numbers import Number - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..drawing.layout import ( - circular_layout, - kamada_kawai_layout, - planar_layout, - random_layout, - shell_layout, - spectral_layout, - spring_layout, -) - -__all__ = [ - "draw", - "draw_networkx", - "draw_networkx_nodes", - "draw_networkx_edges", - "draw_networkx_labels", - "draw_networkx_edge_labels", - "draw_circular", - "draw_kamada_kawai", - "draw_random", - "draw_spectral", - "draw_spring", - "draw_planar", - "draw_shell", -] - -def draw(G: Graph, pos: Mapping | None = None, ax=None, **kwds): ... -def draw_networkx(G: Graph, pos: Mapping | None = None, arrows=None, with_labels=True, **kwds): ... -def draw_networkx_nodes( - G: Graph, - pos: Mapping, - nodelist=None, - node_size=300, - node_color="#1f78b4", - node_shape="o", - alpha=None, - cmap=None, - vmin=None, - vmax=None, - ax=None, - linewidths=None, - edgecolors=None, - label=None, - margins=None, -): ... -def draw_networkx_edges( - G: Graph, - pos: Mapping, - edgelist=None, - width=1.0, - edge_color="k", - style="solid", - alpha=None, - arrowstyle=None, - arrowsize=10, - edge_cmap=None, - edge_vmin: float | None = None, - edge_vmax: float | None = None, - ax=None, - arrows=None, - label: str | None = None, - node_size=300, - nodelist=None, - node_shape="o", - connectionstyle="arc3", - min_source_margin=0, - min_target_margin=0, -): ... -def draw_networkx_labels( - G: Graph, - pos: Mapping, - labels=None, - font_size=12, - font_color="k", - font_family="sans-serif", - font_weight="normal", - alpha=None, - bbox=None, - horizontalalignment="center", - verticalalignment="center", - ax=None, - clip_on=True, -) -> Mapping: ... -def draw_networkx_edge_labels( - G: Graph, - pos: Mapping, - edge_labels=None, - label_pos=0.5, - font_size=10, - font_color="k", - font_family="sans-serif", - font_weight="normal", - alpha=None, - bbox=None, - horizontalalignment="center", - verticalalignment="center", - ax=None, - rotate=True, - clip_on=True, -) -> Mapping: ... -def draw_circular(G: Graph, **kwargs): ... -def draw_kamada_kawai(G: Graph, **kwargs): ... -def draw_random(G: Graph, **kwargs): ... -def draw_spectral(G: Graph, **kwargs): ... -def draw_spring(G: Graph, **kwargs): ... -def draw_shell(G: Graph, nlist=None, **kwargs): ... -def draw_planar(G: Graph, **kwargs): ... -def apply_alpha( - colors, - alpha: float | ArrayLike, - elem_list, - cmap=None, - vmin: float | None = None, - vmax: float | None = None, -): ... diff --git a/stubs/networkx/exception.pyi b/stubs/networkx/exception.pyi deleted file mode 100644 index 73e7a089..00000000 --- a/stubs/networkx/exception.pyi +++ /dev/null @@ -1,33 +0,0 @@ -__all__ = [ - "HasACycle", - "NodeNotFound", - "PowerIterationFailedConvergence", - "ExceededMaxIterations", - "AmbiguousSolution", - "NetworkXAlgorithmError", - "NetworkXException", - "NetworkXError", - "NetworkXNoCycle", - "NetworkXNoPath", - "NetworkXNotImplemented", - "NetworkXPointlessConcept", - "NetworkXUnbounded", - "NetworkXUnfeasible", -] - -class NetworkXException(Exception): ... -class NetworkXError(NetworkXException): ... -class NetworkXPointlessConcept(NetworkXException): ... -class NetworkXAlgorithmError(NetworkXException): ... -class NetworkXUnfeasible(NetworkXAlgorithmError): ... -class NetworkXNoPath(NetworkXUnfeasible): ... -class NetworkXNoCycle(NetworkXUnfeasible): ... -class HasACycle(NetworkXException): ... -class NetworkXUnbounded(NetworkXAlgorithmError): ... -class NetworkXNotImplemented(NetworkXException): ... -class NodeNotFound(NetworkXException): ... -class AmbiguousSolution(NetworkXException): ... -class ExceededMaxIterations(NetworkXException): ... - -class PowerIterationFailedConvergence(ExceededMaxIterations): - def __init__(self, num_iterations, *args, **kw): ... diff --git a/stubs/networkx/generators/__init__.pyi b/stubs/networkx/generators/__init__.pyi deleted file mode 100644 index a3a00fe8..00000000 --- a/stubs/networkx/generators/__init__.pyi +++ /dev/null @@ -1,155 +0,0 @@ -from .atlas import graph_atlas as graph_atlas, graph_atlas_g as graph_atlas_g -from .classic import ( - balanced_tree as balanced_tree, - barbell_graph as barbell_graph, - binomial_tree as binomial_tree, - circulant_graph as circulant_graph, - circular_ladder_graph as circular_ladder_graph, - complete_graph as complete_graph, - complete_multipartite_graph as complete_multipartite_graph, - cycle_graph as cycle_graph, - dorogovtsev_goltsev_mendes_graph as dorogovtsev_goltsev_mendes_graph, - empty_graph as empty_graph, - full_rary_tree as full_rary_tree, - ladder_graph as ladder_graph, - lollipop_graph as lollipop_graph, - null_graph as null_graph, - path_graph as path_graph, - star_graph as star_graph, - trivial_graph as trivial_graph, - turan_graph as turan_graph, - wheel_graph as wheel_graph, -) -from .cographs import random_cograph as random_cograph -from .community import ( - LFR_benchmark_graph as LFR_benchmark_graph, - caveman_graph as caveman_graph, - connected_caveman_graph as connected_caveman_graph, - gaussian_random_partition_graph as gaussian_random_partition_graph, - planted_partition_graph as planted_partition_graph, - random_partition_graph as random_partition_graph, - relaxed_caveman_graph as relaxed_caveman_graph, - ring_of_cliques as ring_of_cliques, - stochastic_block_model as stochastic_block_model, - windmill_graph as windmill_graph, -) -from .degree_seq import ( - configuration_model as configuration_model, - degree_sequence_tree as degree_sequence_tree, - directed_configuration_model as directed_configuration_model, - directed_havel_hakimi_graph as directed_havel_hakimi_graph, - expected_degree_graph as expected_degree_graph, - havel_hakimi_graph as havel_hakimi_graph, - random_degree_sequence_graph as random_degree_sequence_graph, -) -from .directed import ( - gn_graph as gn_graph, - gnc_graph as gnc_graph, - gnr_graph as gnr_graph, - random_k_out_graph as random_k_out_graph, - scale_free_graph as scale_free_graph, -) -from .duplication import ( - duplication_divergence_graph as duplication_divergence_graph, - partial_duplication_graph as partial_duplication_graph, -) -from .ego import ego_graph as ego_graph -from .expanders import ( - chordal_cycle_graph as chordal_cycle_graph, - margulis_gabber_galil_graph as margulis_gabber_galil_graph, - paley_graph as paley_graph, -) -from .geometric import ( - geographical_threshold_graph as geographical_threshold_graph, - geometric_edges as geometric_edges, - navigable_small_world_graph as navigable_small_world_graph, - random_geometric_graph as random_geometric_graph, - soft_random_geometric_graph as soft_random_geometric_graph, - thresholded_random_geometric_graph as thresholded_random_geometric_graph, - waxman_graph as waxman_graph, -) -from .internet_as_graphs import random_internet_as_graph as random_internet_as_graph -from .intersection import ( - general_random_intersection_graph as general_random_intersection_graph, - k_random_intersection_graph as k_random_intersection_graph, - uniform_random_intersection_graph as uniform_random_intersection_graph, -) -from .interval_graph import interval_graph as interval_graph -from .joint_degree_seq import ( - directed_joint_degree_graph as directed_joint_degree_graph, - is_valid_directed_joint_degree as is_valid_directed_joint_degree, - is_valid_joint_degree as is_valid_joint_degree, - joint_degree_graph as joint_degree_graph, -) -from .lattice import ( - grid_2d_graph as grid_2d_graph, - grid_graph as grid_graph, - hexagonal_lattice_graph as hexagonal_lattice_graph, - hypercube_graph as hypercube_graph, - triangular_lattice_graph as triangular_lattice_graph, -) -from .line import inverse_line_graph as inverse_line_graph, line_graph as line_graph -from .mycielski import mycielski_graph as mycielski_graph, mycielskian as mycielskian -from .nonisomorphic_trees import ( - nonisomorphic_trees as nonisomorphic_trees, - number_of_nonisomorphic_trees as number_of_nonisomorphic_trees, -) -from .random_clustered import random_clustered_graph as random_clustered_graph -from .random_graphs import ( - barabasi_albert_graph as barabasi_albert_graph, - binomial_graph as binomial_graph, - connected_watts_strogatz_graph as connected_watts_strogatz_graph, - dense_gnm_random_graph as dense_gnm_random_graph, - dual_barabasi_albert_graph as dual_barabasi_albert_graph, - erdos_renyi_graph as erdos_renyi_graph, - extended_barabasi_albert_graph as extended_barabasi_albert_graph, - fast_gnp_random_graph as fast_gnp_random_graph, - gnm_random_graph as gnm_random_graph, - gnp_random_graph as gnp_random_graph, - newman_watts_strogatz_graph as newman_watts_strogatz_graph, - powerlaw_cluster_graph as powerlaw_cluster_graph, - random_kernel_graph as random_kernel_graph, - random_lobster as random_lobster, - random_powerlaw_tree as random_powerlaw_tree, - random_powerlaw_tree_sequence as random_powerlaw_tree_sequence, - random_regular_graph as random_regular_graph, - random_shell_graph as random_shell_graph, - watts_strogatz_graph as watts_strogatz_graph, -) -from .small import ( - LCF_graph as LCF_graph, - bull_graph as bull_graph, - chvatal_graph as chvatal_graph, - cubical_graph as cubical_graph, - desargues_graph as desargues_graph, - diamond_graph as diamond_graph, - dodecahedral_graph as dodecahedral_graph, - frucht_graph as frucht_graph, - heawood_graph as heawood_graph, - hoffman_singleton_graph as hoffman_singleton_graph, - house_graph as house_graph, - house_x_graph as house_x_graph, - icosahedral_graph as icosahedral_graph, - krackhardt_kite_graph as krackhardt_kite_graph, - make_small_graph as make_small_graph, - moebius_kantor_graph as moebius_kantor_graph, - octahedral_graph as octahedral_graph, - pappus_graph as pappus_graph, - petersen_graph as petersen_graph, - sedgewick_maze_graph as sedgewick_maze_graph, - tetrahedral_graph as tetrahedral_graph, - truncated_cube_graph as truncated_cube_graph, - truncated_tetrahedron_graph as truncated_tetrahedron_graph, - tutte_graph as tutte_graph, -) -from .social import ( - davis_southern_women_graph as davis_southern_women_graph, - florentine_families_graph as florentine_families_graph, - karate_club_graph as karate_club_graph, - les_miserables_graph as les_miserables_graph, -) -from .spectral_graph_forge import spectral_graph_forge as spectral_graph_forge -from .stochastic import stochastic_graph as stochastic_graph -from .sudoku import sudoku_graph as sudoku_graph -from .trees import prefix_tree as prefix_tree, prefix_tree_recursive as prefix_tree_recursive, random_tree as random_tree -from .triads import triad_graph as triad_graph diff --git a/stubs/networkx/generators/atlas.pyi b/stubs/networkx/generators/atlas.pyi deleted file mode 100644 index 62820a93..00000000 --- a/stubs/networkx/generators/atlas.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from importlib.abc import Traversable -from typing import Final - -from numpy.typing import ArrayLike - -__all__ = ["graph_atlas", "graph_atlas_g"] - -NUM_GRAPHS: Final = 1253 -ATLAS_FILE: Traversable - -def graph_atlas(i: int) -> ArrayLike: ... -def graph_atlas_g() -> ArrayLike: ... diff --git a/stubs/networkx/generators/classic.pyi b/stubs/networkx/generators/classic.pyi deleted file mode 100644 index e0e7c52a..00000000 --- a/stubs/networkx/generators/classic.pyi +++ /dev/null @@ -1,59 +0,0 @@ -import itertools -import numbers -from collections.abc import Iterable - -from ..classes import Graph -from ..exception import NetworkXError -from ..utils import nodes_or_number, pairwise - -__all__ = [ - "balanced_tree", - "barbell_graph", - "binomial_tree", - "complete_graph", - "complete_multipartite_graph", - "circular_ladder_graph", - "circulant_graph", - "cycle_graph", - "dorogovtsev_goltsev_mendes_graph", - "empty_graph", - "full_rary_tree", - "ladder_graph", - "lollipop_graph", - "null_graph", - "path_graph", - "star_graph", - "trivial_graph", - "turan_graph", - "wheel_graph", -] - -# ------------------------------------------------------------------- -# Some Classic Graphs -# ------------------------------------------------------------------- - -def full_rary_tree(r: int, n: int, create_using=None): ... -def balanced_tree(r: int, h: int, create_using=None): ... -def barbell_graph(m1, m2, create_using=None): ... -def binomial_tree(n: int, create_using=None): ... -@nodes_or_number(0) -def complete_graph(n, create_using=None): ... -def circular_ladder_graph(n, create_using=None): ... -def circulant_graph(n, offsets, create_using=None): ... -@nodes_or_number(0) -def cycle_graph(n, create_using=None): ... -def dorogovtsev_goltsev_mendes_graph(n, create_using=None): ... -@nodes_or_number(0) -def empty_graph(n=0, create_using=None, default=...): ... -def ladder_graph(n, create_using=None): ... -def lollipop_graph(m, n, create_using=None): ... -def null_graph(create_using=None): ... -@nodes_or_number(0) -def path_graph(n: int | Iterable, create_using=None): ... -@nodes_or_number(0) -def star_graph(n: int | Iterable, create_using=None): ... -def trivial_graph(create_using=None): ... -def turan_graph(n: int, r: int): ... -@nodes_or_number(0) -def wheel_graph(n: int | Iterable, create_using=None): ... -def complete_multipartite_graph(*subset_sizes): ... diff --git a/stubs/networkx/generators/cographs.pyi b/stubs/networkx/generators/cographs.pyi deleted file mode 100644 index 983d4473..00000000 --- a/stubs/networkx/generators/cographs.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = ["random_cograph"] - -@py_random_state(1) -def random_cograph(n: int, seed=None): ... diff --git a/stubs/networkx/generators/community.pyi b/stubs/networkx/generators/community.pyi deleted file mode 100644 index e12cfe6f..00000000 --- a/stubs/networkx/generators/community.pyi +++ /dev/null @@ -1,58 +0,0 @@ -import itertools -import math - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = [ - "caveman_graph", - "connected_caveman_graph", - "relaxed_caveman_graph", - "random_partition_graph", - "planted_partition_graph", - "gaussian_random_partition_graph", - "ring_of_cliques", - "windmill_graph", - "stochastic_block_model", - "LFR_benchmark_graph", -] - -def caveman_graph(l: int, k: int): ... -def connected_caveman_graph(l: int, k: int): ... -@py_random_state(3) -def relaxed_caveman_graph(l: int, k: int, p: float, seed=None): ... -@py_random_state(3) -def random_partition_graph(sizes: ArrayLike, p_in: float, p_out: float, seed=None, directed=False): ... -@py_random_state(4) -def planted_partition_graph(l: int, k: int, p_in: float, p_out: float, seed=None, directed=False): ... -@py_random_state(6) -def gaussian_random_partition_graph(n: int, s: float, v: float, p_in: float, p_out: float, directed=False, seed=None): ... -def ring_of_cliques(num_cliques: int, clique_size: int): ... -def windmill_graph(n: int, k: int): ... -@py_random_state(3) -def stochastic_block_model( - sizes: ArrayLike, - p, - nodelist: ArrayLike | None = None, - seed=None, - directed=False, - selfloops=False, - sparse=True, -): ... -@py_random_state(11) -def LFR_benchmark_graph( - n: int, - tau1: float, - tau2: float, - mu: float, - average_degree: float | None = None, - min_degree: int | None = None, - max_degree: int | None = None, - min_community: int | None = None, - max_community: int | None = None, - tol: float = 1.0e-7, - max_iters: int = 500, - seed=None, -): ... diff --git a/stubs/networkx/generators/degree_seq.pyi b/stubs/networkx/generators/degree_seq.pyi deleted file mode 100644 index fa7bb9a5..00000000 --- a/stubs/networkx/generators/degree_seq.pyi +++ /dev/null @@ -1,49 +0,0 @@ -import heapq -import math -from itertools import chain, combinations, zip_longest -from operator import itemgetter - -from numpy.typing import ArrayLike - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..classes.multidigraph import MultiDiGraph -from ..classes.multigraph import MultiGraph -from ..utils import py_random_state, random_weighted_sample - -__all__ = [ - "configuration_model", - "directed_configuration_model", - "expected_degree_graph", - "havel_hakimi_graph", - "directed_havel_hakimi_graph", - "degree_sequence_tree", - "random_degree_sequence_graph", -] - -chaini = ... - -@py_random_state(2) -def configuration_model(deg_sequence, create_using=None, seed=None) -> MultiGraph: ... -@py_random_state(3) -def directed_configuration_model(in_degree_sequence, out_degree_sequence, create_using=None, seed=None) -> MultiDiGraph: ... -@py_random_state(1) -def expected_degree_graph(w: ArrayLike, seed=None, selfloops=True) -> Graph: ... -def havel_hakimi_graph(deg_sequence, create_using=None): ... -def directed_havel_hakimi_graph(in_deg_sequence, out_deg_sequence, create_using=None) -> DiGraph: ... -def degree_sequence_tree(deg_sequence, create_using=None): ... -@py_random_state(1) -def random_degree_sequence_graph(sequence, seed=None, tries: int = 10) -> Graph: ... - -class DegreeSequenceRandomGraph: - # class to generate random graphs with a given degree sequence - # use random_degree_sequence_graph() - def __init__(self, degree, rng): ... - def generate(self): ... - def update_remaining(self, u, v, aux_graph=None): ... - def p(self, u, v): ... - def q(self, u, v): ... - def suitable_edge(self): ... - def phase1(self): ... - def phase2(self): ... - def phase3(self): ... diff --git a/stubs/networkx/generators/directed.pyi b/stubs/networkx/generators/directed.pyi deleted file mode 100644 index 1f7a5120..00000000 --- a/stubs/networkx/generators/directed.pyi +++ /dev/null @@ -1,38 +0,0 @@ -import numbers -from collections import Counter - -from ..classes import MultiDiGraph -from ..classes.graph import Graph -from ..generators.classic import empty_graph -from ..utils import discrete_sequence, py_random_state, weighted_choice - -__all__ = [ - "gn_graph", - "gnc_graph", - "gnr_graph", - "random_k_out_graph", - "scale_free_graph", -] - -@py_random_state(3) -def gn_graph(n: int, kernel=None, create_using=None, seed=None): ... -@py_random_state(3) -def gnr_graph(n: int, p: float, create_using=None, seed=None): ... -@py_random_state(2) -def gnc_graph(n: int, create_using=None, seed=None): ... -@py_random_state(7) -def scale_free_graph( - n, - alpha: float = 0.41, - beta: float = 0.54, - gamma: float = 0.05, - delta_in: float = 0.2, - delta_out: float = 0, - create_using=None, - seed=None, - initial_graph=None, -) -> MultiDiGraph: ... -@py_random_state(4) -def random_uniform_k_out_graph(n: int, k: int, self_loops: bool = True, with_replacement: bool = True, seed=None): ... -@py_random_state(4) -def random_k_out_graph(n: int, k: int, alpha: float, self_loops: bool = True, seed=None) -> MultiDiGraph: ... diff --git a/stubs/networkx/generators/duplication.pyi b/stubs/networkx/generators/duplication.pyi deleted file mode 100644 index 84189998..00000000 --- a/stubs/networkx/generators/duplication.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..utils import py_random_state - -__all__ = ["partial_duplication_graph", "duplication_divergence_graph"] - -@py_random_state(4) -def partial_duplication_graph(N: int, n: int, p: float, q: float, seed=None): ... -@py_random_state(2) -def duplication_divergence_graph(n: int, p: float, seed=None) -> Graph: ... diff --git a/stubs/networkx/generators/ego.pyi b/stubs/networkx/generators/ego.pyi deleted file mode 100644 index 3f603002..00000000 --- a/stubs/networkx/generators/ego.pyi +++ /dev/null @@ -1,5 +0,0 @@ -__all__ = ["ego_graph"] - -from ..classes.graph import Graph - -def ego_graph(G: Graph, n, radius=1, center: bool = True, undirected: bool = False, distance=None): ... diff --git a/stubs/networkx/generators/expanders.pyi b/stubs/networkx/generators/expanders.pyi deleted file mode 100644 index ab0f75da..00000000 --- a/stubs/networkx/generators/expanders.pyi +++ /dev/null @@ -1,41 +0,0 @@ -import itertools - -from ..classes.graph import Graph - -__all__ = ["margulis_gabber_galil_graph", "chordal_cycle_graph", "paley_graph"] - -# Other discrete torus expanders can be constructed by using the following edge -# sets. For more information, see Chapter 4, "Expander Graphs", in -# "Pseudorandomness", by Salil Vadhan. -# -# For a directed expander, add edges from (x, y) to: -# -# (x, y), -# ((x + 1) % n, y), -# (x, (y + 1) % n), -# (x, (x + y) % n), -# (-y % n, x) -# -# For an undirected expander, add the reverse edges. -# -# Also appearing in the paper of Gabber and Galil: -# -# (x, y), -# (x, (x + y) % n), -# (x, (x + y + 1) % n), -# ((x + y) % n, y), -# ((x + y + 1) % n, y) -# -# and: -# -# (x, y), -# ((x + 2*y) % n, y), -# ((x + (2*y + 1)) % n, y), -# ((x + (2*y + 2)) % n, y), -# (x, (y + 2*x) % n), -# (x, (y + (2*x + 1)) % n), -# (x, (y + (2*x + 2)) % n), -# -def margulis_gabber_galil_graph(n: int, create_using=None): ... -def chordal_cycle_graph(p, create_using=None): ... -def paley_graph(p, create_using=None): ... diff --git a/stubs/networkx/generators/geometric.pyi b/stubs/networkx/generators/geometric.pyi deleted file mode 100644 index ba2432ac..00000000 --- a/stubs/networkx/generators/geometric.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import math -from bisect import bisect_left -from collections.abc import Iterable, Mapping -from itertools import accumulate, combinations, product - -from numpy.typing import ArrayLike - -from .._typing import Scalar -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = [ - "geometric_edges", - "geographical_threshold_graph", - "navigable_small_world_graph", - "random_geometric_graph", - "soft_random_geometric_graph", - "thresholded_random_geometric_graph", - "waxman_graph", -] - -def euclidean(x, y): ... -def geometric_edges(G: Graph, radius: Scalar, p: Scalar = 2) -> ArrayLike: ... -@py_random_state(5) -def random_geometric_graph( - n: int | Iterable, - radius: float, - dim: int = 2, - pos: Mapping | None = None, - p: float = 2, - seed=None, -) -> Graph: ... -@py_random_state(6) -def soft_random_geometric_graph( - n: int | Iterable, - radius: float, - dim: int = 2, - pos: Mapping | None = None, - p: float = 2, - p_dist=None, - seed=None, -) -> Graph: ... -@py_random_state(7) -def geographical_threshold_graph( - n: int | Iterable, - theta: float, - dim: int = 2, - pos: Mapping | None = None, - weight: Mapping | None = None, - metric=None, - p_dist=None, - seed=None, -) -> Graph: ... -@py_random_state(6) -def waxman_graph( - n: int | Iterable, - beta: float = 0.4, - alpha: float = 0.1, - L: float | None = None, - domain=..., - metric=None, - seed=None, -) -> Graph: ... -@py_random_state(5) -def navigable_small_world_graph(n: int, p: int = 1, q: int = 1, r: float = 2, dim: int = 2, seed=None): ... -@py_random_state(7) -def thresholded_random_geometric_graph( - n: int | Iterable, - radius: float, - theta: float, - dim: int = 2, - pos: Mapping | None = None, - weight: Mapping | None = None, - p=2, - seed=None, -) -> Graph: ... diff --git a/stubs/networkx/generators/harary_graph.pyi b/stubs/networkx/generators/harary_graph.pyi deleted file mode 100644 index 056bd8f6..00000000 --- a/stubs/networkx/generators/harary_graph.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes.graph import Graph -from ..exception import NetworkXError - -__all__ = ["hnm_harary_graph", "hkn_harary_graph"] - -def hnm_harary_graph(n, m, create_using=None): ... -def hkn_harary_graph(k, n, create_using=None): ... diff --git a/stubs/networkx/generators/internet_as_graphs.pyi b/stubs/networkx/generators/internet_as_graphs.pyi deleted file mode 100644 index 9a917700..00000000 --- a/stubs/networkx/generators/internet_as_graphs.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from collections.abc import Mapping -from typing import Any - -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = ["random_internet_as_graph"] - -def uniform_int_from_avg(a, m, seed): ... -def choose_pref_attach(degs: Mapping, seed) -> Any: ... - -class AS_graph_generator: - def __init__(self, n, seed): ... - def t_graph(self): ... - def add_edge(self, i, j, kind): ... - def choose_peer_pref_attach(self, node_list): ... - def choose_node_pref_attach(self, node_list): ... - def add_customer(self, i, j): ... - def add_node(self, i: Any, kind: str, reg2prob: float, avg_deg: float, t_edge_prob: float) -> Any: ... - def add_m_peering_link(self, m: Any, to_kind: str) -> bool: ... - def add_cp_peering_link(self, cp: Any, to_kind: str) -> bool: ... - def graph_regions(self, rn): ... - def add_peering_links(self, from_kind, to_kind): ... - def generate(self): ... - -@py_random_state(1) -def random_internet_as_graph(n, seed=None): ... diff --git a/stubs/networkx/generators/intersection.pyi b/stubs/networkx/generators/intersection.pyi deleted file mode 100644 index 465fe46e..00000000 --- a/stubs/networkx/generators/intersection.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = [ - "uniform_random_intersection_graph", - "k_random_intersection_graph", - "general_random_intersection_graph", -] - -@py_random_state(3) -def uniform_random_intersection_graph(n: int, m: int, p: float, seed=None): ... -@py_random_state(3) -def k_random_intersection_graph(n: int, m: int, k: float, seed=None): ... -@py_random_state(3) -def general_random_intersection_graph(n: int, m: int, p, seed=None): ... diff --git a/stubs/networkx/generators/interval_graph.pyi b/stubs/networkx/generators/interval_graph.pyi deleted file mode 100644 index 03706b2a..00000000 --- a/stubs/networkx/generators/interval_graph.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from collections.abc import Sequence - -from ..classes.graph import Graph - -__all__ = ["interval_graph"] - -def interval_graph(intervals): ... diff --git a/stubs/networkx/generators/joint_degree_seq.pyi b/stubs/networkx/generators/joint_degree_seq.pyi deleted file mode 100644 index 9f54f6c3..00000000 --- a/stubs/networkx/generators/joint_degree_seq.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = [ - "is_valid_joint_degree", - "is_valid_directed_joint_degree", - "joint_degree_graph", - "directed_joint_degree_graph", -] - -def is_valid_joint_degree(joint_degrees) -> bool: ... -@py_random_state(1) -def joint_degree_graph(joint_degrees, seed=None) -> Graph: ... -def is_valid_directed_joint_degree(in_degrees, out_degrees, nkk) -> bool: ... -@py_random_state(3) -def directed_joint_degree_graph(in_degrees, out_degrees, nkk, seed=None) -> Graph: ... diff --git a/stubs/networkx/generators/lattice.pyi b/stubs/networkx/generators/lattice.pyi deleted file mode 100644 index d652b655..00000000 --- a/stubs/networkx/generators/lattice.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections.abc import Iterable -from itertools import repeat -from math import sqrt - -from ..classes import set_node_attributes -from ..exception import NetworkXError -from ..generators.classic import cycle_graph, empty_graph, path_graph -from ..relabel import relabel_nodes -from ..utils import flatten, nodes_or_number, pairwise - -__all__ = [ - "grid_2d_graph", - "grid_graph", - "hypercube_graph", - "triangular_lattice_graph", - "hexagonal_lattice_graph", -] - -def grid_2d_graph(m, n, periodic: bool | Iterable = False, create_using=None): ... -def grid_graph(dim, periodic: bool | Iterable = False): ... -def hypercube_graph(n: int): ... -def triangular_lattice_graph(m: int, n: int, periodic=False, with_positions=True, create_using=None): ... -def hexagonal_lattice_graph(m: int, n: int, periodic: bool = False, with_positions=True, create_using=None): ... diff --git a/stubs/networkx/generators/line.pyi b/stubs/networkx/generators/line.pyi deleted file mode 100644 index 0806dc39..00000000 --- a/stubs/networkx/generators/line.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from collections import defaultdict -from functools import partial -from itertools import combinations - -from ..classes.graph import Graph -from ..utils import arbitrary_element -from ..utils.decorators import not_implemented_for - -__all__ = ["line_graph", "inverse_line_graph"] - -def line_graph(G: Graph, create_using=None): ... -def inverse_line_graph(G: Graph): ... diff --git a/stubs/networkx/generators/mycielski.pyi b/stubs/networkx/generators/mycielski.pyi deleted file mode 100644 index 5f2a507c..00000000 --- a/stubs/networkx/generators/mycielski.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["mycielskian", "mycielski_graph"] - -def mycielskian(G: Graph, iterations: int = 1): ... -def mycielski_graph(n: int): ... diff --git a/stubs/networkx/generators/nonisomorphic_trees.pyi b/stubs/networkx/generators/nonisomorphic_trees.pyi deleted file mode 100644 index 458943af..00000000 --- a/stubs/networkx/generators/nonisomorphic_trees.pyi +++ /dev/null @@ -1,6 +0,0 @@ -__all__ = ["nonisomorphic_trees", "number_of_nonisomorphic_trees"] - -from ..classes.graph import Graph - -def nonisomorphic_trees(order: int, create="graph"): ... -def number_of_nonisomorphic_trees(order: int): ... diff --git a/stubs/networkx/generators/random_clustered.pyi b/stubs/networkx/generators/random_clustered.pyi deleted file mode 100644 index f1dc966b..00000000 --- a/stubs/networkx/generators/random_clustered.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ..classes.graph import Graph -from ..classes.multigraph import MultiGraph -from ..utils import py_random_state - -__all__ = ["random_clustered_graph"] - -@py_random_state(2) -def random_clustered_graph(joint_degree_sequence, create_using=None, seed=None) -> MultiGraph: ... diff --git a/stubs/networkx/generators/random_graphs.pyi b/stubs/networkx/generators/random_graphs.pyi deleted file mode 100644 index 4b93dc1a..00000000 --- a/stubs/networkx/generators/random_graphs.pyi +++ /dev/null @@ -1,70 +0,0 @@ -import itertools -import math -from collections import defaultdict - -from ..classes.graph import Graph -from ..utils import py_random_state -from .classic import complete_graph, empty_graph, path_graph, star_graph -from .degree_seq import degree_sequence_tree - -__all__ = [ - "fast_gnp_random_graph", - "gnp_random_graph", - "dense_gnm_random_graph", - "gnm_random_graph", - "erdos_renyi_graph", - "binomial_graph", - "newman_watts_strogatz_graph", - "watts_strogatz_graph", - "connected_watts_strogatz_graph", - "random_regular_graph", - "barabasi_albert_graph", - "dual_barabasi_albert_graph", - "extended_barabasi_albert_graph", - "powerlaw_cluster_graph", - "random_lobster", - "random_shell_graph", - "random_powerlaw_tree", - "random_powerlaw_tree_sequence", - "random_kernel_graph", -] - -@py_random_state(2) -def fast_gnp_random_graph(n: int, p: float, seed=None, directed=False): ... -@py_random_state(2) -def gnp_random_graph(n: int, p: float, seed=None, directed=False): ... - -# add some aliases to common names -binomial_graph = ... -erdos_renyi_graph = ... - -@py_random_state(2) -def dense_gnm_random_graph(n: int, m: int, seed=None): ... -@py_random_state(2) -def gnm_random_graph(n: int, m: int, seed=None, directed=False): ... -@py_random_state(3) -def newman_watts_strogatz_graph(n: int, k: int, p: float, seed=None): ... -@py_random_state(3) -def watts_strogatz_graph(n: int, k: int, p: float, seed=None): ... -@py_random_state(4) -def connected_watts_strogatz_graph(n: int, k: int, p: float, tries: int = 100, seed=None): ... -@py_random_state(2) -def random_regular_graph(d: int, n, seed=None): ... -@py_random_state(2) -def barabasi_albert_graph(n: int, m: int, seed=None, initial_graph: Graph | None = None) -> Graph: ... -@py_random_state(4) -def dual_barabasi_albert_graph(n: int, m1: int, m2: int, p: float, seed=None, initial_graph: Graph | None = None) -> Graph: ... -@py_random_state(4) -def extended_barabasi_albert_graph(n: int, m: int, p: float, q: float, seed=None) -> Graph: ... -@py_random_state(3) -def powerlaw_cluster_graph(n: int, m: int, p: float, seed=None): ... -@py_random_state(3) -def random_lobster(n: int, p1: float, p2: float, seed=None): ... -@py_random_state(1) -def random_shell_graph(constructor, seed=None): ... -@py_random_state(2) -def random_powerlaw_tree(n: int, gamma: float = 3, seed=None, tries: int = 100): ... -@py_random_state(2) -def random_powerlaw_tree_sequence(n: int, gamma: float = 3, seed=None, tries: int = 100): ... -@py_random_state(3) -def random_kernel_graph(n: int, kernel_integral, kernel_root=None, seed=None): ... diff --git a/stubs/networkx/generators/small.pyi b/stubs/networkx/generators/small.pyi deleted file mode 100644 index 259b66ba..00000000 --- a/stubs/networkx/generators/small.pyi +++ /dev/null @@ -1,63 +0,0 @@ -__all__ = [ - "make_small_graph", - "LCF_graph", - "bull_graph", - "chvatal_graph", - "cubical_graph", - "desargues_graph", - "diamond_graph", - "dodecahedral_graph", - "frucht_graph", - "heawood_graph", - "hoffman_singleton_graph", - "house_graph", - "house_x_graph", - "icosahedral_graph", - "krackhardt_kite_graph", - "moebius_kantor_graph", - "octahedral_graph", - "pappus_graph", - "petersen_graph", - "sedgewick_maze_graph", - "tetrahedral_graph", - "truncated_cube_graph", - "truncated_tetrahedron_graph", - "tutte_graph", -] - -from functools import wraps - -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..generators.classic import complete_graph, cycle_graph, empty_graph, path_graph - -def make_small_undirected_graph(graph_description, create_using=None): ... -def make_small_graph(graph_description, create_using=None): ... -def LCF_graph(n, shift_list, repeats, create_using=None): ... - -# ------------------------------------------------------------------------------- -# Various small and named graphs -# ------------------------------------------------------------------------------- - -def bull_graph(create_using=None): ... -def chvatal_graph(create_using=None): ... -def cubical_graph(create_using=None): ... -def desargues_graph(create_using=None): ... -def diamond_graph(create_using=None): ... -def dodecahedral_graph(create_using=None): ... -def frucht_graph(create_using=None): ... -def heawood_graph(create_using=None): ... -def hoffman_singleton_graph(): ... -def house_graph(create_using=None): ... -def house_x_graph(create_using=None): ... -def icosahedral_graph(create_using=None): ... -def krackhardt_kite_graph(create_using=None): ... -def moebius_kantor_graph(create_using=None): ... -def octahedral_graph(create_using=None): ... -def pappus_graph(): ... -def petersen_graph(create_using=None): ... -def sedgewick_maze_graph(create_using=None): ... -def tetrahedral_graph(create_using=None): ... -def truncated_cube_graph(create_using=None): ... -def truncated_tetrahedron_graph(create_using=None): ... -def tutte_graph(create_using=None): ... diff --git a/stubs/networkx/generators/social.pyi b/stubs/networkx/generators/social.pyi deleted file mode 100644 index 328249ff..00000000 --- a/stubs/networkx/generators/social.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from ..classes.graph import Graph - -__all__ = [ - "karate_club_graph", - "davis_southern_women_graph", - "florentine_families_graph", - "les_miserables_graph", -] - -def karate_club_graph(): ... -def davis_southern_women_graph(): ... -def florentine_families_graph(): ... -def les_miserables_graph(): ... diff --git a/stubs/networkx/generators/spectral_graph_forge.pyi b/stubs/networkx/generators/spectral_graph_forge.pyi deleted file mode 100644 index 117f2878..00000000 --- a/stubs/networkx/generators/spectral_graph_forge.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes.graph import Graph -from ..utils import np_random_state - -__all__ = ["spectral_graph_forge"] - -@np_random_state(3) -def spectral_graph_forge(G: Graph, alpha: float, transformation: str = "identity", seed=None) -> Graph: ... diff --git a/stubs/networkx/generators/stochastic.pyi b/stubs/networkx/generators/stochastic.pyi deleted file mode 100644 index 99c93644..00000000 --- a/stubs/networkx/generators/stochastic.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from ..classes import DiGraph, MultiDiGraph -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["stochastic_graph"] - -def stochastic_graph(G: Graph, copy: bool = True, weight="weight"): ... diff --git a/stubs/networkx/generators/sudoku.pyi b/stubs/networkx/generators/sudoku.pyi deleted file mode 100644 index fd55ec2d..00000000 --- a/stubs/networkx/generators/sudoku.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from ..classes.graph import Graph -from ..exception import NetworkXError - -__all__ = ["sudoku_graph"] - -def sudoku_graph(n=3): ... diff --git a/stubs/networkx/generators/trees.pyi b/stubs/networkx/generators/trees.pyi deleted file mode 100644 index de7beb4d..00000000 --- a/stubs/networkx/generators/trees.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from collections import defaultdict - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = ["prefix_tree", "random_tree", "prefix_tree_recursive"] - -def prefix_tree(paths) -> DiGraph: ... -def prefix_tree_recursive(paths) -> DiGraph: ... - -# From the Wikipedia article on Prüfer sequences: -# -# > Generating uniformly distributed random Prüfer sequences and -# > converting them into the corresponding trees is a straightforward -# > method of generating uniformly distributed random labelled trees. -# -@py_random_state(1) -def random_tree(n: int, seed=None, create_using=None): ... diff --git a/stubs/networkx/generators/triads.pyi b/stubs/networkx/generators/triads.pyi deleted file mode 100644 index f781863f..00000000 --- a/stubs/networkx/generators/triads.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from networkx import DiGraph - -# See https://github.com/networkx/networkx/pull/1474 -# Copyright 2011 Reya Group -# Copyright 2011 Alex Levenson -# Copyright 2011 Diederik van Liere - -__all__ = ["triad_graph"] - -#: Dictionary mapping triad name to list of directed edges in the -#: digraph representation of that triad (with nodes 'a', 'b', and 'c'). -TRIAD_EDGES: dict = ... - -def triad_graph(triad_name: str) -> DiGraph: ... diff --git a/stubs/networkx/lazy_imports.pyi b/stubs/networkx/lazy_imports.pyi deleted file mode 100644 index a091fabe..00000000 --- a/stubs/networkx/lazy_imports.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import importlib -import importlib.util -import inspect -import os -import sys -import types -from collections.abc import Mapping - -__all__ = ["attach"] - -def attach(module_name: str, submodules: set | None = None, submod_attrs: Mapping | None = None): ... - -class DelayedImportErrorModule(types.ModuleType): - def __init__(self, frame_data, *args, **kwargs): ... - def __getattr__(self, x): ... diff --git a/stubs/networkx/linalg/__init__.pyi b/stubs/networkx/linalg/__init__.pyi deleted file mode 100644 index 633f26e9..00000000 --- a/stubs/networkx/linalg/__init__.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from . import ( - attrmatrix as attrmatrix, - bethehessianmatrix as bethehessianmatrix, - graphmatrix as graphmatrix, - laplacianmatrix as laplacianmatrix, - modularitymatrix as modularitymatrix, - spectrum as spectrum, -) -from .algebraicconnectivity import ( - algebraic_connectivity as algebraic_connectivity, - fiedler_vector as fiedler_vector, - spectral_ordering as spectral_ordering, -) -from .attrmatrix import attr_matrix as attr_matrix, attr_sparse_matrix as attr_sparse_matrix -from .bethehessianmatrix import bethe_hessian_matrix as bethe_hessian_matrix -from .graphmatrix import adj_matrix as adj_matrix, adjacency_matrix as adjacency_matrix, incidence_matrix as incidence_matrix -from .laplacianmatrix import ( - directed_combinatorial_laplacian_matrix as directed_combinatorial_laplacian_matrix, - directed_laplacian_matrix as directed_laplacian_matrix, - laplacian_matrix as laplacian_matrix, - normalized_laplacian_matrix as normalized_laplacian_matrix, - total_spanning_tree_weight as total_spanning_tree_weight, -) -from .modularitymatrix import directed_modularity_matrix as directed_modularity_matrix, modularity_matrix as modularity_matrix -from .spectrum import ( - adjacency_spectrum as adjacency_spectrum, - bethe_hessian_spectrum as bethe_hessian_spectrum, - laplacian_spectrum as laplacian_spectrum, - modularity_spectrum as modularity_spectrum, - normalized_laplacian_spectrum as normalized_laplacian_spectrum, -) diff --git a/stubs/networkx/linalg/algebraicconnectivity.pyi b/stubs/networkx/linalg/algebraicconnectivity.pyi deleted file mode 100644 index 3b8d61f4..00000000 --- a/stubs/networkx/linalg/algebraicconnectivity.pyi +++ /dev/null @@ -1,43 +0,0 @@ -from functools import partial - -from ..classes.graph import Graph -from ..utils import not_implemented_for, np_random_state, reverse_cuthill_mckee_ordering - -__all__ = ["algebraic_connectivity", "fiedler_vector", "spectral_ordering"] - -class _PCGSolver: - def __init__(self, A, M): ... - def solve(self, B, tol): ... - def _solve(self, b, tol): ... - -class _LUSolver: - def __init__(self, A): ... - def solve(self, B, tol=None): ... - -@np_random_state(5) -def algebraic_connectivity( - G: Graph, - weight="weight", - normalized=False, - tol=1e-8, - method="tracemin_pcg", - seed=None, -) -> float: ... -@np_random_state(5) -def fiedler_vector( - G: Graph, - weight="weight", - normalized=False, - tol=1e-8, - method="tracemin_pcg", - seed=None, -): ... -@np_random_state(5) -def spectral_ordering( - G: Graph, - weight="weight", - normalized=False, - tol=1e-8, - method="tracemin_pcg", - seed=None, -): ... diff --git a/stubs/networkx/linalg/attrmatrix.pyi b/stubs/networkx/linalg/attrmatrix.pyi deleted file mode 100644 index 66f5a401..00000000 --- a/stubs/networkx/linalg/attrmatrix.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = ["attr_matrix", "attr_sparse_matrix"] - -def attr_matrix( - G: Graph, - edge_attr: str | None = None, - node_attr: str | None = None, - normalized: bool = False, - rc_order: ArrayLike | None = None, - dtype=None, - order=None, -): ... -def attr_sparse_matrix( - G: Graph, - edge_attr: str | None = None, - node_attr: str | None = None, - normalized: bool = False, - rc_order: ArrayLike | None = None, - dtype=None, -): ... diff --git a/stubs/networkx/linalg/bethehessianmatrix.pyi b/stubs/networkx/linalg/bethehessianmatrix.pyi deleted file mode 100644 index 01abf4c8..00000000 --- a/stubs/networkx/linalg/bethehessianmatrix.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["bethe_hessian_matrix"] - -def bethe_hessian_matrix(G: Graph, r: float | None = None, nodelist: ArrayLike | None = None): ... diff --git a/stubs/networkx/linalg/graphmatrix.pyi b/stubs/networkx/linalg/graphmatrix.pyi deleted file mode 100644 index 04f597d6..00000000 --- a/stubs/networkx/linalg/graphmatrix.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.graph import Graph - -__all__ = ["incidence_matrix", "adj_matrix", "adjacency_matrix"] - -def incidence_matrix(G: Graph, nodelist=None, edgelist=None, oriented=False, weight=None): ... -def adjacency_matrix(G: Graph, nodelist: ArrayLike | None = None, dtype=None, weight="weight"): ... - -adj_matrix = ... diff --git a/stubs/networkx/linalg/laplacianmatrix.pyi b/stubs/networkx/linalg/laplacianmatrix.pyi deleted file mode 100644 index ca3a2a7a..00000000 --- a/stubs/networkx/linalg/laplacianmatrix.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = [ - "laplacian_matrix", - "normalized_laplacian_matrix", - "total_spanning_tree_weight", - "directed_laplacian_matrix", - "directed_combinatorial_laplacian_matrix", -] - -def laplacian_matrix(G: Graph, nodelist: ArrayLike | None = None, weight="weight"): ... -def normalized_laplacian_matrix(G: Graph, nodelist: ArrayLike | None = None, weight="weight"): ... -def total_spanning_tree_weight(G: Graph, weight: str | None = None) -> float: ... - -############################################################################### -# Code based on work from https://github.com/bjedwards - -def directed_laplacian_matrix( - G: DiGraph, - nodelist: ArrayLike | None = None, - weight="weight", - walk_type=None, - alpha=0.95, -): ... -def directed_combinatorial_laplacian_matrix( - G: DiGraph, - nodelist: ArrayLike | None = None, - weight="weight", - walk_type=None, - alpha=0.95, -): ... diff --git a/stubs/networkx/linalg/modularitymatrix.pyi b/stubs/networkx/linalg/modularitymatrix.pyi deleted file mode 100644 index cd75f9e2..00000000 --- a/stubs/networkx/linalg/modularitymatrix.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from numpy.typing import ArrayLike - -from ..classes.digraph import DiGraph -from ..classes.graph import Graph -from ..utils import not_implemented_for - -__all__ = ["modularity_matrix", "directed_modularity_matrix"] - -def modularity_matrix(G: Graph, nodelist: ArrayLike | None = None, weight=None): ... -def directed_modularity_matrix(G: DiGraph, nodelist: ArrayLike | None = None, weight=None): ... diff --git a/stubs/networkx/linalg/spectrum.pyi b/stubs/networkx/linalg/spectrum.pyi deleted file mode 100644 index 9c0329ed..00000000 --- a/stubs/networkx/linalg/spectrum.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from ..classes.graph import Graph - -__all__ = [ - "laplacian_spectrum", - "adjacency_spectrum", - "modularity_spectrum", - "normalized_laplacian_spectrum", - "bethe_hessian_spectrum", -] - -def laplacian_spectrum(G: Graph, weight="weight"): ... -def normalized_laplacian_spectrum(G: Graph, weight="weight"): ... -def adjacency_spectrum(G: Graph, weight="weight"): ... -def modularity_spectrum(G: Graph): ... -def bethe_hessian_spectrum(G: Graph, r: float | None = None): ... diff --git a/stubs/networkx/readwrite/__init__.pyi b/stubs/networkx/readwrite/__init__.pyi deleted file mode 100644 index a0617464..00000000 --- a/stubs/networkx/readwrite/__init__.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from .adjlist import ( - generate_adjlist as generate_adjlist, - parse_adjlist as parse_adjlist, - read_adjlist as read_adjlist, - write_adjlist as write_adjlist, -) -from .edgelist import ( - generate_edgelist as generate_edgelist, - parse_edgelist as parse_edgelist, - read_edgelist as read_edgelist, - read_weighted_edgelist as read_weighted_edgelist, - write_edgelist as write_edgelist, - write_weighted_edgelist as write_weighted_edgelist, -) -from .gexf import ( - generate_gexf as generate_gexf, - read_gexf as read_gexf, - relabel_gexf_graph as relabel_gexf_graph, - write_gexf as write_gexf, -) -from .gml import generate_gml as generate_gml, parse_gml as parse_gml, read_gml as read_gml, write_gml as write_gml -from .gpickle import read_gpickle as read_gpickle, write_gpickle as write_gpickle -from .graph6 import ( - from_graph6_bytes as from_graph6_bytes, - read_graph6 as read_graph6, - to_graph6_bytes as to_graph6_bytes, - write_graph6 as write_graph6, -) -from .graphml import ( - GraphMLReader as GraphMLReader, - GraphMLWriter as GraphMLWriter, - generate_graphml as generate_graphml, - parse_graphml as parse_graphml, - read_graphml as read_graphml, - write_graphml as write_graphml, - write_graphml_lxml as write_graphml_lxml, - write_graphml_xml as write_graphml_xml, -) -from .json_graph import * -from .leda import parse_leda as parse_leda, read_leda as read_leda -from .multiline_adjlist import ( - generate_multiline_adjlist as generate_multiline_adjlist, - parse_multiline_adjlist as parse_multiline_adjlist, - read_multiline_adjlist as read_multiline_adjlist, - write_multiline_adjlist as write_multiline_adjlist, -) -from .nx_shp import read_shp as read_shp, write_shp as write_shp -from .pajek import ( - generate_pajek as generate_pajek, - parse_pajek as parse_pajek, - read_pajek as read_pajek, - write_pajek as write_pajek, -) -from .sparse6 import ( - from_sparse6_bytes as from_sparse6_bytes, - read_sparse6 as read_sparse6, - to_sparse6_bytes as to_sparse6_bytes, - write_sparse6 as write_sparse6, -) -from .text import forest_str as forest_str diff --git a/stubs/networkx/readwrite/adjlist.pyi b/stubs/networkx/readwrite/adjlist.pyi deleted file mode 100644 index 959a9b24..00000000 --- a/stubs/networkx/readwrite/adjlist.pyi +++ /dev/null @@ -1,22 +0,0 @@ -__all__ = ["generate_adjlist", "write_adjlist", "parse_adjlist", "read_adjlist"] - -from ..classes.graph import Graph -from ..utils import open_file - -def generate_adjlist(G: Graph, delimiter: str = " ") -> str: ... -def write_adjlist(G: Graph, path, comments: str = "#", delimiter: str = " ", encoding: str = "utf-8"): ... -def parse_adjlist( - lines, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, -): ... -def read_adjlist( - path, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - encoding="utf-8", -): ... diff --git a/stubs/networkx/readwrite/edgelist.pyi b/stubs/networkx/readwrite/edgelist.pyi deleted file mode 100644 index d95f49b1..00000000 --- a/stubs/networkx/readwrite/edgelist.pyi +++ /dev/null @@ -1,50 +0,0 @@ -from numpy.typing import ArrayLike - -__all__ = [ - "generate_edgelist", - "write_edgelist", - "parse_edgelist", - "read_edgelist", - "read_weighted_edgelist", - "write_weighted_edgelist", -] - -from ..classes.graph import Graph -from ..utils import open_file - -def generate_edgelist(G: Graph, delimiter: str = " ", data=True) -> str: ... -def write_edgelist( - G: Graph, - path, - comments: str = "#", - delimiter: str = " ", - data: bool | ArrayLike = True, - encoding: str = "utf-8", -): ... -def parse_edgelist( - lines, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - data=True, -): ... -def read_edgelist( - path, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - data=True, - edgetype=None, - encoding: str = "utf-8", -): ... -def write_weighted_edgelist(G: Graph, path, comments: str = "#", delimiter: str = " ", encoding: str = "utf-8"): ... -def read_weighted_edgelist( - path, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - encoding: str = "utf-8", -): ... diff --git a/stubs/networkx/readwrite/gexf.pyi b/stubs/networkx/readwrite/gexf.pyi deleted file mode 100644 index 639d881f..00000000 --- a/stubs/networkx/readwrite/gexf.pyi +++ /dev/null @@ -1,58 +0,0 @@ -import itertools -import time -from xml.etree.ElementTree import Element, ElementTree, SubElement, register_namespace, tostring - -from ..classes.graph import Graph -from ..utils import open_file - -__all__ = ["write_gexf", "read_gexf", "relabel_gexf_graph", "generate_gexf"] - -def write_gexf(G: Graph, path, encoding="utf-8", prettyprint=True, version="1.2draft"): ... -def generate_gexf(G: Graph, encoding="utf-8", prettyprint=True, version="1.2draft"): ... -def read_gexf(path, node_type=None, relabel=False, version="1.2draft"): ... - -class GEXF: - versions: dict - - def construct_types(self): ... - - # http://www.w3.org/TR/xmlschema-2/#boolean - convert_bool: dict = ... - - def set_version(self, version): ... - -class GEXFWriter(GEXF): - # class for writing GEXF format files - # use write_gexf() function - def __init__(self, graph=None, encoding="utf-8", prettyprint=True, version="1.2draft"): ... - def __str__(self): ... - def add_graph(self, G): ... - def add_nodes(self, G: Graph, graph_element): ... - def add_edges(self, G: Graph, graph_element): ... - def add_attributes(self, node_or_edge, xml_obj, data, default): ... - def get_attr_id(self, title, attr_type, edge_or_node, default, mode): ... - def add_viz(self, element, node_data): ... - def add_parents(self, node_element, node_data): ... - def add_slices(self, node_or_edge_element, node_or_edge_data): ... - def add_spells(self, node_or_edge_element, node_or_edge_data): ... - def alter_graph_mode_timeformat(self, start_or_end): ... - def write(self, fh): ... - def indent(self, elem, level=0): ... - -class GEXFReader(GEXF): - # Class to read GEXF format files - # use read_gexf() function - def __init__(self, node_type=None, version="1.2draft"): ... - def __call__(self, stream): ... - def make_graph(self, graph_xml): ... - def add_node(self, G: Graph, node_xml, node_attr, node_pid=None): ... - def add_start_end(self, data, xml): ... - def add_viz(self, data, node_xml): ... - def add_parents(self, data, node_xml): ... - def add_slices(self, data, node_or_edge_xml): ... - def add_spells(self, data, node_or_edge_xml): ... - def add_edge(self, G: Graph, edge_element, edge_attr): ... - def decode_attr_elements(self, gexf_keys, obj_xml): ... - def find_gexf_attributes(self, attributes_element): ... - -def relabel_gexf_graph(G: Graph): ... diff --git a/stubs/networkx/readwrite/gml.pyi b/stubs/networkx/readwrite/gml.pyi deleted file mode 100644 index 961f1c9d..00000000 --- a/stubs/networkx/readwrite/gml.pyi +++ /dev/null @@ -1,47 +0,0 @@ -import html.entities as htmlentitydefs -import re -import warnings -from ast import literal_eval -from collections import defaultdict -from collections.abc import Iterable -from enum import Enum -from io import StringIO -from typing import Any, Callable, NamedTuple - -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..utils import open_file - -__all__ = ["read_gml", "parse_gml", "generate_gml", "write_gml"] - -def escape(text): ... -def unescape(text): ... -def literal_destringizer(rep: str) -> Any: ... -def read_gml(path, label: str = "label", destringizer: Callable | None = None): ... -def parse_gml( - lines: str | Iterable[str], - label: str = "label", - destringizer: Callable | None = None, -): ... - -class Pattern(Enum): - KEYS = ... - REALS = ... - INTS = ... - STRINGS = ... - DICT_START = ... - DICT_END = ... - COMMENT_WHITESPACE = ... - -class Token(NamedTuple): - category: Pattern = ... - value: Any = ... - line: int = ... - position: int = ... - -LIST_START_VALUE: str = ... - -def parse_gml_lines(lines, label, destringizer): ... -def literal_stringizer(value: Any) -> str: ... -def generate_gml(G: Graph, stringizer: Callable | None = None): ... -def write_gml(G: Graph, path, stringizer: Callable | None = None): ... diff --git a/stubs/networkx/readwrite/gpickle.pyi b/stubs/networkx/readwrite/gpickle.pyi deleted file mode 100644 index 21e8e37d..00000000 --- a/stubs/networkx/readwrite/gpickle.pyi +++ /dev/null @@ -1,10 +0,0 @@ -__all__ = ["read_gpickle", "write_gpickle"] - -import pickle -import warnings - -from ..classes.graph import Graph -from ..utils import open_file - -def write_gpickle(G: Graph, path, protocol=...): ... -def read_gpickle(path): ... diff --git a/stubs/networkx/readwrite/graph6.pyi b/stubs/networkx/readwrite/graph6.pyi deleted file mode 100644 index 84efab5f..00000000 --- a/stubs/networkx/readwrite/graph6.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Iterable - -# Original author: D. Eppstein, UC Irvine, August 12, 2003. -# The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain. -from itertools import islice - -from numpy.typing import ArrayLike - -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..utils import not_implemented_for, open_file - -__all__ = ["from_graph6_bytes", "read_graph6", "to_graph6_bytes", "write_graph6"] - -def from_graph6_bytes(bytes_in) -> Graph: ... -def to_graph6_bytes(G: Graph, nodes: ArrayLike | Iterable | None = None, header: bool = True): ... -def read_graph6(path): ... -def write_graph6(G: Graph, path: str, nodes: ArrayLike | Iterable | None = None, header: bool = True): ... -def write_graph6_file(G: Graph, f, nodes: ArrayLike | Iterable | None = None, header: bool = True): ... -def data_to_n(data): ... -def n_to_data(n): ... diff --git a/stubs/networkx/readwrite/graphml.pyi b/stubs/networkx/readwrite/graphml.pyi deleted file mode 100644 index 81e6c0af..00000000 --- a/stubs/networkx/readwrite/graphml.pyi +++ /dev/null @@ -1,115 +0,0 @@ -import warnings -from collections import defaultdict - -from ..classes.graph import Graph -from ..utils import open_file - -__all__ = [ - "write_graphml", - "read_graphml", - "generate_graphml", - "write_graphml_xml", - "write_graphml_lxml", - "parse_graphml", - "GraphMLWriter", - "GraphMLReader", -] - -def write_graphml_xml( - G: Graph, - path, - encoding="utf-8", - prettyprint=True, - infer_numeric_types: bool = False, - named_key_ids=False, - edge_id_from_attribute=None, -): ... -def write_graphml_lxml( - G: Graph, - path, - encoding="utf-8", - prettyprint=True, - infer_numeric_types: bool = False, - named_key_ids=False, - edge_id_from_attribute=None, -): ... -def generate_graphml( - G: Graph, - encoding="utf-8", - prettyprint=True, - named_key_ids=False, - edge_id_from_attribute=None, -): ... -def read_graphml(path, node_type=..., edge_key_type=..., force_multigraph=False): ... -def parse_graphml(graphml_string: str, node_type=..., edge_key_type=..., force_multigraph=False): ... - -class GraphML: - NS_GRAPHML: str = ... - NS_XSI: str = ... - # xmlns:y="http://www.yworks.com/xml/graphml" - NS_Y: str = ... - SCHEMALOCATION = ... - - def construct_types(self): ... - - # This page says that data types in GraphML follow Java(TM). - # http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesDefinition - # true and false are the only boolean literals: - # http://en.wikibooks.org/wiki/Java_Programming/Literals#Boolean_Literals - convert_bool: dict = ... - - def get_xml_type(self, key): ... - -class GraphMLWriter(GraphML): - def __init__( - self, - graph=None, - encoding="utf-8", - prettyprint=True, - infer_numeric_types=False, - named_key_ids=False, - edge_id_from_attribute=None, - ): ... - def __str__(self): ... - def attr_type(self, name, scope, value): ... - def get_key(self, name, attr_type, scope, default): ... - def add_data(self, name, element_type, value, scope="all", default=None): ... - def add_attributes(self, scope, xml_obj, data, default): ... - def add_nodes(self, G: Graph, graph_element): ... - def add_edges(self, G: Graph, graph_element): ... - def add_graph_element(self, G): ... - def add_graphs(self, graph_list): ... - def dump(self, stream): ... - def indent(self, elem, level=0): ... - -class IncrementalElement: - def __init__(self, xml, prettyprint): ... - def append(self, element): ... - -class GraphMLWriterLxml(GraphMLWriter): - def __init__( - self, - path, - graph=None, - encoding="utf-8", - prettyprint=True, - infer_numeric_types=False, - named_key_ids=False, - edge_id_from_attribute=None, - ): ... - def add_graph_element(self, G): ... - def add_attributes(self, scope, xml_obj, data, default): ... - def __str__(self): ... - def dump(self): ... - -# default is lxml is present. -write_graphml = ... - -class GraphMLReader(GraphML): - def __init__(self, node_type=..., edge_key_type=..., force_multigraph=False): ... - def __call__(self, path=None, string=None): ... - def make_graph(self, graph_xml, graphml_keys, defaults, G=None): ... - def add_node(self, G: Graph, node_xml, graphml_keys, defaults): ... - def add_edge(self, G: Graph, edge_element, graphml_keys): ... - def decode_data_elements(self, graphml_keys, obj_xml): ... - def find_graphml_keys(self, graph_element): ... diff --git a/stubs/networkx/readwrite/json_graph/__init__.pyi b/stubs/networkx/readwrite/json_graph/__init__.pyi deleted file mode 100644 index 34ff4dca..00000000 --- a/stubs/networkx/readwrite/json_graph/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from .adjacency import adjacency_data as adjacency_data, adjacency_graph as adjacency_graph -from .cytoscape import cytoscape_data as cytoscape_data, cytoscape_graph as cytoscape_graph -from .jit import jit_data as jit_data, jit_graph as jit_graph -from .node_link import node_link_data as node_link_data, node_link_graph as node_link_graph -from .tree import tree_data as tree_data, tree_graph as tree_graph diff --git a/stubs/networkx/readwrite/json_graph/adjacency.pyi b/stubs/networkx/readwrite/json_graph/adjacency.pyi deleted file mode 100644 index ab450016..00000000 --- a/stubs/networkx/readwrite/json_graph/adjacency.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Mapping -from itertools import chain - -from ...classes.graph import Graph - -__all__ = ["adjacency_data", "adjacency_graph"] - -_attrs = ... - -def adjacency_data(G: Graph, attrs: Mapping = ...) -> Mapping: ... -def adjacency_graph(data: Mapping, directed: bool = False, multigraph: bool = True, attrs: Mapping = ...): ... diff --git a/stubs/networkx/readwrite/json_graph/cytoscape.pyi b/stubs/networkx/readwrite/json_graph/cytoscape.pyi deleted file mode 100644 index 32722248..00000000 --- a/stubs/networkx/readwrite/json_graph/cytoscape.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping - -from ...classes.graph import Graph - -__all__ = ["cytoscape_data", "cytoscape_graph"] - -def cytoscape_data(G: Graph, attrs=None, name: str = "name", ident: str = "id") -> Mapping: ... -def cytoscape_graph(data: Mapping, attrs=None, name: str = "name", ident: str = "id"): ... diff --git a/stubs/networkx/readwrite/json_graph/jit.pyi b/stubs/networkx/readwrite/json_graph/jit.pyi deleted file mode 100644 index 604abd0b..00000000 --- a/stubs/networkx/readwrite/json_graph/jit.pyi +++ /dev/null @@ -1,10 +0,0 @@ -import json -import warnings - -from ...classes.graph import Graph -from ...utils.decorators import not_implemented_for - -__all__ = ["jit_graph", "jit_data"] - -def jit_graph(data, create_using=None): ... -def jit_data(G: Graph, indent=None, default=None): ... diff --git a/stubs/networkx/readwrite/json_graph/node_link.pyi b/stubs/networkx/readwrite/json_graph/node_link.pyi deleted file mode 100644 index c774da72..00000000 --- a/stubs/networkx/readwrite/json_graph/node_link.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from collections.abc import Mapping -from itertools import chain, count - -from ...classes.graph import Graph - -__all__ = ["node_link_data", "node_link_graph"] - -_attrs = ... - -def node_link_data( - G: Graph, - attrs: Mapping | None = None, - *, - source: str = "source", - target: str = "target", - name: str = "id", - key: str = "key", - link: str = "links", -) -> Mapping: ... -def node_link_graph( - data: Mapping, - directed: bool = False, - multigraph: bool = True, - attrs: Mapping | None = None, - *, - source: str = "source", - target: str = "target", - name: str = "id", - key: str = "key", - link: str = "links", -): ... diff --git a/stubs/networkx/readwrite/json_graph/tree.pyi b/stubs/networkx/readwrite/json_graph/tree.pyi deleted file mode 100644 index c8ac60a9..00000000 --- a/stubs/networkx/readwrite/json_graph/tree.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Mapping -from itertools import chain - -from ...classes.graph import Graph - -__all__ = ["tree_data", "tree_graph"] - -# NOTE: Remove attrs from signature in 3.0 -def tree_data( - G: Graph, - root, - attrs: Mapping | None = None, - ident: str = "id", - children: str = "children", -) -> Mapping: ... -def tree_graph( - data: Mapping, - attrs: Mapping | None = None, - ident: str = "id", - children: str = "children", -): ... diff --git a/stubs/networkx/readwrite/leda.pyi b/stubs/networkx/readwrite/leda.pyi deleted file mode 100644 index 8465714f..00000000 --- a/stubs/networkx/readwrite/leda.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from collections.abc import Iterable - -# Original author: D. Eppstein, UC Irvine, August 12, 2003. -# The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain. - -__all__ = ["read_leda", "parse_leda"] - -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..utils import open_file - -def read_leda(path, encoding="UTF-8"): ... -def parse_leda(lines: str | Iterable): ... diff --git a/stubs/networkx/readwrite/multiline_adjlist.pyi b/stubs/networkx/readwrite/multiline_adjlist.pyi deleted file mode 100644 index c6ee18ae..00000000 --- a/stubs/networkx/readwrite/multiline_adjlist.pyi +++ /dev/null @@ -1,29 +0,0 @@ -__all__ = [ - "generate_multiline_adjlist", - "write_multiline_adjlist", - "parse_multiline_adjlist", - "read_multiline_adjlist", -] - -from ..classes.graph import Graph -from ..utils import open_file - -def generate_multiline_adjlist(G: Graph, delimiter: str = " ") -> str: ... -def write_multiline_adjlist(G: Graph, path, delimiter: str = " ", comments: str = "#", encoding: str = "utf-8"): ... -def parse_multiline_adjlist( - lines, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - edgetype=None, -): ... -def read_multiline_adjlist( - path, - comments: str = "#", - delimiter: str | None = None, - create_using=None, - nodetype=None, - edgetype=None, - encoding="utf-8", -): ... diff --git a/stubs/networkx/readwrite/nx_shp.pyi b/stubs/networkx/readwrite/nx_shp.pyi deleted file mode 100644 index 36cbcf46..00000000 --- a/stubs/networkx/readwrite/nx_shp.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import warnings - -from ..classes.graph import Graph - -__all__ = ["read_shp", "write_shp"] - -def read_shp(path, simplify: bool = True, geom_attrs: bool = True, strict: bool = True): ... -def edges_from_line(geom, attrs, simplify=True, geom_attrs=True): ... -def write_shp(G: Graph, outdir): ... diff --git a/stubs/networkx/readwrite/nx_yaml.pyi b/stubs/networkx/readwrite/nx_yaml.pyi deleted file mode 100644 index 8b137891..00000000 --- a/stubs/networkx/readwrite/nx_yaml.pyi +++ /dev/null @@ -1 +0,0 @@ - diff --git a/stubs/networkx/readwrite/p2g.pyi b/stubs/networkx/readwrite/p2g.pyi deleted file mode 100644 index 54b9141d..00000000 --- a/stubs/networkx/readwrite/p2g.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import networkx - -from ..classes.graph import Graph -from ..classes.multidigraph import MultiDiGraph -from ..utils import open_file - -def write_p2g(G: Graph, path, encoding="utf-8"): ... -def read_p2g(path, encoding="utf-8") -> MultiDiGraph: ... -def parse_p2g(lines) -> MultiDiGraph: ... diff --git a/stubs/networkx/readwrite/pajek.pyi b/stubs/networkx/readwrite/pajek.pyi deleted file mode 100644 index b4636035..00000000 --- a/stubs/networkx/readwrite/pajek.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import warnings -from collections.abc import Iterable - -from ..classes.graph import Graph -from ..utils import open_file - -__all__ = ["read_pajek", "parse_pajek", "generate_pajek", "write_pajek"] - -def generate_pajek(G: Graph): ... -def write_pajek(G: Graph, path, encoding="UTF-8"): ... -def read_pajek(path, encoding="UTF-8"): ... -def parse_pajek(lines: str | Iterable): ... -def make_qstr(t): ... diff --git a/stubs/networkx/readwrite/sparse6.pyi b/stubs/networkx/readwrite/sparse6.pyi deleted file mode 100644 index 1efae49c..00000000 --- a/stubs/networkx/readwrite/sparse6.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Iterable - -from numpy.typing import ArrayLike - -# Original author: D. Eppstein, UC Irvine, August 12, 2003. -# The original code at https://www.ics.uci.edu/~eppstein/PADS/ is public domain. -from ..classes.graph import Graph -from ..exception import NetworkXError -from ..readwrite.graph6 import data_to_n, n_to_data -from ..utils import not_implemented_for, open_file - -__all__ = ["from_sparse6_bytes", "read_sparse6", "to_sparse6_bytes", "write_sparse6"] - -def from_sparse6_bytes(string: str) -> Graph: ... -def to_sparse6_bytes(G: Graph, nodes: ArrayLike | Iterable | None = None, header: bool = True): ... -def read_sparse6(path): ... -def write_sparse6(G: Graph, path, nodes: ArrayLike | Iterable | None = None, header: bool = True): ... diff --git a/stubs/networkx/readwrite/text.pyi b/stubs/networkx/readwrite/text.pyi deleted file mode 100644 index a13d3661..00000000 --- a/stubs/networkx/readwrite/text.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Callable - -from numpy.typing import ArrayLike - -__all__ = ["forest_str"] - -def forest_str( - graph, - with_labels: bool = True, - sources: ArrayLike | None = None, - write: Callable | None = None, - ascii_only: bool = False, -): ... diff --git a/stubs/networkx/relabel.pyi b/stubs/networkx/relabel.pyi deleted file mode 100644 index 9fc84ed5..00000000 --- a/stubs/networkx/relabel.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping - -from .classes.graph import Graph - -__all__ = ["convert_node_labels_to_integers", "relabel_nodes"] - -def relabel_nodes(G: Graph, mapping: Mapping, copy=True): ... -def convert_node_labels_to_integers(G: Graph, first_label=0, ordering: str = "default", label_attribute=None): ... diff --git a/stubs/networkx/testing/__init__.pyi b/stubs/networkx/testing/__init__.pyi deleted file mode 100644 index ecaa565f..00000000 --- a/stubs/networkx/testing/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from .test import run as run -from .utils import ( - almost_equal as almost_equal, - assert_edges_equal as assert_edges_equal, - assert_graphs_equal as assert_graphs_equal, - assert_nodes_equal as assert_nodes_equal, -) diff --git a/stubs/networkx/testing/test.pyi b/stubs/networkx/testing/test.pyi deleted file mode 100644 index 13702b01..00000000 --- a/stubs/networkx/testing/test.pyi +++ /dev/null @@ -1,3 +0,0 @@ -import warnings - -def run(verbosity=1, doctest: bool = False): ... diff --git a/stubs/networkx/testing/utils.pyi b/stubs/networkx/testing/utils.pyi deleted file mode 100644 index a0d47669..00000000 --- a/stubs/networkx/testing/utils.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import warnings - -from ..utils import edges_equal, graphs_equal, nodes_equal - -__all__ = [ - "assert_nodes_equal", - "assert_edges_equal", - "assert_graphs_equal", - "almost_equal", -] - -def almost_equal(x, y, places=7): ... -def assert_nodes_equal(nodes1, nodes2): ... -def assert_edges_equal(edges1, edges2): ... -def assert_graphs_equal(graph1, graph2): ... diff --git a/stubs/networkx/utils/__init__.pyi b/stubs/networkx/utils/__init__.pyi deleted file mode 100644 index 65990e53..00000000 --- a/stubs/networkx/utils/__init__.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from .contextmanagers import reversed as reversed -from .decorators import ( - argmap as argmap, - nodes_or_number as nodes_or_number, - not_implemented_for as not_implemented_for, - np_random_state as np_random_state, - open_file as open_file, - preserve_random_state as preserve_random_state, - py_random_state as py_random_state, - random_state as random_state, -) -from .heaps import BinaryHeap as BinaryHeap, MinHeap as MinHeap, PairingHeap as PairingHeap -from .misc import ( - PythonRandomInterface as PythonRandomInterface, - arbitrary_element as arbitrary_element, - consume as consume, - create_py_random_state as create_py_random_state, - create_random_state as create_random_state, - default_opener as default_opener, - dict_to_numpy_array as dict_to_numpy_array, - dict_to_numpy_array1 as dict_to_numpy_array1, - dict_to_numpy_array2 as dict_to_numpy_array2, - edges_equal as edges_equal, - empty_generator as empty_generator, - flatten as flatten, - generate_unique_node as generate_unique_node, - graphs_equal as graphs_equal, - groups as groups, - is_iterator as is_iterator, - is_list_of_ints as is_list_of_ints, - is_string_like as is_string_like, - iterable as iterable, - make_list_of_ints as make_list_of_ints, - make_str as make_str, - nodes_equal as nodes_equal, - pairwise as pairwise, - to_tuple as to_tuple, -) -from .random_sequence import ( - cumulative_distribution as cumulative_distribution, - discrete_sequence as discrete_sequence, - powerlaw_sequence as powerlaw_sequence, - random_weighted_sample as random_weighted_sample, - weighted_choice as weighted_choice, - zipf_rv as zipf_rv, -) -from .rcm import ( - cuthill_mckee_ordering as cuthill_mckee_ordering, - reverse_cuthill_mckee_ordering as reverse_cuthill_mckee_ordering, -) -from .union_find import * diff --git a/stubs/networkx/utils/contextmanagers.pyi b/stubs/networkx/utils/contextmanagers.pyi deleted file mode 100644 index 48a55096..00000000 --- a/stubs/networkx/utils/contextmanagers.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import warnings -from contextlib import contextmanager - -from ..classes.graph import Graph - -__all__ = ["reversed"] - -@contextmanager -def reversed(G: Graph): ... diff --git a/stubs/networkx/utils/decorators.pyi b/stubs/networkx/utils/decorators.pyi deleted file mode 100644 index c5563db7..00000000 --- a/stubs/networkx/utils/decorators.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from collections.abc import Sequence -from typing import Callable - -__all__ = [ - "not_implemented_for", - "open_file", - "nodes_or_number", - "preserve_random_state", - "random_state", - "np_random_state", - "py_random_state", - "argmap", -] - -def not_implemented_for(*graph_types): ... - -# To handle new extensions, define a function accepting a `path` and `mode`. -# Then add the extension to _dispatch_dict. -fopeners: dict = ... -_dispatch_dict = ... - -def open_file(path_arg: str | int, mode: str = "r"): ... -def nodes_or_number(which_args: str | int | Sequence[str]): ... -def preserve_random_state(func): ... -def np_random_state(random_state_argument: str | int): ... -def random_state(random_state_argument): ... -def py_random_state(random_state_argument: str | int): ... - -class argmap: - def __init__(self, func: Callable, *args, try_finally=False): ... - @staticmethod - def _lazy_compile(func): ... - def __call__(self, f: Callable) -> Callable: ... - - __count: int = ... - - @classmethod - def _count(cls): ... - - _bad_chars = ... - - @classmethod - def _name(cls, f): ... - def compile(self, f: Callable) -> Callable: ... - def assemble(self, f: Callable): ... - @classmethod - def signature(cls, f: Callable): ... - - Signature = ... - - @staticmethod - def _flatten(nestlist, visited): ... - - _tabs = ... - - @staticmethod - def _indent(*lines): ... diff --git a/stubs/networkx/utils/heaps.pyi b/stubs/networkx/utils/heaps.pyi deleted file mode 100644 index fa3ca7c7..00000000 --- a/stubs/networkx/utils/heaps.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from heapq import heappop, heappush -from itertools import count -from typing import Any - -from ..classes.graph import Graph - -__all__ = ["MinHeap", "PairingHeap", "BinaryHeap"] - -class MinHeap: - def __init__(self): ... - def min(self) -> tuple: ... - def pop(self) -> tuple: ... - def get(self, key, default: Any = None): ... - def insert(self, key, value, allow_increase: bool = False) -> bool: ... - def __nonzero__(self): ... - def __bool__(self): ... - def __len__(self): ... - def __contains__(self, key): ... - -class PairingHeap(MinHeap): - def __init__(self): ... - def min(self) -> tuple: ... - def pop(self) -> tuple: ... - def get(self, key, default: Any = None): ... - def insert(self, key, value, allow_increase: bool = False) -> bool: ... - def _link(self, root, other): ... - def _merge_children(self, root): ... - def _cut(self, node): ... - -class BinaryHeap(MinHeap): - def __init__(self): ... - def min(self) -> tuple: ... - def pop(self) -> tuple: ... - def get(self, key, default: Any = None): ... - def insert(self, key, value, allow_increase: bool = False) -> bool: ... diff --git a/stubs/networkx/utils/mapped_queue.pyi b/stubs/networkx/utils/mapped_queue.pyi deleted file mode 100644 index 6bfe95ba..00000000 --- a/stubs/networkx/utils/mapped_queue.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import heapq - -__all__ = ["MappedQueue"] - -class _HeapElement: - __slots__: list = ... - - def __init__(self, priority, element): ... - def __lt__(self, other): ... - def __gt__(self, other): ... - def __eq__(self, other): ... - def __hash__(self): ... - def __getitem__(self, indx): ... - def __iter__(self): ... - def __repr__(self): ... - -class MappedQueue: - def __init__(self, data=[]): ... - def _heapify(self): ... - def __len__(self): ... - def push(self, elt, priority=None): ... - def pop(self): ... - def update(self, elt, new, priority=None): ... - def remove(self, elt): ... - def _siftup(self, pos): ... - def _siftdown(self, start_pos, pos): ... diff --git a/stubs/networkx/utils/misc.pyi b/stubs/networkx/utils/misc.pyi deleted file mode 100644 index 9cb666fa..00000000 --- a/stubs/networkx/utils/misc.pyi +++ /dev/null @@ -1,102 +0,0 @@ -import sys -import uuid -import warnings -from collections import defaultdict, deque -from collections.abc import Iterable, Iterator, Sized -from itertools import chain, tee - -from ..classes.graph import Graph - -__all__ = [ - "is_string_like", - "iterable", - "empty_generator", - "flatten", - "make_list_of_ints", - "is_list_of_ints", - "make_str", - "generate_unique_node", - "default_opener", - "dict_to_numpy_array", - "dict_to_numpy_array1", - "dict_to_numpy_array2", - "is_iterator", - "arbitrary_element", - "consume", - "pairwise", - "groups", - "to_tuple", - "create_random_state", - "create_py_random_state", - "PythonRandomInterface", - "nodes_equal", - "edges_equal", - "graphs_equal", -] - -# some cookbook stuff -# used in deciding whether something is a bunch of nodes, edges, etc. -# see G.add_nodes and others in Graph Class in networkx/base.py - -def is_string_like(obj): ... -def iterable(obj): ... -def empty_generator(): ... -def flatten(obj, result=None): ... -def make_list_of_ints(sequence): ... -def is_list_of_ints(intlist): ... -def make_str(x): ... -def generate_unique_node(): ... -def default_opener(filename: str): ... -def dict_to_numpy_array(d, mapping=None): ... -def dict_to_numpy_array2(d, mapping=None): ... -def dict_to_numpy_array1(d, mapping=None): ... -def is_iterator(obj): ... -def arbitrary_element(iterable): ... - -# Recipe from the itertools documentation. -def consume(iterator): ... - -# Recipe from the itertools documentation. -def pairwise(iterable, cyclic=False): ... -def groups(many_to_one): ... -def to_tuple(x): ... -def create_random_state(random_state=None): ... - -class PythonRandomInterface: - def __init__(self, rng=None): ... - def random(self): ... - def uniform(self, a, b): ... - def randrange(self, a, b=None): ... - - # NOTE: the numpy implementations of `choice` don't support strings, so - # this cannot be replaced with self._rng.choice - def choice(self, seq): ... - def gauss(self, mu, sigma): ... - def shuffle(self, seq): ... - - # Some methods don't match API for numpy RandomState. - # Commented out versions are not used by NetworkX - - def sample(self, seq, k): ... - def randint(self, a, b): ... - - # exponential as expovariate with 1/argument, - def expovariate(self, scale): ... - - # pareto as paretovariate with 1/argument, - def paretovariate(self, shape): ... - -# weibull as weibullvariate multiplied by beta, -# def weibullvariate(self, alpha, beta): -# return self._rng.weibull(alpha) * beta -# -# def triangular(self, low, high, mode): -# return self._rng.triangular(low, mode, high) -# -# def choices(self, seq, weights=None, cum_weights=None, k=1): -# return self._rng.choice(seq - -def create_py_random_state(random_state=None): ... -def nodes_equal(nodes1, nodes2) -> bool: ... -def edges_equal(edges1, edges2) -> bool: ... -def graphs_equal(graph1, graph2) -> bool: ... diff --git a/stubs/networkx/utils/random_sequence.pyi b/stubs/networkx/utils/random_sequence.pyi deleted file mode 100644 index 98ce4a88..00000000 --- a/stubs/networkx/utils/random_sequence.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from ..classes.graph import Graph -from ..utils import py_random_state - -__all__ = [ - "powerlaw_sequence", - "zipf_rv", - "cumulative_distribution", - "discrete_sequence", - "random_weighted_sample", - "weighted_choice", -] - -# The same helpers for choosing random sequences from distributions -# uses Python's random module -# https://docs.python.org/3/library/random.html - -@py_random_state(2) -def powerlaw_sequence(n, exponent=2.0, seed=None): ... -@py_random_state(2) -def zipf_rv(alpha: float, xmin: int = 1, seed=None) -> int: ... -def cumulative_distribution(distribution): ... -@py_random_state(3) -def discrete_sequence(n, distribution=None, cdistribution=None, seed=None): ... -@py_random_state(2) -def random_weighted_sample(mapping, k, seed=None): ... -@py_random_state(1) -def weighted_choice(mapping, seed=None): ... diff --git a/stubs/networkx/utils/rcm.pyi b/stubs/networkx/utils/rcm.pyi deleted file mode 100644 index e60a44bd..00000000 --- a/stubs/networkx/utils/rcm.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from collections import deque -from operator import itemgetter - -from ..classes.graph import Graph -from ..utils import arbitrary_element - -__all__ = ["cuthill_mckee_ordering", "reverse_cuthill_mckee_ordering"] - -def cuthill_mckee_ordering(G: Graph, heuristic=None): ... -def reverse_cuthill_mckee_ordering(G: Graph, heuristic=None): ... -def connected_cuthill_mckee_ordering(G: Graph, heuristic=None): ... -def pseudo_peripheral_node(G: Graph): ... diff --git a/stubs/networkx/utils/union_find.pyi b/stubs/networkx/utils/union_find.pyi deleted file mode 100644 index 68d753e1..00000000 --- a/stubs/networkx/utils/union_find.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from ..utils import groups - -class UnionFind: - def __init__(self, elements=None): ... - def __getitem__(self, object): ... - def __iter__(self): ... - def to_sets(self): ... - def union(self, *objects): ... diff --git a/stubs/skimage/future/graph/graph_cut.pyi b/stubs/skimage/future/graph/graph_cut.pyi index 5b10a39b..61fcc14e 100644 --- a/stubs/skimage/future/graph/graph_cut.pyi +++ b/stubs/skimage/future/graph/graph_cut.pyi @@ -1,9 +1,5 @@ -import networkx as nx -import numpy as np from numpy.typing import ArrayLike, NDArray -from scipy.sparse import linalg -from . import _ncut from .rag import RAG def cut_threshold(labels: NDArray, rag: RAG, thresh: float, in_place: bool = True) -> NDArray: ... diff --git a/tests/run_stubtest.py b/tests/run_stubtest.py index f460aa71..efc2209d 100644 --- a/tests/run_stubtest.py +++ b/tests/run_stubtest.py @@ -11,6 +11,11 @@ root = Path(__file__).parent.parent stubs_path = root / "stubs" PARTIAL_STUBS_MARKER = "-stubs" +SKIP_PACKAGES = { + # This stub has been upstreamed and is only kept for backwards compatibility + # The version that is stubbed does not match the one we install for type testing + "matplotlib", +} def run_stubtest(module: str) -> CompletedProcess[bytes]: @@ -40,19 +45,12 @@ def run_stubtest(module: str) -> CompletedProcess[bytes]: return run((sys.executable, "-m", *args), cwd=stubs_path) -def main(modules: Collection[str]) -> int: +def main(packages: Collection[str]) -> int: returncode = 0 - if not modules: - modules = os.listdir(stubs_path) - for stub_module in modules: - if stub_module in { - # This stub has been upstreamed and is only kept for backwards compatibility - # The version that is stubbed does not match the one we install for type testing - "matplotlib", - # This stub is being upstreamed to typeshed and not worth fixing all issues. - # networkx 3.5 also isn't available on Python 3.10 - "networkx", - }: + if not packages: + packages = os.listdir(stubs_path) + for stub_module in packages: + if stub_module in SKIP_PACKAGES: print(f"\nSkipped {stub_module}", flush=True) continue if stub_module.startswith("."):