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 scipy-stubs/cluster/hierarchy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ClusterNode:
self: ClusterNode, /, id: int, left: None = None, right: None = None, dist: float = 0.0, count: int = 1
) -> None: ...
@overload
def __init__(self, /, id: int, left: ClusterNode, right: ClusterNode, dist: float = 0, count: int = 1) -> None: ...
def __init__(self, /, id: int, left: ClusterNode, right: ClusterNode, dist: float = 0.0, count: int = 1) -> None: ...

# NOTE: These raise a `ValueError` if passed anything other than `ClusterNode`
@override
Expand Down
16 changes: 8 additions & 8 deletions scipy-stubs/fftpack/_realtransforms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def dct(
x: onp.ToFloatND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal: ...
Expand All @@ -112,7 +112,7 @@ def dct(
x: onp.ToComplexND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal | _ArrayComplex: ...
Expand All @@ -123,7 +123,7 @@ def idct(
x: onp.ToFloatND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal: ...
Expand All @@ -132,7 +132,7 @@ def idct(
x: onp.ToComplexND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal | _ArrayComplex: ...
Expand All @@ -143,7 +143,7 @@ def dst(
x: onp.ToFloatND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal: ...
Expand All @@ -152,7 +152,7 @@ def dst(
x: onp.ToComplexND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal | _ArrayComplex: ...
Expand All @@ -163,7 +163,7 @@ def idst(
x: onp.ToFloatND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal: ...
Expand All @@ -172,7 +172,7 @@ def idst(
x: onp.ToComplexND,
type: DCTType = 2,
n: onp.ToInt | None = None,
axis: op.CanIndex | None = None,
axis: op.CanIndex = -1,
norm: _NormKind = None,
overwrite_x: onp.ToBool = False,
) -> _ArrayReal | _ArrayComplex: ...
18 changes: 9 additions & 9 deletions scipy-stubs/linalg/_decomp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def eigh(
@overload # float, eigvals_only: False = ..., select: _SelectA = ...
def eig_banded(
a_band: onp.ToFloatND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
select: _SelectA = "a",
Expand All @@ -490,7 +490,7 @@ def eig_banded(
@overload # float, eigvals_only: False = ..., select: _SelectV (keyword)
def eig_banded(
a_band: onp.ToFloatND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
*,
Expand All @@ -502,7 +502,7 @@ def eig_banded(
@overload # float, eigvals_only: False = ..., select: _SelectI (keyword)
def eig_banded(
a_band: onp.ToFloatND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
*,
Expand All @@ -514,7 +514,7 @@ def eig_banded(
@overload # complex, eigvals_only: False = ..., select: _SelectA = ...
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
select: _SelectA = "a",
Expand All @@ -525,7 +525,7 @@ def eig_banded(
@overload # complex, eigvals_only: False = ..., select: _SelectV (keyword)
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
*,
Expand All @@ -537,7 +537,7 @@ def eig_banded(
@overload # complex, eigvals_only: False = ..., select: _SelectI (keyword)
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
eigvals_only: onp.ToFalse = False,
overwrite_a_band: op.CanBool = False,
*,
Expand All @@ -560,7 +560,7 @@ def eig_banded(
@overload # eigvals_only: True (keyword), select: _SelectA = ... (keyword)
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
*,
eigvals_only: onp.ToTrue,
overwrite_a_band: op.CanBool = False,
Expand All @@ -584,7 +584,7 @@ def eig_banded(
@overload # eigvals_only: True (keyword), select: _SelectV (keyword)
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
*,
eigvals_only: onp.ToTrue,
overwrite_a_band: op.CanBool = False,
Expand All @@ -608,7 +608,7 @@ def eig_banded(
@overload # eigvals_only: True (keyword), select: _SelectI (keyword)
def eig_banded(
a_band: onp.ToComplexND,
lower: op.CanBool = True,
lower: op.CanBool = False,
*,
eigvals_only: onp.ToTrue,
overwrite_a_band: op.CanBool = False,
Expand Down
4 changes: 2 additions & 2 deletions scipy-stubs/linalg/_decomp_lu.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def lu(
a: onp.ToJustComplexND,
permute_l: onp.ToTrue,
overwrite_a: onp.ToBool = False,
check_finite: onp.ToBool = False,
check_finite: onp.ToBool = True,
p_indices: onp.ToBool = False,
) -> tuple[_ComplexND, _ComplexND]: ...
@overload # fallback, permute_l=False, p_indices=False
Expand Down Expand Up @@ -168,6 +168,6 @@ def lu(
a: onp.ToComplexND,
permute_l: onp.ToTrue,
overwrite_a: onp.ToBool = False,
check_finite: onp.ToBool = False,
check_finite: onp.ToBool = True,
p_indices: onp.ToBool = False,
) -> tuple[_InexactND, _InexactND]: ...
8 changes: 4 additions & 4 deletions scipy-stubs/optimize/_optimize.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def fmin_cg(
retall: onp.ToFalse = 0,
callback: _Callback_1d | None = None,
c1: onp.ToFloat = 1e-4,
c2: onp.ToFloat = 0.9,
c2: onp.ToFloat = 0.4,
) -> _Float1D: ...
@overload # full_output: False = ..., retall: True (keyword)
def fmin_cg(
Expand All @@ -338,7 +338,7 @@ def fmin_cg(
retall: onp.ToTrue,
callback: _Callback_1d | None = None,
c1: onp.ToFloat = 1e-4,
c2: onp.ToFloat = 0.9,
c2: onp.ToFloat = 0.4,
) -> tuple[_Float1D, _AllVecs]: ...
@overload # full_output: True (keyword), retall: False = ...
def fmin_cg(
Expand All @@ -356,7 +356,7 @@ def fmin_cg(
retall: onp.ToFalse = 0,
callback: _Callback_1d | None = None,
c1: onp.ToFloat = 1e-4,
c2: onp.ToFloat = 0.9,
c2: onp.ToFloat = 0.4,
) -> tuple[_Float1D, _Float, int, int, _WarnFlag]: ...
@overload # full_output: True (keyword), retall: True (keyword)
def fmin_cg(
Expand All @@ -374,7 +374,7 @@ def fmin_cg(
retall: onp.ToTrue,
callback: _Callback_1d | None = None,
c1: onp.ToFloat = 1e-4,
c2: onp.ToFloat = 0.9,
c2: onp.ToFloat = 0.4,
) -> tuple[_Float1D, _Float, int, int, _WarnFlag, _AllVecs]: ...
@overload # full_output: False = ..., retall: False = ...
def fmin_ncg(
Expand Down
14 changes: 7 additions & 7 deletions scipy-stubs/sparse/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,20 @@ class _spbase(SparseABC, Generic[_ScalarT_co, _ShapeT_co]):
#
@overload # shape
def __init__(
self: _spbase[np.float64], /, arg1: tuple[SupportsIndex, *tuple[SupportsIndex, ...]], *, maxprint: int | None = 50
self: _spbase[np.float64], /, arg1: tuple[SupportsIndex, *tuple[SupportsIndex, ...]], *, maxprint: int | None = None
) -> None: ...
@overload # sparse
def __init__(self, /, arg1: _spbase[_ScalarT_co], *, maxprint: int | None = 50) -> None: ...
def __init__(self, /, arg1: _spbase[_ScalarT_co], *, maxprint: int | None = None) -> None: ...
@overload # dense array-like
def __init__(self, /, arg1: _ToSparseArray[_ScalarT_co], *, maxprint: int | None = 50) -> None: ...
def __init__(self, /, arg1: _ToSparseArray[_ScalarT_co], *, maxprint: int | None = None) -> None: ...
@overload # dense array-like bool
def __init__(self: _spbase[np.bool_], /, arg1: _ToSparseSeq[bool], *, maxprint: int | None = 50) -> None: ...
def __init__(self: _spbase[np.bool_], /, arg1: _ToSparseSeq[bool], *, maxprint: int | None = None) -> None: ...
@overload # dense array-like int
def __init__(self: _spbase[np.int_], /, arg1: _ToSparseSeq[op.JustInt], *, maxprint: int | None = 50) -> None: ...
def __init__(self: _spbase[np.int_], /, arg1: _ToSparseSeq[op.JustInt], *, maxprint: int | None = None) -> None: ...
@overload # dense array-like float
def __init__(self: _spbase[np.float64], /, arg1: _ToSparseSeq[op.JustFloat], *, maxprint: int | None = 50) -> None: ...
def __init__(self: _spbase[np.float64], /, arg1: _ToSparseSeq[op.JustFloat], *, maxprint: int | None = None) -> None: ...
@overload # dense array-like cfloat
def __init__(self: _spbase[np.complex128], /, arg1: _ToSparseSeq[op.JustComplex], *, maxprint: int | None = 50) -> None: ...
def __init__(self: _spbase[np.complex128], /, arg1: _ToSparseSeq[op.JustComplex], *, maxprint: int | None = None) -> None: ...

#
def __bool__(self, /) -> bool: ...
Expand Down
4 changes: 2 additions & 2 deletions scipy-stubs/sparse/linalg/_isolve/_gcrotmk.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def gcrotmk(
*,
rtol: onp.ToFloat = 1e-5,
atol: onp.ToFloat = 0.0,
maxiter: int | None = None,
maxiter: int = 1_000,
M: _ToLinearOperator[_FloatT | _ToInt] | None = None,
callback: _Callback[_FloatT] | None = None,
m: int = 20,
Expand All @@ -54,7 +54,7 @@ def gcrotmk(
*,
rtol: onp.ToFloat = 1e-5,
atol: onp.ToFloat = 0.0,
maxiter: int | None = None,
maxiter: int = 1_000,
M: _ToLinearOperator[_ComplexT] | None = None,
callback: _Callback[_ComplexT] | None = None,
m: int = 20,
Expand Down
4 changes: 2 additions & 2 deletions scipy-stubs/sparse/linalg/_isolve/lgmres.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def lgmres(
*,
rtol: onp.ToFloat = 1e-5,
atol: onp.ToFloat = 0.0,
maxiter: int | None = None,
maxiter: int = 1_000,
M: _ToLinearOperator[_FloatT | _ToInt] | None = None,
callback: _Callback[_FloatT] | None = None,
inner_m: int = 30,
Expand All @@ -51,7 +51,7 @@ def lgmres(
*,
rtol: onp.ToFloat = 1e-5,
atol: onp.ToFloat = 0.0,
maxiter: int | None = None,
maxiter: int = 1_000,
M: _ToLinearOperator[_ComplexT] | None = None,
callback: _Callback[_ComplexT] | None = None,
inner_m: int = 30,
Expand Down
6 changes: 3 additions & 3 deletions scipy-stubs/spatial/_ckdtree.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class cKDTree(_CythonMixin, Generic[_BoxSizeT_co, _BoxSizeDataT_co]):
x: onp.ToFloatND,
r: onp.ToFloatND,
p: onp.ToFloat = 2.0,
eps: onp.ToFloat = 0, # noqa: missing-default
eps: onp.ToFloat = ..., # noqa: missing-default
workers: op.CanIndex | None = None,
return_sorted: onp.ToBool | None = None,
return_length: onp.ToFalse = False,
Expand Down Expand Up @@ -259,15 +259,15 @@ class cKDTree(_CythonMixin, Generic[_BoxSizeT_co, _BoxSizeDataT_co]):
#
@overload
def query_pairs(
self, /, r: onp.ToFloat, p: onp.ToFloat = 2.0, eps: onp.ToFloat = 0, output_type: L["set"] = "set"
self, /, r: onp.ToFloat, p: onp.ToFloat = 2.0, eps: onp.ToFloat = 0.0, output_type: L["set"] = "set"
) -> set[tuple[int, int]]: ...
@overload
def query_pairs(
self, /, r: onp.ToFloat, p: onp.ToFloat, eps: onp.ToFloat, output_type: L["ndarray"]
) -> onp.ArrayND[np.intp]: ...
@overload
def query_pairs(
self, /, r: onp.ToFloat, p: onp.ToFloat = 2.0, eps: onp.ToFloat = 0, *, output_type: L["ndarray"]
self, /, r: onp.ToFloat, p: onp.ToFloat = 2.0, eps: onp.ToFloat = 0.0, *, output_type: L["ndarray"]
) -> onp.ArrayND[np.intp]: ...

#
Expand Down
6 changes: 3 additions & 3 deletions scipy-stubs/stats/_mstats_extras.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ _ToAxis: TypeAlias = op.CanIndex | None

@overload
def hdquantiles(
data: onp.ToFloat1D, prob: _ToProb = [0.25, 0.5, 0.75], axis: _ToAxis = None, var: onp.ToFalse = False
data: onp.ToFloat1D, prob: _ToProb = (0.25, 0.5, 0.75), axis: _ToAxis = None, var: onp.ToFalse = False
) -> onp.MArray1D[np.float64]: ...
@overload
def hdquantiles(data: onp.ToFloat1D, prob: _ToProb, axis: _ToAxis, var: onp.ToTrue) -> onp.MArray2D[np.float64]: ...
@overload
def hdquantiles(
data: onp.ToFloat1D, prob: _ToProb = [0.25, 0.5, 0.75], axis: _ToAxis = None, *, var: onp.ToTrue
data: onp.ToFloat1D, prob: _ToProb = (0.25, 0.5, 0.75), axis: _ToAxis = None, *, var: onp.ToTrue
) -> onp.MArray2D[np.float64]: ...
@overload
def hdquantiles(
data: onp.ToFloatND, prob: _ToProb = [0.25, 0.5, 0.75], axis: _ToAxis = None, var: bool = False
data: onp.ToFloatND, prob: _ToProb = (0.25, 0.5, 0.75), axis: _ToAxis = None, var: bool = False
) -> onp.MArray[np.float64]: ...

#
Expand Down
2 changes: 1 addition & 1 deletion scipy-stubs/stats/_quantile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def quantile(
method: _QuantileMethod = "linear",
axis: op.CanIndex = 0,
nan_policy: NanPolicy = "propagate",
keepdims: op.CanBool | None = False,
keepdims: op.CanBool | None = None,
) -> onp.ArrayND[np.float64]: ...
@overload
def quantile(
Expand Down
12 changes: 6 additions & 6 deletions scipy-stubs/stats/_stats.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def gaussian_kernel_estimate(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyFloat32DType,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.float32]: ...
@overload
def gaussian_kernel_estimate(
Expand All @@ -115,7 +115,7 @@ def gaussian_kernel_estimate(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyFloat64DType | None,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.float64]: ...
@overload
def gaussian_kernel_estimate(
Expand All @@ -124,7 +124,7 @@ def gaussian_kernel_estimate(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyLongDoubleDType,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.longdouble]: ... # undocumented

# keep in sync with `gaussian_kernel_estimate`
Expand All @@ -135,7 +135,7 @@ def gaussian_kernel_estimate_log(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyFloat32DType,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.float32]: ...
@overload
def gaussian_kernel_estimate_log(
Expand All @@ -144,7 +144,7 @@ def gaussian_kernel_estimate_log(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyFloat64DType | None,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.float64]: ...
@overload
def gaussian_kernel_estimate_log(
Expand All @@ -153,5 +153,5 @@ def gaussian_kernel_estimate_log(
xi: onp.Array2D[_AsReal],
cho_cov: onp.Array2D[_AsReal],
dtype: onp.AnyLongDoubleDType,
_: _Real | float = 0.0,
_: _Real | float = 0,
) -> onp.Array2D[np.longdouble]: ... # undocumented
Loading