Skip to content

Commit 27ab92d

Browse files
authored
[networkx] Use concrete node types for the Harary, circulant and expander generators (#16635)
1 parent ccdc905 commit 27ab92d

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎stubs/networkx/networkx/generators/classic.pyi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def circular_ladder_graph(n, create_using=None): ...
5151
@_dispatchable
5252
def circulant_graph(
5353
n: int, offsets: list[int], create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None
54-
) -> Graph[Incomplete]: ...
54+
) -> Graph[int]: ...
5555
@_dispatchable
5656
def cycle_graph(n: int | Iterable[Incomplete], create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None): ...
5757
@_dispatchable

‎stubs/networkx/networkx/generators/expanders.pyi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ __all__ = [
1818
@_dispatchable
1919
def margulis_gabber_galil_graph(
2020
n: int, create_using: MultiGraph[Incomplete] | type[MultiGraph[Incomplete]] | None = None
21-
) -> Graph[Incomplete]: ...
21+
) -> Graph[tuple[int, int]]: ...
2222
@_dispatchable
23-
def chordal_cycle_graph(p: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[Incomplete]: ...
23+
def chordal_cycle_graph(p: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[int]: ...
2424
@_dispatchable
25-
def paley_graph(p: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[Incomplete]: ...
25+
def paley_graph(p: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[int]: ...
2626
@_dispatchable
27-
def maybe_regular_expander_graph(n: int, d: int, *, create_using=None, max_tries: int = 100, seed=None) -> Graph[Incomplete]: ...
27+
def maybe_regular_expander_graph(n: int, d: int, *, create_using=None, max_tries: int = 100, seed=None) -> Graph[int]: ...
2828
@deprecated(
2929
"`maybe_regular_expander` is a deprecated alias for `maybe_regular_expander_graph`. "
3030
"Use `maybe_regular_expander_graph` instead."
@@ -33,4 +33,4 @@ def maybe_regular_expander(n, d, *, create_using=None, max_tries: int = 100, see
3333
@_dispatchable
3434
def is_regular_expander(G: Graph[_Node], *, epsilon: float = 0) -> bool: ...
3535
@_dispatchable
36-
def random_regular_expander_graph(n: int, d: int, *, epsilon=0, create_using=None, max_tries=100, seed=None): ...
36+
def random_regular_expander_graph(n: int, d: int, *, epsilon=0, create_using=None, max_tries=100, seed=None) -> Graph[int]: ...

‎stubs/networkx/networkx/generators/harary_graph.pyi‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ from networkx.utils.backends import _dispatchable
66
__all__ = ["hnm_harary_graph", "hkn_harary_graph"]
77

88
@_dispatchable
9-
def hnm_harary_graph(
10-
n: int, m: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None
11-
) -> Graph[Incomplete]: ...
9+
def hnm_harary_graph(n: int, m: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[int]: ...
1210
@_dispatchable
13-
def hkn_harary_graph(
14-
k: int, n: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None
15-
) -> Graph[Incomplete]: ...
11+
def hkn_harary_graph(k: int, n: int, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None) -> Graph[int]: ...

0 commit comments

Comments
 (0)