diff --git a/stubs/networkx/networkx/algorithms/components/attracting.pyi b/stubs/networkx/networkx/algorithms/components/attracting.pyi index 2085ce168..b4599cb04 100644 --- a/stubs/networkx/networkx/algorithms/components/attracting.pyi +++ b/stubs/networkx/networkx/algorithms/components/attracting.pyi @@ -1,16 +1,14 @@ -from _typeshed import Incomplete from collections.abc import Generator from networkx.classes.digraph import DiGraph from networkx.classes.graph import _Node -from networkx.classes.multidigraph import MultiDiGraph from networkx.utils.backends import _dispatchable __all__ = ["number_attracting_components", "attracting_components", "is_attracting_component"] @_dispatchable -def attracting_components(G) -> Generator[Incomplete, None, None]: ... +def attracting_components(G: DiGraph[_Node]) -> Generator[set[_Node]]: ... @_dispatchable -def number_attracting_components(G) -> int: ... +def number_attracting_components(G: DiGraph[_Node]) -> int: ... @_dispatchable -def is_attracting_component(G: DiGraph[_Node] | MultiDiGraph[_Node]) -> bool: ... +def is_attracting_component(G: DiGraph[_Node]) -> bool: ... diff --git a/stubs/networkx/networkx/algorithms/components/biconnected.pyi b/stubs/networkx/networkx/algorithms/components/biconnected.pyi index 80d102954..f6b5e78f1 100644 --- a/stubs/networkx/networkx/algorithms/components/biconnected.pyi +++ b/stubs/networkx/networkx/algorithms/components/biconnected.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from collections.abc import Generator from networkx.classes.graph import Graph, _Node @@ -9,8 +8,8 @@ __all__ = ["biconnected_components", "biconnected_component_edges", "is_biconnec @_dispatchable def is_biconnected(G: Graph[_Node]) -> bool: ... @_dispatchable -def biconnected_component_edges(G: Graph[_Node]) -> Generator[Incomplete, Incomplete, None]: ... +def biconnected_component_edges(G: Graph[_Node]) -> Generator[list[tuple[_Node, _Node]]]: ... @_dispatchable -def biconnected_components(G: Graph[_Node]) -> Generator[Incomplete, None, None]: ... +def biconnected_components(G: Graph[_Node]) -> Generator[list[set[_Node]]]: ... @_dispatchable -def articulation_points(G: Graph[_Node]) -> Generator[Incomplete, None, None]: ... +def articulation_points(G: Graph[_Node]) -> Generator[_Node]: ... diff --git a/stubs/networkx/networkx/algorithms/components/connected.pyi b/stubs/networkx/networkx/algorithms/components/connected.pyi index ba7fae6bd..e19f09c06 100644 --- a/stubs/networkx/networkx/algorithms/components/connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/connected.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from collections.abc import Generator from networkx.classes.graph import Graph, _Node @@ -7,10 +6,10 @@ from networkx.utils.backends import _dispatchable __all__ = ["number_connected_components", "connected_components", "is_connected", "node_connected_component"] @_dispatchable -def connected_components(G: Graph[_Node]) -> Generator[Incomplete, None, None]: ... +def connected_components(G: Graph[_Node]) -> Generator[set[_Node]]: ... @_dispatchable -def number_connected_components(G: Graph[_Node]): ... +def number_connected_components(G: Graph[_Node]) -> int: ... @_dispatchable def is_connected(G: Graph[_Node]) -> bool: ... @_dispatchable -def node_connected_component(G: Graph[_Node], n: _Node) -> set[Incomplete]: ... +def node_connected_component(G: Graph[_Node], n: _Node) -> set[_Node]: ... diff --git a/stubs/networkx/networkx/algorithms/components/semiconnected.pyi b/stubs/networkx/networkx/algorithms/components/semiconnected.pyi index 17fc43bac..f83e432c4 100644 --- a/stubs/networkx/networkx/algorithms/components/semiconnected.pyi +++ b/stubs/networkx/networkx/algorithms/components/semiconnected.pyi @@ -1,7 +1,8 @@ -from networkx.classes.graph import Graph, _Node +from networkx.classes.digraph import DiGraph +from networkx.classes.graph import _Node from networkx.utils.backends import _dispatchable __all__ = ["is_semiconnected"] @_dispatchable -def is_semiconnected(G: Graph[_Node]) -> bool: ... +def is_semiconnected(G: DiGraph[_Node]) -> bool: ... diff --git a/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi b/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi index 7bbf495ae..bc0bb03a5 100644 --- a/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi @@ -1,7 +1,7 @@ -from collections.abc import Generator +from collections.abc import Generator, Iterable from networkx.classes.digraph import DiGraph -from networkx.classes.graph import Graph, _Node +from networkx.classes.graph import _Node from networkx.utils.backends import _dispatchable __all__ = [ @@ -13,12 +13,12 @@ __all__ = [ ] @_dispatchable -def strongly_connected_components(G: Graph[_Node]) -> Generator[set[_Node], None, None]: ... +def strongly_connected_components(G: DiGraph[_Node]) -> Generator[set[_Node]]: ... @_dispatchable -def kosaraju_strongly_connected_components(G: Graph[_Node], source=None) -> Generator[set[_Node], None, None]: ... +def kosaraju_strongly_connected_components(G: DiGraph[_Node], source: _Node | None = None) -> Generator[set[_Node]]: ... @_dispatchable -def number_strongly_connected_components(G: Graph[_Node]) -> int: ... +def number_strongly_connected_components(G: DiGraph[_Node]) -> int: ... @_dispatchable -def is_strongly_connected(G: Graph[_Node]) -> bool: ... +def is_strongly_connected(G: DiGraph[_Node]) -> bool: ... @_dispatchable -def condensation(G: DiGraph[_Node], scc=None) -> DiGraph[int]: ... +def condensation(G: DiGraph[_Node], scc: Iterable[Iterable[_Node]] | None = None) -> DiGraph[int]: ... diff --git a/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi b/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi index b854f21ac..ca026575a 100644 --- a/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi +++ b/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi @@ -1,13 +1,14 @@ from collections.abc import Generator -from networkx.classes.graph import Graph, _Node +from networkx.classes.digraph import DiGraph +from networkx.classes.graph import _Node from networkx.utils.backends import _dispatchable __all__ = ["number_weakly_connected_components", "weakly_connected_components", "is_weakly_connected"] @_dispatchable -def weakly_connected_components(G: Graph[_Node]) -> Generator[set[_Node], None, None]: ... +def weakly_connected_components(G: DiGraph[_Node]) -> Generator[set[_Node]]: ... @_dispatchable -def number_weakly_connected_components(G: Graph[_Node]) -> int: ... +def number_weakly_connected_components(G: DiGraph[_Node]) -> int: ... @_dispatchable -def is_weakly_connected(G: Graph[_Node]) -> bool: ... +def is_weakly_connected(G: DiGraph[_Node]) -> bool: ...