-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Created a type alias for _WeightFunction
- Loading branch information
1 parent
2eac0de
commit 7d754a8
Showing
1 changed file
with
54 additions
and
65 deletions.
There are no files selected for viewing
119 changes: 54 additions & 65 deletions
119
stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,89 @@ | ||
from collections.abc import Callable | ||
from typing import Any, TypeAlias | ||
from _typeshed import Incomplete | ||
from collections.abc import Callable, Generator | ||
from typing import Any | ||
|
||
from networkx.utils.backends import _dispatch | ||
|
||
_WeightFunction: TypeAlias = Callable[[Any, Any, dict[str, Any]], float | None] | ||
|
||
@_dispatch | ||
def dijkstra_path(G, source, target, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def dijkstra_path(G, source, target, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def dijkstra_path_length(G, source, target, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def dijkstra_path_length(G, source, target, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_dijkstra_path( | ||
G, source, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def single_source_dijkstra_path(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_dijkstra_path_length( | ||
G, source, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def single_source_dijkstra_path_length(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_dijkstra( | ||
G, | ||
source, | ||
target: Incomplete | None = None, | ||
cutoff: Incomplete | None = None, | ||
weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight", | ||
G, source, target: Incomplete | None = None, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" | ||
): ... | ||
|
||
@_dispatch | ||
def multi_source_dijkstra_path( | ||
G, sources, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def multi_source_dijkstra_path(G, sources, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def multi_source_dijkstra_path_length( | ||
G, sources, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def multi_source_dijkstra_path_length(G, sources, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def multi_source_dijkstra( | ||
G, | ||
sources, | ||
target: Incomplete | None = None, | ||
cutoff: Incomplete | None = None, | ||
weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight", | ||
G, sources, target: Incomplete | None = None, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" | ||
): ... | ||
|
||
@_dispatch | ||
def dijkstra_predecessor_and_distance( | ||
G, source, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def dijkstra_predecessor_and_distance(G, source, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def all_pairs_dijkstra( | ||
G, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
) -> Generator[Incomplete, None, None]: ... | ||
def all_pairs_dijkstra(G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def all_pairs_dijkstra_path_length( | ||
G, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
) -> Generator[Incomplete, None, None]: ... | ||
G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight" | ||
): ... | ||
|
||
@_dispatch | ||
def all_pairs_dijkstra_path( | ||
G, cutoff: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
) -> Generator[Incomplete, None, None]: ... | ||
def all_pairs_dijkstra_path(G, cutoff: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def bellman_ford_predecessor_and_distance( | ||
G, | ||
source, | ||
target: Incomplete | None = None, | ||
weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight", | ||
heuristic: bool = False, | ||
G, source, target: Incomplete | None = None, weight: str | _WeightFunction = "weight", heuristic: bool = False | ||
): ... | ||
|
||
@_dispatch | ||
def bellman_ford_path(G, source, target, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def bellman_ford_path(G, source, target, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def bellman_ford_path_length(G, source, target, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def bellman_ford_path_length(G, source, target, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_bellman_ford_path(G, source, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def single_source_bellman_ford_path(G, source, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_bellman_ford_path_length( | ||
G, source, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def single_source_bellman_ford_path_length(G, source, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def single_source_bellman_ford( | ||
G, source, target: Incomplete | None = None, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
): ... | ||
def single_source_bellman_ford(G, source, target: Incomplete | None = None, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def all_pairs_bellman_ford_path_length( | ||
G, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
) -> Generator[Incomplete, None, None]: ... | ||
def all_pairs_bellman_ford_path_length(G, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def all_pairs_bellman_ford_path( | ||
G, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight" | ||
) -> Generator[Incomplete, None, None]: ... | ||
def all_pairs_bellman_ford_path(G, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def goldberg_radzik(G, source, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def goldberg_radzik(G, source, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def negative_edge_cycle( | ||
G, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight", heuristic: bool = True | ||
): ... | ||
def negative_edge_cycle(G, weight: str | _WeightFunction = "weight", heuristic: bool = True): ... | ||
|
||
@_dispatch | ||
def find_negative_cycle(G, source, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def find_negative_cycle(G, source, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def bidirectional_dijkstra(G, source, target, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def bidirectional_dijkstra(G, source, target, weight: str | _WeightFunction = "weight"): ... | ||
|
||
@_dispatch | ||
def johnson(G, weight: str | Callable[[Any, Any, dict[str, Any]], float | None] = "weight"): ... | ||
def johnson(G, weight: str | _WeightFunction = "weight"): ... |