Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stubs/networkx/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.6"
version = "3.6.1"
upstream_repository = "https://github.com/networkx/networkx"
# requires a version of numpy with a `py.typed` file
requires = ["numpy>=1.20"]
Expand Down
9 changes: 8 additions & 1 deletion stubs/networkx/networkx/algorithms/bipartite/matrix.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ def biadjacency_matrix(
format="csr",
): ... # Return is a complex union of scipy classes depending on the format param
@_dispatchable
def from_biadjacency_matrix(A, create_using: Graph[_Node] | None = None, edge_attribute: str = "weight"): ...
def from_biadjacency_matrix(
A,
create_using: Graph[_Node] | None = None,
edge_attribute: str = "weight",
*,
row_order: Iterable[Incomplete] | None = None,
column_order: Iterable[Incomplete] | None = None,
): ...
2 changes: 1 addition & 1 deletion stubs/networkx/networkx/algorithms/community/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from networkx.algorithms.community.asyn_fluid import *
from networkx.algorithms.community.bipartitions import *
from networkx.algorithms.community.centrality import *
from networkx.algorithms.community.community_utils import *
from networkx.algorithms.community.divisive import *
from networkx.algorithms.community.kclique import *
from networkx.algorithms.community.kernighan_lin import *
from networkx.algorithms.community.label_propagation import *
from networkx.algorithms.community.leiden import *
from networkx.algorithms.community.local import *
Expand Down
22 changes: 22 additions & 0 deletions stubs/networkx/networkx/algorithms/community/bipartitions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from _typeshed import Incomplete
from collections.abc import Iterable

from networkx.algorithms.shortest_paths.weighted import _WeightFunc
from networkx.classes.graph import Graph, _Node
from networkx.utils.backends import _dispatchable
from numpy.random import RandomState

__all__ = ["kernighan_lin_bisection", "spectral_modularity_bipartition", "greedy_node_swap_bipartition"]

@_dispatchable
def kernighan_lin_bisection(
G: Graph[_Node],
partition: tuple[Iterable[Incomplete], Iterable[Incomplete]] | None = None,
max_iter: int = 10,
weight: str | _WeightFunc[_Node] = "weight",
seed: int | RandomState | None = None,
) -> tuple[set[Incomplete], set[Incomplete]]: ...
def spectral_modularity_bipartition(G: Graph[_Node]) -> tuple[set[Incomplete], set[Incomplete]]: ...
def greedy_node_swap_bipartition(
G: Graph[_Node], *, init_split: tuple[set[Incomplete], set[Incomplete]] | None = None, max_iter: int = 10
) -> tuple[set[Incomplete], set[Incomplete]]: ...
16 changes: 0 additions & 16 deletions stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi

This file was deleted.

2 changes: 1 addition & 1 deletion stubs/networkx/networkx/classes/graph.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Graph(Collection[_Node]):
def to_undirected_class(self) -> type[Graph[_Node]]: ...
# @_dispatchable adds `backend` argument, but this decorated is unsupported constructor type here
# and __init__() ignores this argument
def __new__(cls, incoming_graph_data: _Data[_Node] | None = None, *, backend=None, **attr: Any) -> Self: ...
def __new__(cls, *args, backend=None, **kwargs) -> Self: ...
def __init__(self, incoming_graph_data: _Data[_Node] | None = None, **attr: Any) -> None: ... # attr: key=value pairs
@cached_property
def adj(self) -> AdjacencyView[_Node, _Node, dict[str, Any]]: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/networkx/networkx/classes/multigraph.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MultiGraph(Graph[_Node]):
def to_undirected_class(self) -> type[MultiGraph[_Node]]: ...
# @_dispatchable adds `backend` argument, but this decorated is unsupported constructor type here
# and __init__() ignores this argument
def __new__(cls, incoming_graph_data=None, multigraph_input: bool | None = None, *, backend=None, **attr: Any) -> Self: ...
def __new__(cls, *args, backend=None, **kwargs) -> Self: ...
def __init__(self, incoming_graph_data=None, multigraph_input: bool | None = None, **attr: Any) -> None: ...
@cached_property
def adj(self) -> MultiAdjacencyView[_Node, _Node, dict[str, Any]]: ... # data can be any type
Expand Down