Skip to content

Commit cf8e364

Browse files
authored
Bump networkx to 3.5 (python#14196)
1 parent c30f631 commit cf8e364

27 files changed

+273
-92
lines changed

stubs/networkx/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ networkx\.(algorithms\.)?(centrality\.)?(current_flow_closeness\.)?information_c
1616
networkx\.(generators\.)?(random_graphs\.)?binomial_graph
1717
networkx\.(generators\.)?(random_graphs\.)?erdos_renyi_graph
1818
networkx\.(algorithms\.(minors\.(contraction\.)?)?)?identified_nodes
19-
networkx\.algorithms\.isomorphism\.isomorph\.faster_graph_could_be_isomorphic
20-
networkx\.algorithms\.isomorphism\.isomorph\.fast_graph_could_be_isomorphic
21-
networkx\.algorithms\.isomorphism\.isomorph\.graph_could_be_isomorphic
2219
networkx\.algorithms\.flow\.maxflow\.default_flow_func
2320
networkx\.algorithms\.[a-z_\.]+\.default_flow_func
2421
networkx\.(algorithms\.(centrality\.(load\.)?)?)?load_centrality

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.4.2"
1+
version = "3.5"
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/approximation/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from networkx.algorithms.approximation.clique import *
22
from networkx.algorithms.approximation.clustering_coefficient import *
33
from networkx.algorithms.approximation.connectivity import *
4+
from networkx.algorithms.approximation.density import *
45
from networkx.algorithms.approximation.distance_measures import *
56
from networkx.algorithms.approximation.dominating_set import *
67
from networkx.algorithms.approximation.kcomponents import *
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from collections.abc import Callable, Hashable
2+
from typing import Literal
3+
from typing_extensions import TypeAlias
4+
5+
from networkx.classes.graph import Graph, _Node
6+
from networkx.utils.backends import _dispatchable
7+
8+
_Algorithm: TypeAlias = Literal["greedy++", "fista"]
9+
10+
__all__ = ["densest_subgraph"]
11+
12+
ALGORITHMS: dict[_Algorithm, Callable[[Graph[Hashable], int], tuple[float, set[int]]]]
13+
14+
@_dispatchable
15+
def densest_subgraph(G: Graph[_Node], iterations: int = 1, *, method: _Algorithm = "fista") -> tuple[float, set[int]]: ...

stubs/networkx/networkx/algorithms/approximation/treewidth.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ class MinDegreeHeuristic:
1616
def __init__(self, graph) -> None: ...
1717
def best_node(self, graph): ...
1818

19-
def min_fill_in_heuristic(graph) -> Incomplete | None: ...
19+
def min_fill_in_heuristic(graph_dict) -> Incomplete | None: ...
2020
@_dispatchable
2121
def treewidth_decomp(G: Graph[_Node], heuristic=...) -> tuple[int, Graph[_Node]]: ...

stubs/networkx/networkx/algorithms/bipartite/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from networkx.algorithms.bipartite.covering import *
55
from networkx.algorithms.bipartite.edgelist import *
66
from networkx.algorithms.bipartite.extendability import *
77
from networkx.algorithms.bipartite.generators import *
8+
from networkx.algorithms.bipartite.link_analysis import *
89
from networkx.algorithms.bipartite.matching import *
910
from networkx.algorithms.bipartite.matrix import *
1011
from networkx.algorithms.bipartite.projection import *
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from collections.abc import Iterable
2+
3+
from networkx.classes.graph import Graph, _Node
4+
from networkx.utils.backends import _dispatchable
5+
6+
__all__ = ["birank"]
7+
8+
@_dispatchable
9+
def birank(
10+
G: Graph[_Node],
11+
nodes: Iterable[_Node],
12+
*,
13+
alpha: float | None = None,
14+
beta: float | None = None,
15+
top_personalization: dict[str, int] | None = None,
16+
bottom_personalization: dict[str, int] | None = None,
17+
max_iter: int = 100,
18+
tol: float = 1.0e-6,
19+
weight: str | None = "weight",
20+
) -> dict[_Node, float]: ...

stubs/networkx/networkx/algorithms/community/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ from networkx.algorithms.community.divisive import *
55
from networkx.algorithms.community.kclique import *
66
from networkx.algorithms.community.kernighan_lin import *
77
from networkx.algorithms.community.label_propagation import *
8+
from networkx.algorithms.community.leiden import *
9+
from networkx.algorithms.community.local import *
810
from networkx.algorithms.community.louvain import *
911
from networkx.algorithms.community.lukes import *
1012
from networkx.algorithms.community.modularity_max import *
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from networkx.classes.graph import Graph, _Node
2+
from networkx.utils.backends import _dispatchable
3+
from numpy.random import RandomState
4+
5+
__all__ = ["leiden_communities", "leiden_partitions"]
6+
7+
@_dispatchable
8+
def leiden_communities(
9+
G: Graph[_Node],
10+
weight: str | None = "weight",
11+
resolution: float = 1,
12+
max_level: int | None = None,
13+
seed: int | RandomState | None = None,
14+
): ...
15+
@_dispatchable
16+
def leiden_partitions(
17+
G: Graph[_Node], weight: str | None = "weight", resolution: float = 1, seed: int | RandomState | None = None
18+
): ...
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from collections.abc import Callable, Hashable
2+
from typing import Literal
3+
from typing_extensions import TypeAlias
4+
5+
from networkx.classes.graph import Graph, _Node
6+
7+
__all__ = ["greedy_source_expansion"]
8+
9+
_Algorithm: TypeAlias = Literal["clauset"]
10+
11+
ALGORITHMS: dict[_Algorithm, Callable[[Graph[Hashable], Hashable, int | None], set[Hashable]]]
12+
13+
def greedy_source_expansion(
14+
G: Graph[_Node], *, source: _Node, cutoff: int | None = None, method: _Algorithm = "clauset"
15+
) -> set[_Node | None]: ...

0 commit comments

Comments
 (0)