Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stubs/networkx/networkx/algorithms/assortativity/mixing.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from collections.abc import Iterable
from _typeshed import Incomplete
from collections.abc import Iterable, Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -15,7 +15,7 @@ def attribute_mixing_matrix(
G: Graph[_Node],
attribute: str,
nodes: Iterable[Incomplete] | None = None,
mapping: SupportsGetItem[Incomplete, Incomplete] | None = None,
mapping: Mapping[Incomplete, Incomplete] | None = None,
normalized: bool = True,
): ...
@_dispatchable
Expand All @@ -30,7 +30,7 @@ def degree_mixing_matrix(
weight: str | None = None,
nodes: Iterable[Incomplete] | None = None,
normalized: bool = True,
mapping: SupportsGetItem[Incomplete, Incomplete] | None = None,
mapping: Mapping[Incomplete, Incomplete] | None = None,
): ...
@_dispatchable
def mixing_dict(xy, normalized: bool = False) -> dict[Incomplete, Incomplete]: ...
6 changes: 3 additions & 3 deletions stubs/networkx/networkx/algorithms/bipartite/matching.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from collections.abc import Iterable
from _typeshed import Incomplete
from collections.abc import Iterable, Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -12,7 +12,7 @@ def hopcroft_karp_matching(G: Graph[_Node], top_nodes: Iterable[_Node] | None =
def eppstein_matching(G: Graph[_Node], top_nodes: Iterable[Incomplete] | None = None) -> dict[Incomplete, Incomplete]: ...
@_dispatchable
def to_vertex_cover(
G: Graph[_Node], matching: SupportsGetItem[Incomplete, Incomplete], top_nodes: Iterable[Incomplete] | None = None
G: Graph[_Node], matching: Mapping[Incomplete, Incomplete], top_nodes: Iterable[Incomplete] | None = None
): ...

maximum_matching = hopcroft_karp_matching
Expand Down
4 changes: 2 additions & 2 deletions stubs/networkx/networkx/algorithms/centrality/closeness.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete, SupportsKeysAndGetItem

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -13,7 +13,7 @@ def closeness_centrality(
def incremental_closeness_centrality(
G: Graph[_Node],
edge: tuple[Incomplete],
prev_cc: SupportsGetItem[Incomplete, Incomplete] | None = None,
prev_cc: SupportsKeysAndGetItem[Incomplete, Incomplete] | None = None,
insertion: bool | None = True,
wf_improved: bool | None = True,
) -> dict[_Node, float]: ...
5 changes: 3 additions & 2 deletions stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete
from collections.abc import Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -10,7 +11,7 @@ def eigenvector_centrality(
G: Graph[_Node],
max_iter: int | None = 100,
tol: float | None = 1e-06,
nstart: SupportsGetItem[Incomplete, Incomplete] | None = None,
nstart: Mapping[Incomplete, Incomplete] | None = None,
weight: str | None = None,
) -> dict[Incomplete, float]: ...
@_dispatchable
Expand Down
9 changes: 5 additions & 4 deletions stubs/networkx/networkx/algorithms/centrality/katz.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import ConvertibleToFloat, Incomplete, SupportsItemAccess
from collections.abc import Iterable, Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -9,18 +10,18 @@ __all__ = ["katz_centrality", "katz_centrality_numpy"]
def katz_centrality(
G: Graph[_Node],
alpha: float | None = 0.1,
beta: float | SupportsGetItem[Incomplete, Incomplete] | None = 1.0,
beta: ConvertibleToFloat | Iterable[Incomplete] | None = 1.0,
max_iter: int | None = 1000,
tol: float | None = 1e-06,
nstart: SupportsGetItem[Incomplete, Incomplete] | None = None,
nstart: SupportsItemAccess[Incomplete, Incomplete] | None = None,
normalized: bool | None = True,
weight: str | None = None,
) -> dict[Incomplete, Incomplete]: ...
@_dispatchable
def katz_centrality_numpy(
G: Graph[_Node],
alpha: float = 0.1,
beta: float | SupportsGetItem[Incomplete, Incomplete] | None = 1.0,
beta: float | Mapping[Incomplete, Incomplete] | None = 1.0,
normalized: bool = True,
weight: str | None = None,
) -> dict[Incomplete, Incomplete]: ...
5 changes: 3 additions & 2 deletions stubs/networkx/networkx/algorithms/centrality/percolation.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete
from collections.abc import Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -9,6 +10,6 @@ __all__ = ["percolation_centrality"]
def percolation_centrality(
G: Graph[_Node],
attribute: str | None = "percolation",
states: SupportsGetItem[Incomplete, Incomplete] | None = None,
states: Mapping[Incomplete, Incomplete] | None = None,
weight: str | None = None,
) -> dict[Incomplete, float]: ...
5 changes: 3 additions & 2 deletions stubs/networkx/networkx/algorithms/centrality/reaching.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete
from collections.abc import Mapping

from networkx.classes.digraph import DiGraph
from networkx.classes.graph import _Node
Expand All @@ -12,7 +13,7 @@ def global_reaching_centrality(G: DiGraph[_Node], weight: str | None = None, nor
def local_reaching_centrality(
G: DiGraph[_Node],
v: _Node,
paths: SupportsGetItem[Incomplete, Incomplete] | None = None,
paths: Mapping[Incomplete, Incomplete] | None = None,
weight: str | None = None,
normalized: bool | None = True,
) -> float: ...
11 changes: 6 additions & 5 deletions stubs/networkx/networkx/algorithms/core.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete
from collections.abc import Mapping

from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
Expand All @@ -8,13 +9,13 @@ __all__ = ["core_number", "k_core", "k_shell", "k_crust", "k_corona", "k_truss",
@_dispatchable
def core_number(G: Graph[_Node]) -> dict[Incomplete, Incomplete]: ...
@_dispatchable
def k_core(G: Graph[_Node], k: int | None = None, core_number: SupportsGetItem[Incomplete, Incomplete] | None = None): ...
def k_core(G: Graph[_Node], k: int | None = None, core_number: Mapping[Incomplete, Incomplete] | None = None): ...
@_dispatchable
def k_shell(G: Graph[_Node], k: int | None = None, core_number: SupportsGetItem[Incomplete, Incomplete] | None = None): ...
def k_shell(G: Graph[_Node], k: int | None = None, core_number: Mapping[Incomplete, Incomplete] | None = None): ...
@_dispatchable
def k_crust(G: Graph[_Node], k: int | None = None, core_number: SupportsGetItem[Incomplete, Incomplete] | None = None): ...
def k_crust(G: Graph[_Node], k: int | None = None, core_number: Mapping[Incomplete, Incomplete] | None = None): ...
@_dispatchable
def k_corona(G: Graph[_Node], k: int, core_number: SupportsGetItem[Incomplete, Incomplete] | None = None): ...
def k_corona(G: Graph[_Node], k: int | None, core_number: Mapping[Incomplete, Incomplete] | None = None): ...
@_dispatchable
def k_truss(G: Graph[_Node], k: int): ...
@_dispatchable
Expand Down
4 changes: 2 additions & 2 deletions stubs/networkx/networkx/algorithms/similarity.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import Incomplete, SupportsGetItem
from _typeshed import Incomplete, SupportsItemAccess
from collections.abc import Callable, Generator

from networkx.classes.graph import Graph, _Node
Expand Down Expand Up @@ -101,7 +101,7 @@ def generate_random_paths(
G: Graph[_Node],
sample_size: int,
path_length: int = 5,
index_map: SupportsGetItem[Incomplete, Incomplete] | None = None,
index_map: SupportsItemAccess[Incomplete, Incomplete] | None = None,
weight: str | None = "weight",
seed: int | RandomState | None = None,
*,
Expand Down
Loading