Skip to content

Commit 4fa56fb

Browse files
authored
networkx: complete the link_analysis algorithms module (#14627)
1 parent 0183650 commit 4fa56fb

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from _typeshed import Incomplete, SupportsGetItem
1+
from collections.abc import Mapping
22

33
from networkx.classes.graph import Graph, _Node
44
from networkx.utils.backends import _dispatchable
@@ -10,6 +10,6 @@ def hits(
1010
G: Graph[_Node],
1111
max_iter: int | None = 100,
1212
tol: float | None = 1e-08,
13-
nstart: SupportsGetItem[Incomplete, Incomplete] | None = None,
13+
nstart: Mapping[_Node, float] | None = None,
1414
normalized: bool = True,
15-
): ...
15+
) -> tuple[dict[_Node, float], dict[_Node, float]]: ...
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from _typeshed import Incomplete, SupportsGetItem
2-
from collections.abc import Collection
1+
from collections.abc import Collection, Mapping
32

3+
import numpy as np
4+
from networkx._typing import Array2D
45
from networkx.classes.graph import Graph, _Node
56
from networkx.utils.backends import _dispatchable
67

@@ -10,19 +11,19 @@ __all__ = ["pagerank", "google_matrix"]
1011
def pagerank(
1112
G: Graph[_Node],
1213
alpha: float | None = 0.85,
13-
personalization: SupportsGetItem[Incomplete, Incomplete] | None = None,
14+
personalization: Mapping[_Node, float] | None = None,
1415
max_iter: int | None = 100,
1516
tol: float | None = 1e-06,
16-
nstart: SupportsGetItem[Incomplete, Incomplete] | None = None,
17+
nstart: Mapping[_Node, float] | None = None,
1718
weight: str | None = "weight",
18-
dangling: SupportsGetItem[Incomplete, Incomplete] | None = None,
19-
) -> dict[Incomplete, float]: ...
19+
dangling: Mapping[_Node, float] | None = None,
20+
) -> dict[_Node, float]: ...
2021
@_dispatchable
2122
def google_matrix(
2223
G: Graph[_Node],
2324
alpha: float = 0.85,
24-
personalization: SupportsGetItem[Incomplete, Incomplete] | None = None,
25+
personalization: Mapping[_Node, float] | None = None,
2526
nodelist: Collection[_Node] | None = None,
2627
weight: str | None = "weight",
27-
dangling: SupportsGetItem[Incomplete, Incomplete] | None = None,
28-
): ...
28+
dangling: Mapping[_Node, float] | None = None,
29+
) -> Array2D[np.float64]: ...

0 commit comments

Comments
 (0)