Skip to content

Commit 9960107

Browse files
authored
[networkx] Update to 3.6 (#15086)
1 parent d38b648 commit 9960107

27 files changed

+152
-64
lines changed

stubs/networkx/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.5"
1+
version = "3.6"
22
upstream_repository = "https://github.com/networkx/networkx"
33
# requires a version of numpy with a `py.typed` file
44
requires = ["numpy>=1.20"]

stubs/networkx/networkx/algorithms/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ from networkx.algorithms.mis import *
102102
from networkx.algorithms.moral import *
103103
from networkx.algorithms.non_randomness import *
104104
from networkx.algorithms.operators import *
105+
from networkx.algorithms.perfect_graph import *
105106
from networkx.algorithms.planar_drawing import *
106107
from networkx.algorithms.planarity import *
107108
from networkx.algorithms.polynomials import *
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
from _typeshed import Incomplete
22
from collections.abc import Iterable
3+
from typing_extensions import deprecated
34

45
from networkx.classes.graph import Graph, _Node
56
from networkx.utils.backends import _dispatchable
67

78
__all__ = ["metric_closure", "steiner_tree"]
89

910
@_dispatchable
11+
@deprecated(
12+
"`metric_closure` is deprecated and will be removed in NetworkX 3.8. Use `networkx.all_pairs_shortest_path_length` instead."
13+
)
1014
def metric_closure(G: Graph[_Node], weight="weight"): ...
1115
@_dispatchable
1216
def steiner_tree(G: Graph[_Node], terminal_nodes: Iterable[Incomplete], weight: str = "weight", method: str | None = None): ...

stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def approximate_current_flow_betweenness_centrality(
2020
epsilon: float = 0.5,
2121
kmax: int = 10000,
2222
seed: int | RandomState | None = None,
23+
*,
24+
sample_weight: float = 1,
2325
) -> dict[Incomplete, float]: ...
2426
@_dispatchable
2527
def current_flow_betweenness_centrality(

stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ from networkx.utils.backends import _dispatchable
66
__all__ = ["subgraph_centrality_exp", "subgraph_centrality", "communicability_betweenness_centrality", "estrada_index"]
77

88
@_dispatchable
9-
def subgraph_centrality_exp(G: Graph[_Node]) -> dict[Incomplete, float]: ...
9+
def subgraph_centrality_exp(G: Graph[_Node], *, normalized: bool = False) -> dict[Incomplete, float]: ...
1010
@_dispatchable
11-
def subgraph_centrality(G: Graph[_Node]) -> dict[Incomplete, float]: ...
11+
def subgraph_centrality(G: Graph[_Node], *, normalized: bool = False) -> dict[Incomplete, float]: ...
1212
@_dispatchable
1313
def communicability_betweenness_centrality(G: Graph[_Node]) -> dict[Incomplete, Incomplete]: ...
1414
@_dispatchable

stubs/networkx/networkx/algorithms/cluster.pyi

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
from _typeshed import Incomplete
2-
from collections.abc import Iterable
2+
from collections.abc import Generator, Iterable
33

4-
from networkx.classes.graph import Graph, _Node
4+
from networkx.classes.graph import Graph, _NBunch, _Node
55
from networkx.utils.backends import _dispatchable
66

7-
__all__ = ["triangles", "average_clustering", "clustering", "transitivity", "square_clustering", "generalized_degree"]
7+
__all__ = [
8+
"triangles",
9+
"all_triangles",
10+
"average_clustering",
11+
"clustering",
12+
"transitivity",
13+
"square_clustering",
14+
"generalized_degree",
15+
]
816

917
@_dispatchable
1018
def triangles(G: Graph[_Node], nodes=None) -> int | dict[Incomplete, int]: ...
1119
@_dispatchable
20+
def all_triangles(G: Graph[_Node], nbunch: _NBunch[_Node] = None) -> Generator[tuple[Incomplete, Incomplete, Incomplete]]: ...
21+
@_dispatchable
1222
def average_clustering(
1323
G: Graph[_Node], nodes: Iterable[_Node] | None = None, weight: str | None = None, count_zeros: bool = True
1424
) -> float: ...

stubs/networkx/networkx/algorithms/dag.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ __all__ = [
2121
"dag_longest_path",
2222
"dag_longest_path_length",
2323
"dag_to_branching",
24-
"compute_v_structures",
2524
]
2625

2726
@_dispatchable
@@ -61,5 +60,3 @@ def dag_longest_path(
6160
def dag_longest_path_length(G: DiGraph[_Node], weight: str | None = "weight", default_weight: int | None = 1) -> int: ...
6261
@_dispatchable
6362
def dag_to_branching(G: DiGraph[_Node]) -> DiGraph[_Node]: ...
64-
@_dispatchable
65-
def compute_v_structures(G: DiGraph[_Node]) -> Generator[tuple[Incomplete, Incomplete, Incomplete]]: ...

stubs/networkx/networkx/algorithms/distance_regular.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ __all__ = ["is_distance_regular", "is_strongly_regular", "intersection_array", "
99
@_dispatchable
1010
def is_distance_regular(G: Graph[_Node]) -> bool: ...
1111
@_dispatchable
12-
def global_parameters(b, c) -> Generator[tuple[Incomplete, Incomplete, Incomplete]]: ...
12+
def global_parameters(b: list[Incomplete], c: list[Incomplete]) -> Generator[tuple[Incomplete, Incomplete, Incomplete]]: ...
1313
@_dispatchable
14-
def intersection_array(G: Graph[_Node]): ...
14+
def intersection_array(G: Graph[_Node]) -> tuple[list[Incomplete], list[Incomplete]]: ...
1515
@_dispatchable
1616
def is_strongly_regular(G: Graph[_Node]) -> bool: ...

stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
from _typeshed import Incomplete
2-
from collections.abc import Generator
2+
from collections.abc import Callable, Generator, Hashable, Iterable
3+
from typing import Any
34

45
__all__ = ["ISMAGS"]
56

7+
def are_all_equal(iterable: Iterable[Any]) -> bool: ...
8+
def make_partition(
9+
items: Iterable[Hashable], test: Callable[[Hashable, Hashable], bool], check: bool = True
10+
) -> list[set[Incomplete]]: ...
11+
def node_to_part_ID_dict(partition: Iterable[Iterable[Incomplete]]) -> dict[Incomplete, int]: ...
12+
def color_degree_by_node(G, n_colors, e_colors): ...
13+
14+
class EdgeLookup:
15+
edge_dict: Incomplete
16+
def __init__(self, edge_dict) -> None: ...
17+
def __getitem__(self, edge): ...
18+
def items(self): ...
19+
620
class ISMAGS:
721
graph: Incomplete
822
subgraph: Incomplete
9-
node_equality: Incomplete
10-
edge_equality: Incomplete
1123

1224
def __init__(self, graph, subgraph, node_match=None, edge_match=None, cache=None) -> None: ...
25+
def create_aligned_partitions(self, thing_matcher, sg_things, g_things): ...
1326
def find_isomorphisms(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, Incomplete]: ...
1427
def largest_common_subgraph(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, None]: ...
15-
def analyze_symmetry(self, graph, node_partitions, edge_colors): ...
28+
def analyze_subgraph_symmetry(self) -> dict[Hashable, set[Hashable]]: ...
1629
def is_isomorphic(self, symmetry: bool = False) -> bool: ...
1730
def subgraph_is_isomorphic(self, symmetry: bool = False) -> bool: ...
1831
def isomorphisms_iter(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, None]: ...

stubs/networkx/networkx/algorithms/non_randomness.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ from networkx.utils.backends import _dispatchable
44
__all__ = ["non_randomness"]
55

66
@_dispatchable
7-
def non_randomness(G: Graph[_Node], k: int | None = None, weight: str | None = "weight"): ...
7+
def non_randomness(G: Graph[_Node], k: int | None = None, weight: str | None = "weight") -> tuple[float, float]: ...

0 commit comments

Comments
 (0)