Skip to content

networkx: improve the distance_measures module #14461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025
Merged
Changes from all commits
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
45 changes: 30 additions & 15 deletions stubs/networkx/networkx/algorithms/distance_measures.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Callable
from collections.abc import Callable, Mapping
from typing_extensions import TypeAlias

from networkx.classes.graph import Graph, _Node
Expand All @@ -22,27 +21,43 @@ __all__ = [

@_dispatchable
def eccentricity(
G: Graph[_Node], v: _Node | None = None, sp=None, weight: str | _WeightFunction | None = None
) -> Incomplete | dict[Incomplete, Incomplete]: ...
G: Graph[_Node],
v: _Node | None = None,
sp: Mapping[_Node, Mapping[_Node, int]] | None = None,
weight: str | _WeightFunction | None = None,
) -> int | dict[_Node, int]: ... # TODO: overload on v: dict if v is None else int
@_dispatchable
def diameter(G: Graph[_Node], e=None, usebounds: bool = False, weight: str | _WeightFunction | None = None): ...
def diameter(
G: Graph[_Node], e: Mapping[_Node, int] | None = None, usebounds: bool = False, weight: str | _WeightFunction | None = None
) -> int: ...
@_dispatchable
def harmonic_diameter(G, sp=None, *, weight: str | _WeightFunction | None = None) -> float: ...
def harmonic_diameter(
G: Graph[_Node], sp: Mapping[_Node, Mapping[_Node, int]] | None = None, *, weight: str | _WeightFunction | None = None
) -> float: ...
@_dispatchable
def periphery(
G: Graph[_Node], e=None, usebounds: bool = False, weight: str | _WeightFunction | None = None
) -> list[Incomplete]: ...
G: Graph[_Node], e: Mapping[_Node, int] | None = None, usebounds: bool = False, weight: str | _WeightFunction | None = None
) -> list[_Node]: ...
@_dispatchable
def radius(G: Graph[_Node], e=None, usebounds: bool = False, weight: str | _WeightFunction | None = None): ...
def radius(
G: Graph[_Node], e: Mapping[_Node, int] | None = None, usebounds: bool = False, weight: str | _WeightFunction | None = None
) -> int: ...
@_dispatchable
def center(G: Graph[_Node], e=None, usebounds: bool = False, weight: str | _WeightFunction | None = None) -> list[Incomplete]: ...
def center(
G: Graph[_Node], e: Mapping[_Node, int] | None = None, usebounds: bool = False, weight: str | _WeightFunction | None = None
) -> list[_Node]: ...
@_dispatchable
def barycenter(G, weight: str | _WeightFunction | None = None, attr=None, sp=None) -> list[Incomplete]: ...
def barycenter(
G: Graph[_Node],
weight: str | _WeightFunction | None = None,
attr: str | None = None,
sp: Mapping[_Node, Mapping[_Node, int]] | None = None,
) -> list[_Node]: ...
@_dispatchable
def resistance_distance(
G: Graph[_Node], nodeA=None, nodeB=None, weight: str | None = None, invert_weight: bool = True
) -> float | dict[Incomplete, float]: ...
G: Graph[_Node], nodeA: _Node | None = None, nodeB: _Node | None = None, weight: str | None = None, invert_weight: bool = True
) -> float | dict[_Node, float]: ... # TODO: overload on the nodes: float if both are specified else dict
@_dispatchable
def effective_graph_resistance(G, weight: str | None = None, invert_weight: bool = True) -> float: ...
def effective_graph_resistance(G: Graph[_Node], weight: str | None = None, invert_weight: bool = True) -> float: ...
@_dispatchable
def kemeny_constant(G, *, weight: str | None = None) -> float: ...
def kemeny_constant(G: Graph[_Node], *, weight: str | None = None) -> float: ...
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy