1
- from _typeshed import Incomplete , SupportsGetItem
2
- from collections .abc import Collection
1
+ from collections .abc import Collection , Mapping
3
2
3
+ import numpy as np
4
+ from networkx ._typing import Array2D
4
5
from networkx .classes .graph import Graph , _Node
5
6
from networkx .utils .backends import _dispatchable
6
7
@@ -10,19 +11,19 @@ __all__ = ["pagerank", "google_matrix"]
10
11
def pagerank (
11
12
G : Graph [_Node ],
12
13
alpha : float | None = 0.85 ,
13
- personalization : SupportsGetItem [ Incomplete , Incomplete ] | None = None ,
14
+ personalization : Mapping [ _Node , float ] | None = None ,
14
15
max_iter : int | None = 100 ,
15
16
tol : float | None = 1e-06 ,
16
- nstart : SupportsGetItem [ Incomplete , Incomplete ] | None = None ,
17
+ nstart : Mapping [ _Node , float ] | None = None ,
17
18
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 ]: ...
20
21
@_dispatchable
21
22
def google_matrix (
22
23
G : Graph [_Node ],
23
24
alpha : float = 0.85 ,
24
- personalization : SupportsGetItem [ Incomplete , Incomplete ] | None = None ,
25
+ personalization : Mapping [ _Node , float ] | None = None ,
25
26
nodelist : Collection [_Node ] | None = None ,
26
27
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