diff --git a/scipy-stubs/special/_basic.pyi b/scipy-stubs/special/_basic.pyi index a1cc3ed4..8e718909 100644 --- a/scipy-stubs/special/_basic.pyi +++ b/scipy-stubs/special/_basic.pyi @@ -1,11 +1,11 @@ -from collections.abc import Sequence -from typing import Any, Literal as L, TypeAlias, overload +from typing import Literal as L, TypeAlias, overload from typing_extensions import TypeVar, Unpack, deprecated import numpy as np -import numpy.typing as npt import optype as op import optype.numpy as onp +import optype.numpy.compat as npc +import optype.typing as opt from scipy._typing import Falsy, Truthy from ._ufuncs import _KwBase, psi as digamma @@ -74,300 +74,508 @@ __all__ = [ ### +_T = TypeVar("_T") _T0 = TypeVar("_T0") _T1 = TypeVar("_T1") _ArrayT = TypeVar("_ArrayT", bound=onp.ArrayND) - +_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...]) _SCT = TypeVar("_SCT", bound=np.generic) -_SCT_f = TypeVar("_SCT_f", bound=np.floating[Any]) -_SCT_fc = TypeVar("_SCT_fc", bound=np.inexact[Any]) +_SCT_iu = TypeVar("_SCT_iu", bound=npc.integer) +_SCT_f = TypeVar("_SCT_f", bound=npc.floating) +_SCT_fc = TypeVar("_SCT_fc", bound=npc.inexact) -_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...]) +_ToDType: TypeAlias = type[_SCT] | np.dtype[_SCT] | onp.HasDType[np.dtype[_SCT]] -_ArrayOrScalar: TypeAlias = _SCT | onp.ArrayND[_SCT] +_ToIntOrND: TypeAlias = onp.ToInt | onp.ToIntND +_ToFloatOrND: TypeAlias = onp.ToFloat | onp.ToFloatND +_ToComplexOrND: TypeAlias = onp.ToComplex | onp.ToComplexND +_ToJustComplexOrND: TypeAlias = onp.ToJustComplex | onp.ToJustComplexND + +_Extend0: TypeAlias = L["zero"] +_ExtendC: TypeAlias = L["complex"] +_Extend: TypeAlias = L[_Extend0, _ExtendC] # ruff: noqa: PYI042 -_tuple2: TypeAlias = tuple[_T0, _T0] +_tuple2: TypeAlias = tuple[_T, _T] _tuple4: TypeAlias = tuple[_T0, _T1, _T1, _T1] _tuple8: TypeAlias = tuple[_T0, _T1, _T1, _T1, _T1, _T1, _T1, _T1] -_i1: TypeAlias = np.int8 -_i2: TypeAlias = np.int16 _i4: TypeAlias = np.int32 _i8: TypeAlias = np.int64 -_f2: TypeAlias = np.float16 _f4: TypeAlias = np.float32 _f8: TypeAlias = np.float64 -_c8: TypeAlias = np.complex64 -_c16: TypeAlias = np.complex128 -_i: TypeAlias = _i1 | _i2 | _i4 | _i8 -_f: TypeAlias = _f2 | _f4 | _f8 | np.longdouble -_c: TypeAlias = _c8 | _c16 | np.clongdouble +_c4: TypeAlias = np.complex64 +_c8: TypeAlias = np.complex128 -_Extend0: TypeAlias = L["zero"] -_ExtendZ: TypeAlias = L["complex"] -_Extend: TypeAlias = L[_Extend0, _ExtendZ] +_fc8: TypeAlias = _f8 | _c8 + +_i: TypeAlias = _i4 | _i8 +_f: TypeAlias = _f4 | _f8 +_c: TypeAlias = _c4 | _c8 +_fc: TypeAlias = _f | _c + +_f8_1d: TypeAlias = onp.Array1D[_f8] +_f8_nd: TypeAlias = onp.ArrayND[_f8] +_c8_1d: TypeAlias = onp.Array1D[_c8] +_c8_nd: TypeAlias = onp.ArrayND[_c8] +_fc8_nd: TypeAlias = onp.ArrayND[_fc8] + +_i_nd: TypeAlias = onp.ArrayND[_i] +_f_nd: TypeAlias = onp.ArrayND[_f] +_c_nd: TypeAlias = onp.ArrayND[_c] +_fc_nd: TypeAlias = onp.ArrayND[_fc] ### @overload def sinc(x: _SCT_fc) -> _SCT_fc: ... @overload -def sinc(x: float | onp.ToInt) -> np.float64: ... +def sinc(x: float | onp.ToInt) -> _f8: ... +@overload +def sinc(x: opt.JustComplex) -> _c8: ... +@overload +def sinc(x: complex) -> _fc8: ... # type: ignore[overload-cannot-match] # pyright: ignore[reportOverlappingOverload]s +@overload +def sinc(x: onp.ToIntND) -> _f8_nd: ... +@overload +def sinc(x: onp.ToFloatND) -> onp.ArrayND[npc.floating]: ... +@overload +def sinc(x: onp.ToComplexND) -> onp.ArrayND[npc.inexact]: ... + +# +@overload +def diric(x: onp.ToFloat, n: int | _i) -> onp.Array0D[_f8]: ... +@overload +def diric(x: onp.ToFloat, n: onp.ToInt) -> onp.Array0D[npc.floating]: ... +@overload +def diric(x: _ToFloatOrND, n: onp.ToInt) -> onp.ArrayND[npc.floating]: ... + +# +def jnjnp_zeros(nt: onp.ToInt) -> _tuple4[_f8_1d, onp.Array1D[_i4]]: ... +def jnyn_zeros(n: onp.ToInt, nt: onp.ToInt) -> _tuple4[_f8_1d, _f8_1d]: ... +def jn_zeros(n: onp.ToInt, nt: onp.ToInt) -> _f8_1d: ... +def jnp_zeros(n: onp.ToInt, nt: onp.ToInt) -> _f8_1d: ... +def yn_zeros(n: onp.ToInt, nt: onp.ToInt) -> _f8_1d: ... +def ynp_zeros(n: onp.ToInt, nt: onp.ToInt) -> _f8_1d: ... + +# +def y0_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[_c8_1d]: ... +def y1_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[_c8_1d]: ... +def y1p_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[_c8_1d]: ... + +# +@overload +def jvp(v: onp.ToFloat, z: onp.ToFloat, n: onp.ToInt = 1) -> _f: ... +@overload +def jvp(v: onp.ToFloat, z: onp.ToJustComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def jvp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _fc: ... +@overload +def jvp(v: _ToFloatOrND, z: onp.ToFloatND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def jvp(v: onp.ToFloatND, z: _ToFloatOrND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def jvp(v: _ToFloatOrND, z: onp.ToJustComplexND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def jvp(v: onp.ToFloatND, z: _ToJustComplexOrND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def jvp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _fc_nd: ... +@overload +def jvp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _fc_nd: ... + +# +@overload +def yvp(v: onp.ToFloat, z: onp.ToFloat, n: onp.ToInt = 1) -> _f: ... +@overload +def yvp(v: onp.ToFloat, z: onp.ToJustComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def yvp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _fc: ... +@overload +def yvp(v: _ToFloatOrND, z: onp.ToFloatND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def yvp(v: onp.ToFloatND, z: _ToFloatOrND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def yvp(v: _ToFloatOrND, z: onp.ToJustComplexND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def yvp(v: onp.ToFloatND, z: _ToJustComplexOrND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def yvp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _fc_nd: ... +@overload +def yvp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _fc_nd: ... + +# +@overload +def kvp(v: onp.ToFloat, z: onp.ToFloat, n: onp.ToInt = 1) -> _f: ... +@overload +def kvp(v: onp.ToFloat, z: onp.ToJustComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def kvp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _fc: ... +@overload +def kvp(v: _ToFloatOrND, z: onp.ToFloatND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def kvp(v: onp.ToFloatND, z: _ToFloatOrND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def kvp(v: _ToFloatOrND, z: onp.ToJustComplexND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def kvp(v: onp.ToFloatND, z: _ToJustComplexOrND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def kvp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _fc_nd: ... +@overload +def kvp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _fc_nd: ... + +# +@overload +def ivp(v: onp.ToFloat, z: onp.ToFloat, n: onp.ToInt = 1) -> _f: ... +@overload +def ivp(v: onp.ToFloat, z: onp.ToJustComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def ivp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _fc: ... +@overload +def ivp(v: _ToFloatOrND, z: onp.ToFloatND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def ivp(v: onp.ToFloatND, z: _ToFloatOrND, n: onp.ToInt = 1) -> _f_nd: ... +@overload +def ivp(v: _ToFloatOrND, z: onp.ToJustComplexND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def ivp(v: onp.ToFloatND, z: _ToJustComplexOrND, n: onp.ToInt = 1) -> _c_nd: ... +@overload +def ivp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _fc_nd: ... +@overload +def ivp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _fc_nd: ... + +# +@overload +def h1vp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def h1vp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _c: ... +@overload +def h1vp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _c: ... + +# +@overload +def h2vp(v: onp.ToFloat, z: onp.ToComplex, n: onp.ToInt = 1) -> _c: ... +@overload +def h2vp(v: _ToFloatOrND, z: onp.ToComplexND, n: onp.ToInt = 1) -> _c: ... +@overload +def h2vp(v: onp.ToFloatND, z: _ToComplexOrND, n: onp.ToInt = 1) -> _c: ... + +# +def riccati_jn(n: onp.ToInt, x: onp.ToFloat) -> _tuple2[_f8_1d]: ... +def riccati_yn(n: onp.ToInt, x: onp.ToFloat) -> _tuple2[_f8_1d]: ... + +# +def erf_zeros(nt: onp.ToInt) -> _c8_1d: ... +def fresnelc_zeros(nt: onp.ToInt) -> _c8_1d: ... +def fresnels_zeros(nt: onp.ToInt) -> _c8_1d: ... +def fresnel_zeros(nt: onp.ToInt) -> _c8_1d: ... + +# +@overload +def assoc_laguerre(x: onp.ToFloat, n: onp.ToInt, k: onp.ToFloat = 0.0) -> _f: ... +@overload +def assoc_laguerre(x: onp.ToJustComplex, n: onp.ToInt, k: onp.ToFloat = 0.0) -> _c: ... +@overload +def assoc_laguerre(x: onp.ToComplex, n: onp.ToInt, k: onp.ToFloat = 0.0) -> _fc: ... +@overload +def assoc_laguerre(x: _ToFloatOrND, n: _ToIntOrND, k: onp.ToFloatND) -> _f_nd: ... +@overload +def assoc_laguerre(x: _ToFloatOrND, n: onp.ToIntND, k: _ToFloatOrND) -> _f_nd: ... +@overload +def assoc_laguerre(x: onp.ToFloatND, n: _ToIntOrND, k: _ToFloatOrND) -> _f_nd: ... +@overload +def assoc_laguerre(x: _ToJustComplexOrND, n: _ToIntOrND, k: onp.ToFloatND) -> _c_nd: ... +@overload +def assoc_laguerre(x: _ToJustComplexOrND, n: onp.ToIntND, k: _ToFloatOrND) -> _c_nd: ... +@overload +def assoc_laguerre(x: onp.ToJustComplexND, n: _ToIntOrND, k: _ToFloatOrND) -> _c_nd: ... +@overload +def assoc_laguerre(x: _ToComplexOrND, n: _ToIntOrND, k: onp.ToFloatND) -> _fc_nd: ... +@overload +def assoc_laguerre(x: _ToComplexOrND, n: onp.ToIntND, k: _ToFloatOrND) -> _fc_nd: ... +@overload +def assoc_laguerre(x: onp.ToComplexND, n: _ToIntOrND, k: _ToFloatOrND) -> _fc_nd: ... +@overload +def assoc_laguerre(x: _ToComplexOrND, n: _ToIntOrND, k: _ToFloatOrND) -> _fc | _fc_nd: ... + +# +@overload +def polygamma(n: onp.ToInt, x: onp.ToFloat) -> _f8: ... +@overload +def polygamma(n: _ToIntOrND, x: onp.ToFloatND) -> _f8_nd: ... +@overload +def polygamma(n: onp.ToIntND, x: _ToFloatOrND) -> _f8_nd: ... +@overload +def polygamma(n: _ToIntOrND, x: _ToFloatOrND) -> _f8 | _f8_nd: ... + +# +def mathieu_even_coef(m: onp.ToInt, q: onp.ToFloat) -> _f8_1d: ... +def mathieu_odd_coef(m: onp.ToInt, q: onp.ToFloat) -> _f8_1d: ... + +# +@overload +def lqn(n: onp.ToInt, z: onp.ToFloat) -> _tuple2[_f8_1d]: ... +@overload +def lqn(n: onp.ToInt, z: _ToFloatOrND) -> _tuple2[_f8_nd]: ... # type: ignore[overload-overlap] @overload -def sinc(x: complex) -> np.float64 | np.complex128: ... +def lqn(n: onp.ToInt, z: onp.ToJustComplex) -> _tuple2[_c8_1d]: ... @overload -def sinc(x: onp.ToIntND) -> onp.ArrayND[np.float64]: ... +def lqn(n: onp.ToInt, z: _ToJustComplexOrND) -> _tuple2[_c8_nd]: ... # type: ignore[overload-overlap] @overload -def sinc(x: onp.ToFloatND) -> onp.ArrayND[np.floating[Any]]: ... +def lqn(n: onp.ToInt, z: onp.ToComplex) -> _tuple2[_f8_1d] | _tuple2[_c8_1d]: ... @overload -def sinc(x: onp.ToComplexND) -> onp.ArrayND[np.inexact[Any]]: ... +def lqn(n: onp.ToInt, z: _ToComplexOrND) -> _tuple2[_f8_nd] | _tuple2[_c8_nd]: ... # -def diric(x: onp.ToFloat | onp.ToFloatND, n: onp.ToInt) -> onp.ArrayND[np.floating[Any]]: ... -def jnjnp_zeros(nt: onp.ToInt) -> _tuple4[onp.Array1D[_f8], onp.Array1D[_i4]]: ... -def jnyn_zeros(n: onp.ToInt, nt: onp.ToInt) -> _tuple4[onp.Array1D[_f8], onp.Array1D[_f8]]: ... -def jn_zeros(n: onp.ToInt, nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def jnp_zeros(n: onp.ToInt, nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def yn_zeros(n: onp.ToInt, nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def ynp_zeros(n: onp.ToInt, nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def y0_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[onp.Array1D[_c16]]: ... -def y1_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[onp.Array1D[_c16]]: ... -def y1p_zeros(nt: onp.ToInt, complex: op.CanBool = False) -> _tuple2[onp.Array1D[_c16]]: ... -def jvp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def yvp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def kvp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def ivp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def h1vp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def h2vp(v: onp.ToFloat | onp.ToFloatND, z: onp.ToComplex, n: onp.ToInt = 1) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def riccati_jn(n: onp.ToInt, x: onp.ToFloat) -> _tuple2[onp.Array1D[_f8]]: ... -def riccati_yn(n: onp.ToInt, x: onp.ToFloat) -> _tuple2[onp.Array1D[_f8]]: ... -def erf_zeros(nt: onp.ToInt) -> onp.Array1D[_c16]: ... -def fresnelc_zeros(nt: onp.ToInt) -> onp.Array1D[_c16]: ... -def fresnels_zeros(nt: onp.ToInt) -> onp.Array1D[_c16]: ... -def fresnel_zeros(nt: onp.ToInt) -> onp.Array1D[_c16]: ... -def assoc_laguerre( - x: onp.ToComplex | onp.ToComplexND, - n: onp.ToInt, - k: onp.ToFloat = 0.0, -) -> _ArrayOrScalar[_f4 | _f8 | _c8 | _c16]: ... -def polygamma(n: onp.ToInt | onp.ToIntND, x: onp.ToFloat | onp.ToFloatND) -> _ArrayOrScalar[_f8]: ... -def mathieu_even_coef(m: onp.ToInt, q: onp.ToFloat) -> onp.Array1D[_f8]: ... -def mathieu_odd_coef(m: onp.ToInt, q: onp.ToFloat) -> onp.Array1D[_f8]: ... -def lqmn(m: onp.ToInt, n: onp.ToInt, z: onp.ToFloat | onp.ToFloatND) -> _tuple2[onp.Array2D[_f]] | _tuple2[onp.Array2D[_c]]: ... -def bernoulli(n: onp.ToInt) -> onp.Array1D[_f8]: ... -def euler(n: onp.ToInt) -> onp.Array1D[_f8]: ... -def lqn(n: onp.ToInt, z: onp.ToComplex | onp.ToComplexND) -> _tuple2[onp.Array1D[_f8]] | _tuple2[onp.Array1D[_c16]]: ... -def ai_zeros(nt: onp.ToInt) -> _tuple4[onp.Array1D[_f8], onp.Array1D[_f8]]: ... -def bi_zeros(nt: onp.ToInt) -> _tuple4[onp.Array1D[_f8], onp.Array1D[_f8]]: ... -def lmbda(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[onp.Array1D[_f8]]: ... -def pbdv_seq(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[onp.Array1D[_f8]]: ... -def pbvv_seq(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[onp.Array1D[_f8]]: ... -def pbdn_seq(n: onp.ToInt, z: onp.ToComplex) -> _tuple2[onp.Array1D[_c16]]: ... -def ber_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def bei_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def ker_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def kei_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def berp_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def beip_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def kerp_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def keip_zeros(nt: onp.ToInt) -> onp.Array1D[_f8]: ... -def kelvin_zeros(nt: onp.ToInt) -> _tuple8[onp.Array1D[_f8], onp.Array1D[_f8]]: ... -def pro_cv_seq(m: onp.ToInt, n: onp.ToInt, c: onp.ToFloat) -> onp.Array1D[_f8]: ... -def obl_cv_seq(m: onp.ToInt, n: onp.ToInt, c: onp.ToFloat) -> onp.Array1D[_f8]: ... +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: onp.ToFloat) -> _tuple2[_f8_1d]: ... +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: _ToFloatOrND) -> _tuple2[_f8_nd]: ... # type: ignore[overload-overlap] +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: onp.ToJustComplex) -> _tuple2[_c8_1d]: ... +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: _ToJustComplexOrND) -> _tuple2[_c8_nd]: ... # type: ignore[overload-overlap] +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: onp.ToComplex) -> _tuple2[_f8_1d] | _tuple2[_c8_1d]: ... +@overload +def lqmn(m: onp.ToFloat, n: onp.ToFloat, z: _ToComplexOrND) -> _tuple2[_f8_nd] | _tuple2[_c8_nd]: ... + +# accepts floating input, but it's probably not useful +def bernoulli(n: onp.ToFloat) -> _f8_1d: ... +def euler(n: onp.ToFloat) -> _f8_1d: ... +def ai_zeros(nt: onp.ToFloat) -> _tuple4[_f8_1d, _f8_1d]: ... +def bi_zeros(nt: onp.ToFloat) -> _tuple4[_f8_1d, _f8_1d]: ... + +# +def lmbda(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[_f8_1d]: ... +def pbdv_seq(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[_f8_1d]: ... +def pbvv_seq(v: onp.ToFloat, x: onp.ToFloat) -> _tuple2[_f8_1d]: ... +def pbdn_seq(n: onp.ToInt, z: onp.ToComplex) -> _tuple2[_c8_1d]: ... + +# +def ber_zeros(nt: onp.ToInt) -> _f8_1d: ... +def bei_zeros(nt: onp.ToInt) -> _f8_1d: ... +def ker_zeros(nt: onp.ToInt) -> _f8_1d: ... +def kei_zeros(nt: onp.ToInt) -> _f8_1d: ... +def berp_zeros(nt: onp.ToInt) -> _f8_1d: ... +def beip_zeros(nt: onp.ToInt) -> _f8_1d: ... +def kerp_zeros(nt: onp.ToInt) -> _f8_1d: ... +def keip_zeros(nt: onp.ToInt) -> _f8_1d: ... +def kelvin_zeros(nt: onp.ToInt) -> _tuple8[_f8_1d, _f8_1d]: ... + +# +def pro_cv_seq(m: onp.ToInt, n: onp.ToInt, c: onp.ToFloat) -> _f8_1d: ... +def obl_cv_seq(m: onp.ToInt, n: onp.ToInt, c: onp.ToFloat) -> _f8_1d: ... # @deprecated( "This function is deprecated as of SciPy 1.15.0 and will be removed in SciPy 1.17.0. " "Please use `scipy.special.legendre_p_all` instead." ) -def lpn(n: onp.ToInt, z: onp.ToFloat) -> _tuple2[onp.Array1D[_f]] | _tuple2[onp.Array1D[_c]]: ... # the dtype propagates +def lpn(n: onp.ToInt, z: onp.ToComplex) -> onp.ArrayND[npc.inexact]: ... @deprecated( "This function is deprecated as of SciPy 1.15.0 and will be removed in SciPy 1.17.0. " "Please use `scipy.special.assoc_legendre_p_all` instead." ) -def lpmn(m: onp.ToInt, n: onp.ToInt, z: onp.ToFloat | onp.ToFloatND) -> _tuple2[onp.Array2D[_f8]]: ... +def lpmn(m: onp.ToInt, n: onp.ToInt, z: _ToFloatOrND) -> _tuple2[_f8_nd]: ... @deprecated( "This function is deprecated as of SciPy 1.15.0 and will be removed in SciPy 1.17.0. " "Please use `scipy.special.assoc_legendre_p_all` instead." ) -def clpmn(m: onp.ToInt, n: onp.ToInt, z: onp.ToComplex | onp.ToComplexND, type: L[2, 3] = 3) -> _tuple2[onp.Array2D[_c16]]: ... +def clpmn(m: onp.ToInt, n: onp.ToInt, z: _ToComplexOrND, type: L[2, 3] = 3) -> _tuple2[_c8_nd]: ... # @overload -def comb( - N: onp.ToInt | onp.Array0D[_i], - k: onp.ToInt | onp.Array0D[_i], - *, - exact: Truthy, - repetition: op.CanBool = False, -) -> int: ... +def comb(N: onp.ToInt | onp.Array0D[npc.integer], k: onp.ToInt, *, exact: Truthy, repetition: op.CanBool = False) -> int: ... @overload -def comb( - N: onp.ToFloat | onp.ToFloatND, - k: onp.ToFloat | onp.ToFloatND, - *, - exact: L[False, 0] = False, - repetition: op.CanBool = False, -) -> _ArrayOrScalar[_f4 | _f8]: ... +@deprecated("`exact=True` is deprecated for non-integer `N` and `k` and will raise an error in SciPy 1.16.0") +def comb(N: onp.ToFloat, k: onp.ToJustFloat, *, exact: Truthy, repetition: op.CanBool = False) -> _f: ... +@overload +@deprecated("`exact=True` is deprecated for non-integer `N` and `k` and will raise an error in SciPy 1.16.0") +def comb(N: onp.ToJustFloat, k: onp.ToFloat, *, exact: Truthy, repetition: op.CanBool = False) -> _f: ... +@overload +def comb(N: onp.ToFloat, k: onp.ToFloat, *, exact: Falsy = False, repetition: op.CanBool = False) -> _f: ... +@overload +def comb(N: _ToFloatOrND, k: onp.ToFloatND, *, exact: Falsy = False, repetition: op.CanBool = False) -> _f_nd: ... +@overload +def comb(N: onp.ToFloatND, k: _ToFloatOrND, *, exact: Falsy = False, repetition: op.CanBool = False) -> _f_nd: ... +@overload +def comb(N: _ToFloatOrND, k: _ToFloatOrND, *, exact: Falsy = False, repetition: op.CanBool = False) -> _f | _f_nd: ... # @overload -def perm(N: onp.ToInt | onp.Array0D[_i], k: onp.ToInt | onp.Array0D[_i], exact: Truthy) -> int: ... +def perm(N: onp.ToInt | onp.Array0D[npc.integer], k: onp.ToInt | onp.Array0D[npc.integer], exact: Truthy) -> int: ... +@overload +def perm(N: onp.ToFloat, k: onp.ToFloat, exact: Falsy = False) -> _f: ... +@overload +def perm(N: _ToFloatOrND, k: onp.ToFloatND, exact: Falsy = False) -> _f_nd: ... +@overload +def perm(N: onp.ToFloatND, k: _ToFloatOrND, exact: Falsy = False) -> _f_nd: ... @overload -def perm(N: onp.ToFloat | onp.ToFloatND, k: onp.ToFloat | onp.ToFloatND, exact: Falsy = False) -> _ArrayOrScalar[_f4 | _f8]: ... +def perm(N: _ToFloatOrND, k: _ToFloatOrND, exact: Falsy = False) -> _f | _f_nd: ... # @overload -def factorial(n: onp.ToInt, exact: Truthy, extend: _Extend0 = "zero") -> _i: ... +def factorial(n: onp.ToJustInt, exact: Truthy, extend: _Extend0 = "zero") -> int: ... @overload -def factorial(n: onp.ToIntND, exact: Truthy, extend: _Extend0 = "zero") -> onp.ArrayND[np.int_]: ... +def factorial(n: onp.ToIntND, exact: Truthy, extend: _Extend0 = "zero") -> _i_nd: ... @overload def factorial(n: onp.ToFloat, exact: Falsy = False, extend: _Extend = "zero") -> _f8: ... @overload -def factorial(n: onp.ToFloatND, exact: Falsy = False, extend: _Extend = "zero") -> onp.ArrayND[_f8]: ... +def factorial(n: onp.ToFloatND, exact: Falsy = False, extend: _Extend = "zero") -> _f8_nd: ... @overload -def factorial(n: onp.ToComplex, exact: Falsy, extend: _ExtendZ) -> _f8 | _c16: ... +def factorial(n: onp.ToComplex, exact: Falsy, extend: _ExtendC) -> _fc8: ... @overload -def factorial(n: onp.ToComplexND, exact: Falsy, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorial(n: onp.ToComplexND, exact: Falsy, extend: _ExtendC) -> _fc8_nd: ... @overload -def factorial(n: onp.ToComplex, exact: Falsy = False, *, extend: _ExtendZ) -> _f8 | _c16: ... +def factorial(n: onp.ToComplex, exact: Falsy = False, *, extend: _ExtendC) -> _fc8: ... @overload -def factorial(n: onp.ToComplexND, exact: Falsy = False, *, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorial(n: onp.ToComplexND, exact: Falsy = False, *, extend: _ExtendC) -> _fc8_nd: ... # @overload -def factorial2(n: onp.ToInt, exact: Truthy, extend: _Extend0 = "zero") -> _i: ... +def factorial2(n: int, exact: Truthy, extend: _Extend0 = "zero") -> int: ... @overload -def factorial2(n: onp.ToIntND, exact: Truthy, extend: _Extend0 = "zero") -> onp.ArrayND[np.int_]: ... +def factorial2(n: _SCT_iu, exact: Truthy, extend: _Extend0 = "zero") -> _SCT_iu: ... +@overload +def factorial2(n: onp.ToIntND, exact: Truthy, extend: _Extend0 = "zero") -> _i_nd: ... @overload def factorial2(n: onp.ToFloat, exact: Falsy = False, extend: _Extend = "zero") -> _f8: ... @overload -def factorial2(n: onp.ToFloatND, exact: Falsy = False, extend: _Extend = "zero") -> onp.ArrayND[_f8]: ... +def factorial2(n: onp.ToFloatND, exact: Falsy = False, extend: _Extend = "zero") -> _f8_nd: ... @overload -def factorial2(n: onp.ToComplex, exact: Falsy, extend: _ExtendZ) -> _f8 | _c16: ... +def factorial2(n: onp.ToComplex, exact: Falsy, extend: _ExtendC) -> _fc8: ... @overload -def factorial2(n: onp.ToComplexND, exact: Falsy, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorial2(n: onp.ToComplexND, exact: Falsy, extend: _ExtendC) -> _fc8_nd: ... @overload -def factorial2(n: onp.ToComplex, exact: Falsy = False, *, extend: _ExtendZ) -> _f8 | _c16: ... +def factorial2(n: onp.ToComplex, exact: Falsy = False, *, extend: _ExtendC) -> _fc8: ... @overload -def factorial2(n: onp.ToComplexND, exact: Falsy = False, *, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorial2(n: onp.ToComplexND, exact: Falsy = False, *, extend: _ExtendC) -> _fc8_nd: ... # @overload -def factorialk(n: onp.ToInt, k: onp.ToInt, exact: Truthy, extend: _Extend0 = "zero") -> _i: ... +def factorialk(n: onp.ToJustInt, k: onp.ToJustInt, exact: Truthy, extend: _Extend0 = "zero") -> int: ... @overload -def factorialk(n: onp.ToIntND, k: onp.ToInt, exact: Truthy, extend: _Extend0 = "zero") -> onp.ArrayND[np.int_]: ... +def factorialk(n: onp.ToJustIntND, k: onp.ToJustInt, exact: Truthy, extend: _Extend0 = "zero") -> _i_nd: ... @overload def factorialk(n: onp.ToFloat, k: onp.ToInt, exact: Falsy = False, extend: _Extend = "zero") -> _f8: ... @overload -def factorialk(n: onp.ToFloatND, k: onp.ToInt, exact: Falsy = False, extend: _Extend = "zero") -> onp.ArrayND[_f8]: ... +def factorialk(n: onp.ToFloatND, k: onp.ToInt, exact: Falsy = False, extend: _Extend = "zero") -> _f8_nd: ... @overload -def factorialk(n: onp.ToComplex, k: onp.ToInt, exact: Falsy, extend: _ExtendZ) -> _f8 | _c16: ... +def factorialk(n: onp.ToComplex, k: onp.ToInt, exact: Falsy, extend: _ExtendC) -> _fc8: ... @overload -def factorialk(n: onp.ToComplexND, k: onp.ToInt, exact: Falsy, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorialk(n: onp.ToComplexND, k: onp.ToInt, exact: Falsy, extend: _ExtendC) -> _fc8_nd: ... @overload -def factorialk(n: onp.ToComplex, k: onp.ToInt, exact: Falsy = False, *, extend: _ExtendZ) -> _f8 | _c16: ... +def factorialk(n: onp.ToComplex, k: onp.ToInt, exact: Falsy = False, *, extend: _ExtendC) -> _fc8: ... @overload -def factorialk(n: onp.ToComplexND, k: onp.ToInt, exact: Falsy = False, *, extend: _ExtendZ) -> onp.ArrayND[_f8 | _c16]: ... +def factorialk(n: onp.ToComplexND, k: onp.ToInt, exact: Falsy = False, *, extend: _ExtendC) -> _fc8_nd: ... # @overload def stirling2(N: onp.ToInt, K: onp.ToInt, *, exact: Truthy) -> int: ... @overload -def stirling2(N: onp.ToInt, K: onp.ToIntND, *, exact: Truthy) -> onp.ArrayND[np.object_]: ... +def stirling2(N: _ToIntOrND, K: onp.ToIntND, *, exact: Truthy) -> onp.ArrayND[np.object_]: ... @overload -def stirling2(N: onp.ToIntND, K: onp.ToInt | onp.ToIntND, *, exact: Truthy) -> onp.ArrayND[np.object_]: ... +def stirling2(N: onp.ToIntND, K: _ToIntOrND, *, exact: Truthy) -> onp.ArrayND[np.object_]: ... @overload def stirling2(N: onp.ToInt, K: onp.ToInt, *, exact: Falsy = False) -> _f8: ... @overload -def stirling2(N: onp.ToInt, K: onp.ToIntND, *, exact: Falsy = False) -> onp.ArrayND[_f8]: ... +def stirling2(N: _ToIntOrND, K: onp.ToIntND, *, exact: Falsy = False) -> _f8_nd: ... @overload -def stirling2(N: onp.ToIntND, K: onp.ToInt | onp.ToIntND, *, exact: Falsy = False) -> onp.ArrayND[_f8]: ... +def stirling2(N: onp.ToIntND, K: _ToIntOrND, *, exact: Falsy = False) -> _f8_nd: ... # @overload -def zeta(x: onp.ToComplexND, q: onp.ToFloatND | None, out: _ArrayT) -> _ArrayT: ... +def zeta(x: _ToComplexOrND, q: _ToFloatOrND | None, out: _ArrayT) -> _ArrayT: ... @overload -def zeta(x: onp.ToComplexND, q: onp.ToFloatND | None = None, *, out: _ArrayT) -> _ArrayT: ... +def zeta(x: _ToComplexOrND, q: _ToFloatOrND | None = None, *, out: _ArrayT) -> _ArrayT: ... @overload def zeta(x: onp.ToFloat, q: onp.ToFloat | None = None, out: None = None) -> _f8: ... @overload -def zeta(x: onp.ToFloat, q: onp.ToFloatND, out: None = None) -> onp.ArrayND[_f8]: ... +def zeta(x: _ToFloatOrND, q: onp.ToFloatND, out: None = None) -> _f8_nd: ... +@overload +def zeta(x: onp.ToFloatND, q: _ToFloatOrND | None = None, out: None = None) -> _f8_nd: ... +@overload +def zeta(x: onp.ToJustComplex, q: onp.ToFloat | None = None, out: None = None) -> _c8: ... +@overload +def zeta(x: _ToJustComplexOrND, q: onp.ToFloatND, out: None = None) -> _c8_nd: ... @overload -def zeta(x: onp.ToFloatND, q: onp.ToFloat | onp.ToFloatND | None = None, out: None = None) -> onp.ArrayND[_f8]: ... +def zeta(x: onp.ToJustComplexND, q: _ToFloatOrND | None = None, out: None = None) -> _c8_nd: ... @overload -def zeta(x: onp.ToComplex, q: onp.ToFloat | None = None, out: None = None) -> _f8 | _c16: ... +def zeta(x: onp.ToComplex, q: onp.ToFloat | None = None, out: None = None) -> _fc8: ... @overload -def zeta(x: onp.ToComplex, q: onp.ToFloatND, out: None = None) -> onp.ArrayND[_f8 | _c16]: ... +def zeta(x: _ToComplexOrND, q: onp.ToFloatND, out: None = None) -> _fc8_nd: ... @overload -def zeta(x: onp.ToComplexND, q: onp.ToFloat | onp.ToFloatND | None = None, out: None = None) -> onp.ArrayND[_f8 | _c16]: ... +def zeta(x: onp.ToComplexND, q: _ToFloatOrND | None = None, out: None = None) -> _fc8_nd: ... # @overload -def softplus(x: onp.ToFloat | onp.ToFloatND, *, out: _ArrayT, dtype: None = None, **kwds: Unpack[_KwBase]) -> _ArrayT: ... +def softplus(x: _ToFloatOrND, *, out: _ArrayT, dtype: None = None, **kwds: Unpack[_KwBase]) -> _ArrayT: ... @overload -def softplus(x: float, *, out: None = None, dtype: None = None, **kwds: Unpack[_KwBase]) -> np.float64: ... +def softplus(x: float | _f8, *, out: None = None, dtype: None = None, **kwds: Unpack[_KwBase]) -> _f8: ... @overload -def softplus(x: _SCT_f, *, out: None = None, dtype: None = None, **kwds: Unpack[_KwBase]) -> _SCT_f: ... +def softplus(x: onp.ToInt, *, out: None, dtype: None = None, **kwds: Unpack[_KwBase]) -> _f: ... @overload -def softplus(x: onp.ToFloat, *, out: None, dtype: npt.DTypeLike | None = None, **kwds: Unpack[_KwBase]) -> np.floating[Any]: ... +def softplus(x: onp.ToIntND, *, out: None, dtype: None = None, **kwds: Unpack[_KwBase]) -> _f_nd: ... @overload -def softplus(x: Sequence[float], *, out: None = None, dtype: None = None, **kwds: Unpack[_KwBase]) -> onp.Array1D[np.float64]: ... +def softplus(x: _SCT_f, *, out: None = None, dtype: _ToDType[_SCT_f] | None = None, **kwds: Unpack[_KwBase]) -> _SCT_f: ... +@overload +def softplus(x: onp.ToFloat, *, out: None, dtype: _ToDType[_SCT_f], **kwds: Unpack[_KwBase]) -> _SCT_f: ... @overload def softplus( - x: Sequence[Sequence[float]], + x: onp.ToFloat, *, - out: None = None, - dtype: None = None, + out: None, + dtype: onp.AnyFloatingDType | None = None, **kwds: Unpack[_KwBase], -) -> onp.Array2D[np.float64]: ... +) -> npc.floating: ... @overload def softplus( - x: Sequence[Sequence[Sequence[float]]], + x: onp.ToJustFloat64Strict1D, *, out: None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, **kwds: Unpack[_KwBase], -) -> onp.Array3D[np.float64]: ... +) -> _f8_1d: ... @overload def softplus( - x: onp.SequenceND[float], + x: onp.ToJustFloat64Strict2D, *, out: None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, **kwds: Unpack[_KwBase], -) -> onp.ArrayND[np.float64]: ... +) -> onp.Array2D[_f8]: ... @overload def softplus( - x: onp.CanArrayND[_SCT_f, _ShapeT], + x: onp.ToJustFloat64Strict3D, *, out: None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, **kwds: Unpack[_KwBase], -) -> onp.ArrayND[_SCT_f, _ShapeT]: ... +) -> onp.Array3D[_f8]: ... @overload def softplus( - x: onp.SequenceND[_SCT_f] | onp.SequenceND[onp.CanArrayND[_SCT_f]], + x: onp.ToJustFloat64_ND, *, out: None = None, - dtype: None = None, + dtype: onp.AnyFloat64DType | None = None, **kwds: Unpack[_KwBase], -) -> onp.ArrayND[_SCT_f]: ... +) -> _f8_nd: ... @overload def softplus( - x: onp.ToFloatND, + x: onp.CanArrayND[_SCT_f, _ShapeT], *, out: None = None, - dtype: type[_SCT_f] | np.dtype[_SCT_f] | onp.HasDType[np.dtype[_SCT_f]], + dtype: _ToDType[_SCT_f] | None = None, **kwds: Unpack[_KwBase], -) -> onp.ArrayND[_SCT_f]: ... +) -> onp.ArrayND[_SCT_f, _ShapeT]: ... +@overload +def softplus(x: onp.ToFloatND, *, out: None = None, dtype: _ToDType[_SCT_f], **kwds: Unpack[_KwBase]) -> onp.ArrayND[_SCT_f]: ... @overload def softplus( x: onp.ToFloatND, *, out: None, - dtype: npt.DTypeLike | None = None, + dtype: onp.AnyFloatingDType | None = None, **kwds: Unpack[_KwBase], -) -> onp.ArrayND[np.floating[Any]]: ... +) -> onp.ArrayND[npc.floating]: ...