Fix generics in NetworkX (#13864)

This commit is contained in:
thomas-whaley-poco
2025-04-25 23:20:40 +12:00
committed by GitHub
parent dd8532343d
commit 97dc39bc65
2 changed files with 20 additions and 20 deletions
@@ -11,14 +11,14 @@ def single_target_shortest_path_length(G: Graph[_Node], target: _Node, cutoff: i
@_dispatchable
def all_pairs_shortest_path_length(G: Graph[_Node], cutoff: int | None = None) -> Generator[Incomplete, None, None]: ...
@_dispatchable
def bidirectional_shortest_path(G: Graph[_Node], source: str, target: str): ...
def bidirectional_shortest_path(G: Graph[_Node], source: _Node, target: _Node): ...
@_dispatchable
def single_source_shortest_path(G: Graph[_Node], source: str, cutoff: int | None = None): ...
def single_source_shortest_path(G: Graph[_Node], source: _Node, cutoff: int | None = None): ...
@_dispatchable
def single_target_shortest_path(G: Graph[_Node], target: str, cutoff: int | None = None): ...
def single_target_shortest_path(G: Graph[_Node], target: _Node, cutoff: int | None = None): ...
@_dispatchable
def all_pairs_shortest_path(G: Graph[_Node], cutoff: int | None = None) -> Generator[Incomplete, None, None]: ...
@_dispatchable
def predecessor(
G: Graph[_Node], source: str, target: str | None = None, cutoff: int | None = None, return_seen: bool | None = None
G: Graph[_Node], source: _Node, target: _Node | None = None, cutoff: int | None = None, return_seen: bool | None = None
): ...
@@ -15,8 +15,8 @@ def dijkstra_path(
@_dispatchable
def dijkstra_path_length(
G: Graph[_Node],
source: str,
target: str,
source: _Node,
target: _Node,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@_dispatchable
@@ -29,15 +29,15 @@ def single_source_dijkstra_path(
@_dispatchable
def single_source_dijkstra_path_length(
G: Graph[_Node],
source: str,
source: _Node,
cutoff: float | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@_dispatchable
def single_source_dijkstra(
G: Graph[_Node],
source: str,
target: str | None = None,
source: _Node,
target: _Node | None = None,
cutoff: float | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@@ -59,14 +59,14 @@ def multi_source_dijkstra_path_length(
def multi_source_dijkstra(
G: Graph[_Node],
sources,
target: str | None = None,
target: _Node | None = None,
cutoff: float | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@_dispatchable
def dijkstra_predecessor_and_distance(
G: Graph[_Node],
source: str,
source: _Node,
cutoff: float | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@@ -91,8 +91,8 @@ def all_pairs_dijkstra_path(
@_dispatchable
def bellman_ford_predecessor_and_distance(
G: Graph[_Node],
source: str,
target: str | None = None,
source: _Node,
target: _Node | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
heuristic: bool = False,
): ...
@@ -106,8 +106,8 @@ def bellman_ford_path(
@_dispatchable
def bellman_ford_path_length(
G: Graph[_Node],
source: str,
target: str,
source: _Node,
target: _Node,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@_dispatchable
@@ -116,13 +116,13 @@ def single_source_bellman_ford_path(
): ...
@_dispatchable
def single_source_bellman_ford_path_length(
G: Graph[_Node], source: str, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
G: Graph[_Node], source: _Node, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
): ...
@_dispatchable
def single_source_bellman_ford(
G: Graph[_Node],
source: str,
target: str | None = None,
source: _Node,
target: _Node | None = None,
weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight",
): ...
@_dispatchable
@@ -135,7 +135,7 @@ def all_pairs_bellman_ford_path(
) -> Generator[Incomplete, None, None]: ...
@_dispatchable
def goldberg_radzik(
G: Graph[_Node], source: str, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
G: Graph[_Node], source: _Node, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
): ...
@_dispatchable
def negative_edge_cycle(
@@ -145,7 +145,7 @@ def negative_edge_cycle(
): ...
@_dispatchable
def find_negative_cycle(
G: Graph[_Node], source: str, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
G: Graph[_Node], source: _Node, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = "weight"
): ...
@_dispatchable
def bidirectional_dijkstra(