Skip to content

Commit c14f222

Browse files
committed
👽️ fix new scipy 1.16.1 stubtest errors
1 parent c03ad71 commit c14f222

File tree

5 files changed

+37
-9
lines changed

5 files changed

+37
-9
lines changed

scipy-stubs/interpolate/_polyint.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ class BarycentricInterpolator(_Interpolator1DWithDerivatives[_YT_co], Generic[_Y
177177
axis: int = 0,
178178
*,
179179
wi: onp.ArrayND[npc.floating] | None = None,
180-
seed: onp.random.ToRNG | None = None,
181180
rng: onp.random.ToRNG | None = None,
181+
random_state: onp.random.ToRNG | None = None, # legacy
182182
) -> None: ...
183183
@overload # yi: c128
184184
def __init__(
@@ -189,8 +189,8 @@ class BarycentricInterpolator(_Interpolator1DWithDerivatives[_YT_co], Generic[_Y
189189
axis: int = 0,
190190
*,
191191
wi: onp.ArrayND[npc.floating] | None = None,
192-
seed: onp.random.ToRNG | None = None,
193192
rng: onp.random.ToRNG | None = None,
193+
random_state: onp.random.ToRNG | None = None, # legacy
194194
) -> None: ...
195195

196196
#

scipy-stubs/optimize/_shgo_lib/_complex.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Callable, Generator, Sequence
2-
from typing import Concatenate, Final, Generic, TypeAlias
2+
from typing import Concatenate, Final, Generic, Protocol, TypeAlias, type_check_only
33
from typing_extensions import TypeVar
44

55
import numpy as np
@@ -23,6 +23,10 @@ _Symmetry: TypeAlias = onp.ArrayND[npc.integer] | op.CanGetitem[int, op.CanIndex
2323

2424
_HT = TypeVar("_HT", bound=VertexCacheBase, default=VertexCacheBase)
2525

26+
@type_check_only
27+
class SplitEdgeFunction(Protocol):
28+
def __call__(self, /, v1: VertexBase, v2: VertexBase) -> VertexBase: ...
29+
2630
###
2731

2832
class Complex(Generic[_HT]): # undocumented
@@ -49,6 +53,9 @@ class Complex(Generic[_HT]): # undocumented
4953
cp: Generator[_Floats, None, _Floats]
5054
rls: Generator[VertexBase | _Floats]
5155

56+
# awkward annotation for `self.split_edge = functools.cache(self._split_edge)`
57+
split_edge: Final[SplitEdgeFunction]
58+
5259
def __init__(
5360
self,
5461
/,
@@ -78,7 +85,7 @@ class Complex(Generic[_HT]): # undocumented
7885
self, /, origin: _Location, supremum: _Location, bounds: _Bounds, centroid: onp.ToBool = 1
7986
) -> Generator[VertexBase | _Floats]: ...
8087
def refine_star(self, /, v: VertexBase) -> None: ...
81-
def split_edge(self, /, v1: VertexBase, v2: VertexBase) -> VertexBase: ...
88+
def _split_edge(self, /, v1: VertexBase, v2: VertexBase) -> VertexBase: ...
8289
def vpool(self, /, origin: _Location, supremum: _Location) -> set[VertexBase]: ...
8390
def vf_to_vv(self, /, vertices: Sequence[VertexBase], simplices: Sequence[tuple[onp.ToFloat1D, onp.ToFloat1D]]) -> None: ...
8491
def connect_vertex_non_symm(

scipy-stubs/optimize/optimize.pyi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def brute(
5959
) -> object: ...
6060
@deprecated("will be removed in SciPy v2.0.0")
6161
def check_grad(
62-
func: object, grad: object, x0: object, *args: object, epsilon: object = ..., direction: object = ..., rng: object = ...
62+
func: object,
63+
grad: object,
64+
x0: object,
65+
*args: object,
66+
epsilon: object = ...,
67+
direction: object = ...,
68+
rng: object = None,
69+
seed: object = None,
6370
) -> object: ...
6471
@deprecated("will be removed in SciPy v2.0.0")
6572
def fmin(
@@ -95,6 +102,7 @@ def fmin_bfgs(
95102
c2: object = ...,
96103
hess_inv0: object = ...,
97104
) -> object: ...
105+
@deprecated("will be removed in SciPy v2.0.0")
98106
def fmin_cg(
99107
f: object,
100108
x0: object,

scipy-stubs/sparse/construct.pyi

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,23 @@ def random(
5454
n: object,
5555
density: object = ...,
5656
format: object = ...,
57-
dtype: object = ...,
58-
rng: object = ...,
59-
data_rvs: object = ...,
57+
dtype: object = None,
58+
rng: object = None,
59+
data_rvs: object = None,
60+
*,
61+
random_state: object = None,
6062
) -> Any: ...
6163
@deprecated("will be removed in SciPy v2.0.0")
62-
def rand(m: object, n: object, density: object = ..., format: object = ..., dtype: object = ..., rng: object = ...) -> Any: ...
64+
def rand(
65+
m: object,
66+
n: object,
67+
density: object = ...,
68+
format: object = ...,
69+
dtype: object = None,
70+
rng: object = None,
71+
*,
72+
random_state: object = None,
73+
) -> Any: ...
6374
@deprecated("will be removed in SciPy v2.0.0")
6475
def kron(A: object, B: object, format: object = ...) -> Any: ...
6576
@deprecated("will be removed in SciPy v2.0.0")

scipy-stubs/sparse/linalg/eigen.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,6 @@ def svds(
7575
solver: object = ...,
7676
rng: object = None,
7777
options: object = None,
78+
*,
79+
random_state: object = None,
7880
) -> object: ...

0 commit comments

Comments
 (0)