Skip to content

Commit 31a5b4c

Browse files
authored
[networkx] Use concrete node types for the atlas, cograph and duplication generators (#16793)
1 parent 7a604d5 commit 31a5b4c

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎stubs/networkx/networkx/generators/atlas.pyi‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
from _typeshed import Incomplete
32
from typing import Final
43

54
from networkx.utils.backends import _dispatchable
@@ -17,6 +16,6 @@ NUM_GRAPHS: Final = 1253
1716
ATLAS_FILE: Final[Traversable]
1817

1918
@_dispatchable
20-
def graph_atlas(i: int) -> Graph[Incomplete]: ...
19+
def graph_atlas(i: int) -> Graph[int]: ...
2120
@_dispatchable
22-
def graph_atlas_g() -> list[Graph[Incomplete]]: ...
21+
def graph_atlas_g() -> list[Graph[int]]: ...
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from _typeshed import Incomplete
2-
31
from networkx.classes.graph import Graph
42
from networkx.utils.backends import _dispatchable
53

64
__all__ = ["random_cograph"]
75

86
@_dispatchable
9-
def random_cograph(n: int, seed=None) -> Graph[Incomplete]: ...
7+
def random_cograph(n: int, seed=None) -> Graph[int]: ...
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from _typeshed import Incomplete
2-
31
from networkx.utils.backends import _dispatchable
42

53
from ..classes.graph import Graph
64

75
__all__ = ["partial_duplication_graph", "duplication_divergence_graph"]
86

97
@_dispatchable
10-
def partial_duplication_graph(N: int, n: int, p: float, q: float, seed=None): ...
8+
def partial_duplication_graph(N: int, n: int, p: float, q: float, seed=None) -> Graph[int]: ...
119
@_dispatchable
12-
def duplication_divergence_graph(n: int, p: float, seed=None) -> Graph[Incomplete]: ...
10+
def duplication_divergence_graph(n: int, p: float, seed=None) -> Graph[int]: ...

0 commit comments

Comments
 (0)