mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 13:33:59 +08:00
networkx: Add symbols from python-type-stubs (#14084)
This commit is contained in:
@@ -40,7 +40,4 @@ networkx(\.algorithms)?(\.tree)?(\.mst)?\.SpanningTreeIterator\.Partition\._DT
|
||||
networkx(\.algorithms)?(\.tree)?(\.branchings)?\.ArborescenceIterator\.Partition\._DT
|
||||
|
||||
# variable differs from runtime type abc.ABCMeta
|
||||
networkx.classes.reportviews.EdgeView.dataview
|
||||
networkx.classes.reportviews.InEdgeView.dataview
|
||||
networkx.classes.reportviews.OutEdgeView.dataview
|
||||
networkx.classes.reportviews.OutMultiEdgeView.dataview
|
||||
networkx\.classes\.reportviews\.\w*EdgeView\.dataview
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import Final
|
||||
|
||||
from networkx.algorithms import *
|
||||
from networkx.classes import *
|
||||
from networkx.classes import filters as filters
|
||||
@@ -24,3 +26,5 @@ from . import (
|
||||
relabel as relabel,
|
||||
utils as utils,
|
||||
)
|
||||
|
||||
__version__: Final[str]
|
||||
|
||||
@@ -118,6 +118,7 @@ from networkx.algorithms.structuralholes import *
|
||||
from networkx.algorithms.summarization import *
|
||||
from networkx.algorithms.swap import *
|
||||
from networkx.algorithms.time_dependent import *
|
||||
from networkx.algorithms.tournament import is_tournament as is_tournament
|
||||
from networkx.algorithms.traversal import *
|
||||
from networkx.algorithms.tree.branchings import (
|
||||
ArborescenceIterator as ArborescenceIterator,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Callable
|
||||
from _typeshed import Incomplete, SupportsLenAndGetItem
|
||||
from collections.abc import Callable, Mapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from networkx.classes.digraph import DiGraph
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
@@ -15,6 +16,10 @@ __all__ = [
|
||||
"threshold_accepting_tsp",
|
||||
]
|
||||
|
||||
_SupportsLenAndGetItemT = TypeVar("_SupportsLenAndGetItemT", bound=SupportsLenAndGetItem[Any])
|
||||
|
||||
def swap_two_nodes(soln: _SupportsLenAndGetItemT, seed) -> _SupportsLenAndGetItemT: ...
|
||||
def move_one_node(soln: _SupportsLenAndGetItemT, seed) -> _SupportsLenAndGetItemT: ...
|
||||
@_dispatchable
|
||||
def christofides(G: Graph[_Node], weight: str | None = "weight", tree: Graph[_Node] | None = None): ...
|
||||
@_dispatchable
|
||||
@@ -31,6 +36,10 @@ def asadpour_atsp(
|
||||
G: DiGraph[_Node], weight: str | None = "weight", seed: int | RandomState | None = None, source: str | None = None
|
||||
): ...
|
||||
@_dispatchable
|
||||
def held_karp_ascent(G: Graph[_Node], weight="weight"): ...
|
||||
@_dispatchable
|
||||
def spanning_tree_distribution(G: Graph[_Node], z: Mapping[Incomplete, Incomplete]) -> dict[Incomplete, Incomplete]: ...
|
||||
@_dispatchable
|
||||
def greedy_tsp(G: Graph[_Node], weight: str | None = "weight", source=None): ...
|
||||
@_dispatchable
|
||||
def simulated_annealing_tsp(
|
||||
|
||||
@@ -15,3 +15,7 @@ class MinDegreeHeuristic:
|
||||
|
||||
def __init__(self, graph) -> None: ...
|
||||
def best_node(self, graph): ...
|
||||
|
||||
def min_fill_in_heuristic(graph) -> Incomplete | None: ...
|
||||
@_dispatchable
|
||||
def treewidth_decomp(G: Graph[_Node], heuristic=...) -> tuple[int, Graph[_Node]]: ...
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
@@ -7,3 +9,5 @@ __all__ = ["is_at_free", "find_asteroidal_triple"]
|
||||
def find_asteroidal_triple(G: Graph[_Node]): ...
|
||||
@_dispatchable
|
||||
def is_at_free(G: Graph[_Node]) -> bool: ...
|
||||
@_dispatchable
|
||||
def create_component_structure(G: Graph[_Node]) -> dict[Incomplete, Incomplete]: ...
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterable
|
||||
from collections.abc import Callable, Iterable
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["clustering", "average_clustering", "latapy_clustering", "robins_alexander_clustering"]
|
||||
|
||||
def cc_dot(nu, nv) -> float: ...
|
||||
def cc_max(nu, nv) -> float: ...
|
||||
def cc_min(nu, nv) -> float: ...
|
||||
|
||||
modes: dict[str, Callable[[Incomplete, Incomplete], float]]
|
||||
|
||||
@_dispatchable
|
||||
def latapy_clustering(G: Graph[_Node], nodes: Iterable[Incomplete] | None = None, mode: str = "dot"): ...
|
||||
|
||||
|
||||
@@ -37,3 +37,15 @@ def node_clique_number(G: Graph[_Node], nodes=None, cliques: Iterable[Incomplete
|
||||
def number_of_cliques(G, nodes=None, cliques=None) -> int | dict[Incomplete, Incomplete]: ...
|
||||
@_dispatchable
|
||||
def max_weight_clique(G, weight="weight") -> tuple[Incomplete, Incomplete]: ...
|
||||
|
||||
class MaxWeightClique:
|
||||
G: Graph[Incomplete]
|
||||
incumbent_nodes: list[Incomplete]
|
||||
incumbent_weight: int
|
||||
node_weights: dict[Incomplete, int]
|
||||
def __init__(self, G: Graph[_Node], 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): ...
|
||||
|
||||
@@ -11,5 +11,13 @@ __all__ = ["equitable_color"]
|
||||
def is_coloring(G: Graph[_Node], coloring: SupportsGetItem[Incomplete, Incomplete]) -> bool: ...
|
||||
@_dispatchable
|
||||
def is_equitable(G: Graph[_Node], coloring: Mapping[Incomplete, Incomplete], num_colors: SupportsIndex | None = None) -> bool: ...
|
||||
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): ...
|
||||
@_dispatchable
|
||||
def pad_graph(G: Graph[_Node], num_colors): ...
|
||||
def procedure_P(V_minus, V_plus, N, H, F, C, L, excluded_colors=None): ...
|
||||
@_dispatchable
|
||||
def equitable_color(G: Graph[_Node], num_colors): ...
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
from collections.abc import Callable, Generator
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
@@ -32,5 +33,8 @@ def strategy_connected_sequential_dfs(G, colors): ...
|
||||
def strategy_connected_sequential(G, colors, traversal: str = "bfs") -> Generator[Incomplete, None, None]: ...
|
||||
@_dispatchable
|
||||
def strategy_saturation_largest_first(G, colors) -> Generator[Incomplete, None, Incomplete]: ...
|
||||
|
||||
STRATEGIES: Final[dict[str, Callable[..., Incomplete]]]
|
||||
|
||||
@_dispatchable
|
||||
def greedy_color(G: Graph[_Node], strategy="largest_first", interchange: bool = False): ...
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
import networkx as nx
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["edge_betweenness_partition", "edge_current_flow_betweenness_partition"]
|
||||
|
||||
@nx._dispatchable
|
||||
@_dispatchable
|
||||
def edge_betweenness_partition(G: Graph[_Node], number_of_sets: int, *, weight: str | None = None) -> list[Incomplete]: ...
|
||||
@nx._dispatchable
|
||||
@_dispatchable
|
||||
def edge_current_flow_betweenness_partition(
|
||||
G: Graph[_Node], number_of_sets: int, *, weight: str | None = None
|
||||
) -> list[Incomplete]: ...
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["lukes_partitioning"]
|
||||
|
||||
D_EDGE_W: Final = "weight"
|
||||
D_EDGE_VALUE: Final[float]
|
||||
D_NODE_W: Final = "weight"
|
||||
D_NODE_VALUE: Final = 1
|
||||
PKEY: Final = "partitions"
|
||||
CLUSTER_EVAL_CACHE_SIZE: Final = 2048
|
||||
|
||||
@_dispatchable
|
||||
def lukes_partitioning(G: Graph[_Node], max_size: int, node_weight=None, edge_weight=None): ...
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.exception import NetworkXError
|
||||
from networkx.utils.backends import _dispatchable
|
||||
from networkx.utils.decorators import argmap
|
||||
|
||||
__all__ = ["modularity", "partition_quality"]
|
||||
|
||||
class NotAPartition(NetworkXError):
|
||||
def __init__(self, G, collection) -> None: ...
|
||||
|
||||
require_partition: argmap
|
||||
|
||||
@_dispatchable
|
||||
def intra_community_edges(G: Graph[_Node], partition): ...
|
||||
@_dispatchable
|
||||
def inter_community_edges(G: Graph[_Node], partition): ...
|
||||
@_dispatchable
|
||||
def inter_community_non_edges(G: Graph[_Node], partition): ...
|
||||
@_dispatchable
|
||||
def modularity(G: Graph[_Node], communities, weight: str | None = "weight", resolution: float = 1): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from _typeshed import SupportsGetItem
|
||||
from _typeshed import Incomplete, SupportsGetItem
|
||||
from collections.abc import Generator
|
||||
from typing import NamedTuple
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
@@ -18,3 +19,29 @@ def k_edge_augmentation(
|
||||
weight: str | None = None,
|
||||
partial: bool = False,
|
||||
) -> Generator[tuple[_Node, _Node], None, None]: ...
|
||||
@_dispatchable
|
||||
def partial_k_edge_augmentation(G: Graph[_Node], k, avail, weight: str | None = None): ...
|
||||
@_dispatchable
|
||||
def one_edge_augmentation(G: Graph[_Node], avail=None, weight: str | None = None, partial: bool = False): ...
|
||||
@_dispatchable
|
||||
def bridge_augmentation(G: Graph[_Node], avail=None, weight: str | None = None): ...
|
||||
|
||||
class MetaEdge(NamedTuple):
|
||||
meta_uv: Incomplete
|
||||
uv: Incomplete
|
||||
w: Incomplete
|
||||
|
||||
@_dispatchable
|
||||
def unconstrained_one_edge_augmentation(G: Graph[_Node]): ...
|
||||
@_dispatchable
|
||||
def weighted_one_edge_augmentation(G: Graph[_Node], avail, weight: str | None = None, partial: bool = False): ...
|
||||
@_dispatchable
|
||||
def unconstrained_bridge_augmentation(G: Graph[_Node]): ...
|
||||
@_dispatchable
|
||||
def weighted_bridge_augmentation(G: Graph[_Node], avail, weight: str | None = None): ...
|
||||
@_dispatchable
|
||||
def collapse(G: Graph[_Node], grouped_nodes): ...
|
||||
@_dispatchable
|
||||
def complement_edges(G: Graph[_Node]): ...
|
||||
@_dispatchable
|
||||
def greedy_k_edge_augmentation(G: Graph[_Node], k, avail=None, weight: str | None = None, seed=None): ...
|
||||
|
||||
@@ -21,3 +21,6 @@ class EdgeComponentAuxGraph:
|
||||
def construct(cls, G): ...
|
||||
def k_edge_components(self, k: int) -> Generator[Incomplete, Incomplete, None]: ...
|
||||
def k_edge_subgraphs(self, k: int) -> Generator[Incomplete, Incomplete, None]: ...
|
||||
|
||||
@_dispatchable
|
||||
def general_k_edge_subgraphs(G: Graph[_Node], k): ...
|
||||
|
||||
@@ -10,3 +10,4 @@ default_flow_func = edmonds_karp
|
||||
|
||||
@_dispatchable
|
||||
def k_components(G: Graph[_Node], flow_func: Callable[..., Incomplete] | None = None): ...
|
||||
def build_k_number_dict(kcomps) -> dict[Incomplete, Incomplete]: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from types import FunctionType
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
@@ -14,6 +15,8 @@ __all__ = [
|
||||
"generic_multiedge_match",
|
||||
]
|
||||
|
||||
def copyfunc(f, name=None) -> FunctionType: ...
|
||||
def allclose(x, y, rtol: float = 1.0000000000000001e-05, atol=1e-08) -> bool: ...
|
||||
@_dispatchable
|
||||
def categorical_node_match(attr, default): ...
|
||||
|
||||
|
||||
@@ -3,6 +3,12 @@ from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["rooted_tree_isomorphism", "tree_isomorphism"]
|
||||
|
||||
@_dispatchable
|
||||
def root_trees(t1, root1, t2, root2): ...
|
||||
@_dispatchable
|
||||
def assign_levels(G: Graph[_Node], root): ...
|
||||
def group_by_levels(levels): ...
|
||||
def generate_isomorphism(v, w, M, ordered_children): ...
|
||||
@_dispatchable
|
||||
def rooted_tree_isomorphism(t1, root1, t2, root2): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Sequence
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["combinatorial_embedding_to_pos"]
|
||||
|
||||
@_dispatchable
|
||||
def combinatorial_embedding_to_pos(embedding, fully_triangulate: bool = False): ...
|
||||
def set_position(parent, tree, remaining_nodes, delta_x, y_coordinate, pos): ...
|
||||
def get_canonical_ordering(embedding, outer_face: Sequence[Incomplete]) -> list[Incomplete]: ...
|
||||
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[tuple[Incomplete, Incomplete]]
|
||||
) -> list[Incomplete]: ...
|
||||
|
||||
@@ -11,6 +11,10 @@ __all__ = ["check_planarity", "is_planar", "PlanarEmbedding"]
|
||||
def is_planar(G: Graph[_Node]) -> bool: ...
|
||||
@_dispatchable
|
||||
def check_planarity(G: Graph[_Node], counterexample: bool = False): ...
|
||||
@_dispatchable
|
||||
def get_counterexample(G: Graph[_Node]) -> Graph[_Node]: ...
|
||||
@_dispatchable
|
||||
def get_counterexample_recursive(G: Graph[_Node]) -> Graph[_Node]: ...
|
||||
|
||||
class Interval:
|
||||
low: Incomplete
|
||||
|
||||
@@ -6,6 +6,10 @@ from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["constraint", "local_constraint", "effective_size"]
|
||||
|
||||
@_dispatchable
|
||||
def mutual_weight(G: Graph[_Node], u, v, weight=None) -> Incomplete | int: ...
|
||||
@_dispatchable
|
||||
def normalized_mutual_weight(G: Graph[_Node], u, v, norm=..., weight=None) -> float: ...
|
||||
@_dispatchable
|
||||
def effective_size(G: Graph[_Node], nodes: Iterable[Incomplete] | None = None, weight: str | None = None): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -8,5 +8,32 @@ __all__ = ["is_threshold_graph", "find_threshold_graph"]
|
||||
@_dispatchable
|
||||
def is_threshold_graph(G: Graph[_Node]) -> bool: ...
|
||||
def is_threshold_sequence(degree_sequence: Sequence[list[int]]) -> bool: ...
|
||||
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): ...
|
||||
@_dispatchable
|
||||
def threshold_graph(creation_sequence, create_using=None): ...
|
||||
@_dispatchable
|
||||
def find_alternating_4_cycle(G: Graph[_Node]): ...
|
||||
@_dispatchable
|
||||
def find_threshold_graph(G: Graph[_Node], create_using: Graph[_Node] | None = None): ...
|
||||
@_dispatchable
|
||||
def find_creation_sequence(G: Graph[_Node]): ...
|
||||
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): ...
|
||||
def random_threshold_sequence(n, p, seed=None): ...
|
||||
def right_d_threshold_sequence(n, m): ...
|
||||
def left_d_threshold_sequence(n, m): ...
|
||||
def swap_d(cs, p_split=1.0, p_combine=1.0, seed=None): ...
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["edge_bfs"]
|
||||
|
||||
FORWARD: Final = "forward"
|
||||
REVERSE: Final = "reverse"
|
||||
|
||||
@_dispatchable
|
||||
def edge_bfs(G: Graph[_Node], source=None, orientation=None) -> Generator[Incomplete, None, Incomplete]: ...
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["edge_dfs"]
|
||||
|
||||
FORWARD: Final = "forward"
|
||||
REVERSE: Final = "reverse"
|
||||
|
||||
@_dispatchable
|
||||
def edge_dfs(G: Graph[_Node], source=None, orientation=None) -> Generator[Incomplete, None, Incomplete]: ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterator
|
||||
from dataclasses import dataclass
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.digraph import DiGraph
|
||||
from networkx.classes.graph import _Node
|
||||
@@ -18,6 +19,11 @@ __all__ = [
|
||||
"ArborescenceIterator",
|
||||
]
|
||||
|
||||
KINDS: Final[set[str]]
|
||||
STYLES: Final[dict[str, str]]
|
||||
INF: Final[float]
|
||||
|
||||
def random_string(L=15, seed=None): ...
|
||||
@_dispatchable
|
||||
def branching_weight(G: DiGraph[_Node], attr: str = "weight", default: float = 1): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterator
|
||||
from collections.abc import Callable, Generator, Iterator
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Literal
|
||||
from typing import Final, Literal
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
@@ -25,6 +25,15 @@ class EdgePartition(Enum):
|
||||
INCLUDED = 1
|
||||
EXCLUDED = 2
|
||||
|
||||
@_dispatchable
|
||||
def boruvka_mst_edges(G: Graph[_Node], minimum=True, weight="weight", keys=False, data=True, ignore_nan=False): ...
|
||||
@_dispatchable
|
||||
def kruskal_mst_edges(G: Graph[_Node], minimum, weight="weight", keys=True, data=True, ignore_nan=False, partition=None): ...
|
||||
@_dispatchable
|
||||
def prim_mst_edges(G: Graph[_Node], minimum, weight="weight", keys=True, data=True, ignore_nan=False): ...
|
||||
|
||||
ALGORITHMS: Final[dict[str, Callable[..., Generator[Incomplete, Incomplete, Incomplete]]]]
|
||||
|
||||
@_dispatchable
|
||||
def minimum_spanning_edges(
|
||||
G: Graph[_Node],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Collection, Generator
|
||||
from typing import Final
|
||||
|
||||
from networkx.classes.digraph import DiGraph
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
@@ -8,6 +9,10 @@ from numpy.random import RandomState
|
||||
|
||||
__all__ = ["triadic_census", "is_triad", "all_triplets", "all_triads", "triads_by_type", "triad_type", "random_triad"]
|
||||
|
||||
TRICODES: Final[tuple[int, ...]]
|
||||
TRIAD_NAMES: Final[tuple[str, ...]]
|
||||
TRICODE_TO_NAME: Final[dict[int, str]]
|
||||
|
||||
@_dispatchable
|
||||
def triadic_census(G: DiGraph[_Node], nodelist: Collection[_Node] | None = None): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -16,6 +16,7 @@ class DiGraph(Graph[_Node]):
|
||||
def has_successor(self, u: _Node, v: _Node) -> bool: ...
|
||||
def has_predecessor(self, u: _Node, v: _Node) -> bool: ...
|
||||
def successors(self, n: _Node) -> Iterator[_Node]: ...
|
||||
neighbors = successors
|
||||
def predecessors(self, n: _Node) -> Iterator[_Node]: ...
|
||||
@cached_property
|
||||
def out_edges(self) -> OutEdgeView[_Node]: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Collection, Sequence
|
||||
from collections.abc import Collection, Iterable, Sequence
|
||||
|
||||
__all__ = [
|
||||
"draw",
|
||||
@@ -107,3 +107,6 @@ def draw_spring(G, **kwargs) -> None: ...
|
||||
def draw_shell(G, nlist=None, **kwargs) -> None: ...
|
||||
def draw_planar(G, **kwargs) -> None: ...
|
||||
def draw_forceatlas2(G, **kwargs) -> None: ...
|
||||
def apply_alpha(
|
||||
colors, alpha: float | Iterable[float], elem_list, cmap=None, vmin: float | None = None, vmax: float | None = None
|
||||
): ...
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
from importlib.abc import Traversable
|
||||
from typing import Final
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["graph_atlas", "graph_atlas_g"]
|
||||
|
||||
NUM_GRAPHS: Final = 1253
|
||||
ATLAS_FILE: Final[Traversable]
|
||||
|
||||
@_dispatchable
|
||||
def graph_atlas(i): ...
|
||||
@_dispatchable
|
||||
|
||||
@@ -21,4 +21,6 @@ def scale_free_graph(
|
||||
initial_graph=None,
|
||||
): ...
|
||||
@_dispatchable
|
||||
def random_uniform_k_out_graph(n: int, k: int, self_loops: bool = True, with_replacement: bool = True, seed=None): ...
|
||||
@_dispatchable
|
||||
def random_k_out_graph(n, k, alpha, self_loops: bool = True, seed=None): ...
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["random_internet_as_graph"]
|
||||
|
||||
def uniform_int_from_avg(a, m, seed): ...
|
||||
def choose_pref_attach(degs: Mapping[Incomplete, Incomplete], seed): ...
|
||||
|
||||
class AS_graph_generator:
|
||||
seed: Incomplete
|
||||
n_t: Incomplete
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from typing import Final
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["triad_graph"]
|
||||
|
||||
TRIAD_EDGES: Final[dict[str, list[str]]]
|
||||
|
||||
@_dispatchable
|
||||
def triad_graph(triad_name): ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
from enum import Enum
|
||||
from typing import Generic, NamedTuple, TypeVar
|
||||
from typing import Final, Generic, NamedTuple, TypeVar
|
||||
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
@@ -9,6 +9,9 @@ _T = TypeVar("_T")
|
||||
|
||||
__all__ = ["read_gml", "parse_gml", "generate_gml", "write_gml"]
|
||||
|
||||
def escape(text): ...
|
||||
def unescape(text): ...
|
||||
def literal_destringizer(rep: str): ...
|
||||
@_dispatchable
|
||||
def read_gml(path, label: str = "label", destringizer=None): ...
|
||||
@_dispatchable
|
||||
@@ -29,5 +32,9 @@ class Token(NamedTuple, Generic[_T]):
|
||||
line: int
|
||||
position: int
|
||||
|
||||
LIST_START_VALUE: Final = "_networkx_list_start"
|
||||
|
||||
def parse_gml_lines(lines, label, destringizer): ...
|
||||
def literal_stringizer(value) -> str: ...
|
||||
def generate_gml(G, stringizer=None) -> Generator[Incomplete, Incomplete, None]: ...
|
||||
def write_gml(G, path, stringizer=None) -> None: ...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterable
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
from networkx.utils.backends import _dispatchable
|
||||
|
||||
__all__ = ["from_graph6_bytes", "read_graph6", "to_graph6_bytes", "write_graph6"]
|
||||
@@ -8,3 +12,6 @@ def to_graph6_bytes(G, nodes=None, header: bool = True): ...
|
||||
@_dispatchable
|
||||
def read_graph6(path): ...
|
||||
def write_graph6(G, path, nodes=None, header: bool = True): ...
|
||||
def write_graph6_file(G: Graph[_Node], f, nodes: Iterable[Incomplete] | None = None, header: bool = True): ...
|
||||
def data_to_n(data): ...
|
||||
def n_to_data(n): ...
|
||||
|
||||
@@ -11,3 +11,4 @@ def write_pajek(G, path, encoding: str = "UTF-8") -> None: ...
|
||||
def read_pajek(path, encoding: str = "UTF-8"): ...
|
||||
@_dispatchable
|
||||
def parse_pajek(lines): ...
|
||||
def make_qstr(t): ...
|
||||
|
||||
@@ -1,26 +1,11 @@
|
||||
from networkx.utils.backends import _dispatchable as _dispatchable
|
||||
from networkx.utils.backends import *
|
||||
from networkx.utils.backends import _dispatchable as _dispatchable # for pytype to see the re-export in networkx/__init__.py
|
||||
from networkx.utils.configs import *
|
||||
from networkx.utils.configs import NetworkXConfig
|
||||
from networkx.utils.decorators import *
|
||||
from networkx.utils.heaps import *
|
||||
|
||||
# should be import * but pytype doesn't understand that _clear_cache is part of __all__
|
||||
from networkx.utils.misc import (
|
||||
PythonRandomInterface as PythonRandomInterface,
|
||||
PythonRandomViaNumpyBits as PythonRandomViaNumpyBits,
|
||||
_clear_cache as _clear_cache,
|
||||
arbitrary_element as arbitrary_element,
|
||||
create_py_random_state as create_py_random_state,
|
||||
create_random_state as create_random_state,
|
||||
dict_to_numpy_array as dict_to_numpy_array,
|
||||
edges_equal as edges_equal,
|
||||
flatten as flatten,
|
||||
graphs_equal as graphs_equal,
|
||||
groups as groups,
|
||||
make_list_of_ints as make_list_of_ints,
|
||||
nodes_equal as nodes_equal,
|
||||
pairwise as pairwise,
|
||||
)
|
||||
from networkx.utils.misc import *
|
||||
from networkx.utils.misc import _clear_cache as _clear_cache # for pytype to see the re-export in networkx/__init__.py
|
||||
from networkx.utils.random_sequence import *
|
||||
from networkx.utils.rcm import *
|
||||
from networkx.utils.union_find import *
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
|
||||
from networkx.classes.graph import Graph, _Node
|
||||
|
||||
__all__ = ["cuthill_mckee_ordering", "reverse_cuthill_mckee_ordering"]
|
||||
|
||||
def cuthill_mckee_ordering(G, heuristic=None) -> Generator[Incomplete, Incomplete, None]: ...
|
||||
def reverse_cuthill_mckee_ordering(G, heuristic=None): ...
|
||||
def connected_cuthill_mckee_ordering(G: Graph[_Node], heuristic=None): ...
|
||||
def pseudo_peripheral_node(G: Graph[_Node]): ...
|
||||
|
||||
Reference in New Issue
Block a user