Skip to content

Commit 84c78c6

Browse files
authored
Extract NetworkX types from docstrings (#13458)
1 parent 9da1df6 commit 84c78c6

File tree

171 files changed

+1378
-842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+1378
-842
lines changed

stubs/networkx/networkx/algorithms/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ from networkx.algorithms.bipartite import (
3030
)
3131
from networkx.algorithms.boundary import *
3232
from networkx.algorithms.bridges import *
33+
from networkx.algorithms.broadcasting import *
3334
from networkx.algorithms.centrality import *
3435
from networkx.algorithms.chains import *
3536
from networkx.algorithms.chordal import *
@@ -116,6 +117,7 @@ from networkx.algorithms.sparsifiers import *
116117
from networkx.algorithms.structuralholes import *
117118
from networkx.algorithms.summarization import *
118119
from networkx.algorithms.swap import *
120+
from networkx.algorithms.time_dependent import *
119121
from networkx.algorithms.traversal import *
120122
from networkx.algorithms.tree.branchings import (
121123
ArborescenceIterator as ArborescenceIterator,
@@ -132,4 +134,5 @@ from networkx.algorithms.tree.recognition import *
132134
from networkx.algorithms.triads import *
133135
from networkx.algorithms.vitality import *
134136
from networkx.algorithms.voronoi import *
137+
from networkx.algorithms.walks import *
135138
from networkx.algorithms.wiener import *
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
from networkx.classes.graph import Graph, _Node
12
from networkx.utils.backends import _dispatchable
23

34
@_dispatchable
4-
def maximum_independent_set(G): ...
5+
def maximum_independent_set(G: Graph[_Node]): ...
56
@_dispatchable
6-
def max_clique(G): ...
7+
def max_clique(G: Graph[_Node]): ...
78
@_dispatchable
8-
def clique_removal(G): ...
9+
def clique_removal(G: Graph[_Node]): ...
910
@_dispatchable
10-
def large_clique_size(G): ...
11+
def large_clique_size(G: Graph[_Node]): ...
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from _typeshed import Incomplete
2-
1+
from networkx.classes.graph import Graph, _Node
32
from networkx.utils.backends import _dispatchable
3+
from numpy.random import RandomState
44

55
@_dispatchable
6-
def average_clustering(G, trials: int = 1000, seed: Incomplete | None = None): ...
6+
def average_clustering(G: Graph[_Node], trials: int = 1000, seed: int | RandomState | None = None): ...
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from _typeshed import Incomplete
2+
from collections.abc import Iterable
23

4+
from networkx.classes.graph import Graph, _Node
35
from networkx.utils.backends import _dispatchable
46

57
@_dispatchable
6-
def local_node_connectivity(G, source, target, cutoff: Incomplete | None = None): ...
8+
def local_node_connectivity(G: Graph[_Node], source: _Node, target: _Node, cutoff: int | None = None): ...
79
@_dispatchable
8-
def node_connectivity(G, s: Incomplete | None = None, t: Incomplete | None = None): ...
10+
def node_connectivity(G: Graph[_Node], s: _Node | None = None, t: _Node | None = None): ...
911
@_dispatchable
10-
def all_pairs_node_connectivity(G, nbunch: Incomplete | None = None, cutoff: Incomplete | None = None): ...
12+
def all_pairs_node_connectivity(G: Graph[_Node], nbunch: Iterable[Incomplete] | None = None, cutoff: int | None = None): ...
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from _typeshed import Incomplete
2-
1+
from networkx.classes.graph import Graph, _Node
32
from networkx.utils.backends import _dispatchable
3+
from numpy.random import RandomState
44

55
@_dispatchable
6-
def diameter(G, seed: Incomplete | None = None): ...
6+
def diameter(G: Graph[_Node], seed: int | RandomState | None = None): ...
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from _typeshed import Incomplete
2-
1+
from networkx.classes.graph import Graph, _Node
32
from networkx.utils.backends import _dispatchable
43

54
@_dispatchable
6-
def min_weighted_dominating_set(G, weight: Incomplete | None = None): ...
5+
def min_weighted_dominating_set(G: Graph[_Node], weight: str | None = None): ...
76
@_dispatchable
8-
def min_edge_dominating_set(G): ...
7+
def min_edge_dominating_set(G: Graph[_Node]): ...
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
from networkx.classes.graph import Graph, _Node
12
from networkx.utils.backends import _dispatchable
23

34
@_dispatchable
4-
def k_components(G, min_density: float = 0.95): ...
5+
def k_components(G: Graph[_Node], min_density: float = 0.95): ...
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
from networkx.classes.graph import Graph, _Node
12
from networkx.utils.backends import _dispatchable
23

34
@_dispatchable
4-
def min_maximal_matching(G): ...
5+
def min_maximal_matching(G: Graph[_Node]): ...
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
from _typeshed import Incomplete
22

3+
from networkx.classes.graph import Graph, _Node
34
from networkx.utils.backends import _dispatchable
5+
from numpy.random import RandomState
46

57
@_dispatchable
6-
def randomized_partitioning(G, seed: Incomplete | None = None, p: float = 0.5, weight: Incomplete | None = None): ...
8+
def randomized_partitioning(
9+
G: Graph[_Node], seed: int | RandomState | None = None, p: float = 0.5, weight: str | None = None
10+
): ...
711
@_dispatchable
8-
def one_exchange(G, initial_cut: Incomplete | None = None, seed: Incomplete | None = None, weight: Incomplete | None = None): ...
12+
def one_exchange(
13+
G: Graph[_Node], initial_cut: set[Incomplete] | None = None, seed: int | RandomState | None = None, weight: str | None = None
14+
): ...
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
from networkx.classes.graph import Graph, _Node
12
from networkx.utils.backends import _dispatchable
23

34
@_dispatchable
4-
def ramsey_R2(G): ...
5+
def ramsey_R2(G: Graph[_Node]): ...

0 commit comments

Comments
 (0)