Skip to content

Commit 0153c40

Browse files
authored
[networkx] Update to 3.6.1 (#15123)
1 parent 8be6572 commit 0153c40

File tree

7 files changed

+34
-21
lines changed

7 files changed

+34
-21
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.6"
1+
version = "3.6.1"
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/bipartite/matrix.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ def biadjacency_matrix(
1616
format="csr",
1717
): ... # Return is a complex union of scipy classes depending on the format param
1818
@_dispatchable
19-
def from_biadjacency_matrix(A, create_using: Graph[_Node] | None = None, edge_attribute: str = "weight"): ...
19+
def from_biadjacency_matrix(
20+
A,
21+
create_using: Graph[_Node] | None = None,
22+
edge_attribute: str = "weight",
23+
*,
24+
row_order: Iterable[Incomplete] | None = None,
25+
column_order: Iterable[Incomplete] | None = None,
26+
): ...

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from networkx.algorithms.community.asyn_fluid import *
2+
from networkx.algorithms.community.bipartitions import *
23
from networkx.algorithms.community.centrality import *
34
from networkx.algorithms.community.community_utils import *
45
from networkx.algorithms.community.divisive import *
56
from networkx.algorithms.community.kclique import *
6-
from networkx.algorithms.community.kernighan_lin import *
77
from networkx.algorithms.community.label_propagation import *
88
from networkx.algorithms.community.leiden import *
99
from networkx.algorithms.community.local import *
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from _typeshed import Incomplete
2+
from collections.abc import Iterable
3+
4+
from networkx.algorithms.shortest_paths.weighted import _WeightFunc
5+
from networkx.classes.graph import Graph, _Node
6+
from networkx.utils.backends import _dispatchable
7+
from numpy.random import RandomState
8+
9+
__all__ = ["kernighan_lin_bisection", "spectral_modularity_bipartition", "greedy_node_swap_bipartition"]
10+
11+
@_dispatchable
12+
def kernighan_lin_bisection(
13+
G: Graph[_Node],
14+
partition: tuple[Iterable[Incomplete], Iterable[Incomplete]] | None = None,
15+
max_iter: int = 10,
16+
weight: str | _WeightFunc[_Node] = "weight",
17+
seed: int | RandomState | None = None,
18+
) -> tuple[set[Incomplete], set[Incomplete]]: ...
19+
def spectral_modularity_bipartition(G: Graph[_Node]) -> tuple[set[Incomplete], set[Incomplete]]: ...
20+
def greedy_node_swap_bipartition(
21+
G: Graph[_Node], *, init_split: tuple[set[Incomplete], set[Incomplete]] | None = None, max_iter: int = 10
22+
) -> tuple[set[Incomplete], set[Incomplete]]: ...

stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi

Lines changed: 0 additions & 16 deletions
This file was deleted.

stubs/networkx/networkx/classes/graph.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Graph(Collection[_Node]):
4343
def to_undirected_class(self) -> type[Graph[_Node]]: ...
4444
# @_dispatchable adds `backend` argument, but this decorated is unsupported constructor type here
4545
# and __init__() ignores this argument
46-
def __new__(cls, incoming_graph_data: _Data[_Node] | None = None, *, backend=None, **attr: Any) -> Self: ...
46+
def __new__(cls, *args, backend=None, **kwargs) -> Self: ...
4747
def __init__(self, incoming_graph_data: _Data[_Node] | None = None, **attr: Any) -> None: ... # attr: key=value pairs
4848
@cached_property
4949
def adj(self) -> AdjacencyView[_Node, _Node, dict[str, Any]]: ...

stubs/networkx/networkx/classes/multigraph.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MultiGraph(Graph[_Node]):
2424
def to_undirected_class(self) -> type[MultiGraph[_Node]]: ...
2525
# @_dispatchable adds `backend` argument, but this decorated is unsupported constructor type here
2626
# and __init__() ignores this argument
27-
def __new__(cls, incoming_graph_data=None, multigraph_input: bool | None = None, *, backend=None, **attr: Any) -> Self: ...
27+
def __new__(cls, *args, backend=None, **kwargs) -> Self: ...
2828
def __init__(self, incoming_graph_data=None, multigraph_input: bool | None = None, **attr: Any) -> None: ...
2929
@cached_property
3030
def adj(self) -> MultiAdjacencyView[_Node, _Node, dict[str, Any]]: ... # data can be any type

0 commit comments

Comments
 (0)