diff --git a/pyproject.toml b/pyproject.toml index 5d875919..7ca5e0e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ ] requires-python = ">=3.10" dependencies = [ - "optype>=0.7.3", + "optype>=0.8.0", ] [dependency-groups] @@ -57,7 +57,7 @@ typecheck = [ dev = [ {include-group = "lint"}, {include-group = "typecheck"}, - "poethepoet>=0.31.1,<1", + "poethepoet>=0.32.0,<1", "pre-commit>=4.0.1,<5", "pre-commit-uv>=4.1.4,<5", ] @@ -194,7 +194,6 @@ reportPropertyTypeMismatch = false reportShadowedImports = true reportUnannotatedClassAttribute = true # based reportUninitializedInstanceVariable = true -# reportUnnecessaryTypeIgnoreComment = false # mypy compat reportUnnecessaryTypeIgnoreComment = true # mypy compat strictGenericNarrowing = true # based diff --git a/scipy-stubs/optimize/_slsqp_py.pyi b/scipy-stubs/optimize/_slsqp_py.pyi index b650bb7f..5a47f9ee 100644 --- a/scipy-stubs/optimize/_slsqp_py.pyi +++ b/scipy-stubs/optimize/_slsqp_py.pyi @@ -10,7 +10,7 @@ _FT = TypeVar("_FT", bound=onp.ToFloat | onp.ToFloatND) _Fun: TypeAlias = Callable[Concatenate[onp.Array1D[np.float64], ...], _FT] _Fun0D: TypeAlias = _Fun[onp.ToFloat] _Fun1D: TypeAlias = _Fun[onp.ToFloat1D] -_Fun2D: TypeAlias = _Fun[onp.ToFloat2D] +_Fun2D: TypeAlias = _Fun[onp.ToFloat2D] # type: ignore[type-var] _Ignored: TypeAlias = object diff --git a/scipy-stubs/optimize/_zeros_py.pyi b/scipy-stubs/optimize/_zeros_py.pyi index ed7805ee..7b7e363d 100644 --- a/scipy-stubs/optimize/_zeros_py.pyi +++ b/scipy-stubs/optimize/_zeros_py.pyi @@ -154,7 +154,7 @@ def newton( args: tuple[object, ...] = (), tol: onp.ToFloat = 1.48e-08, maxiter: onp.ToJustInt = 50, - fprime2: _Fun1D[onp.ToFloat2D] | None = None, + fprime2: _Fun1D[onp.ToFloat2D] | None = None, # type: ignore[type-var] x1: onp.ToFloat1D | None = None, rtol: onp.ToFloat = 0.0, full_output: _Falsy = False, diff --git a/scipy-stubs/signal/_spline_filters.pyi b/scipy-stubs/signal/_spline_filters.pyi index 44bc9b74..69dd4e3a 100644 --- a/scipy-stubs/signal/_spline_filters.pyi +++ b/scipy-stubs/signal/_spline_filters.pyi @@ -40,7 +40,7 @@ def spline_filter(Iin: onp.ArrayND[_FloatDT], lmbda: onp.ToFloat = 5.0) -> onp.A # @overload -def gauss_spline(x: onp.ArrayND[_SubFloat64, _ShapeT], n: onp.ToFloat) -> onp.ArrayND[np.float64, _ShapeT]: ... +def gauss_spline(x: onp.ArrayND[_SubFloat64, _ShapeT], n: onp.ToFloat) -> onp.ArrayND[np.float64, _ShapeT]: ... # type: ignore[overload-overlap] @overload def gauss_spline(x: onp.ArrayND[_InexactQT, _ShapeT], n: onp.ToFloat) -> onp.ArrayND[_InexactQT, _ShapeT]: ... @overload diff --git a/scipy-stubs/sparse/linalg/_interface.pyi b/scipy-stubs/sparse/linalg/_interface.pyi index 56799f4a..d0dae9cf 100644 --- a/scipy-stubs/sparse/linalg/_interface.pyi +++ b/scipy-stubs/sparse/linalg/_interface.pyi @@ -71,12 +71,12 @@ class LinearOperator(Generic[_SCT_co]): def matvec(self, /, x: onp.ToFloatStrict1D) -> onp.Array1D[_SCT_co]: ... @overload # float matrix def matvec(self, /, x: Matrix[_Real]) -> Matrix[_SCT_co]: ... + @overload # complex matrix + def matvec(self, /, x: Matrix[_Number]) -> Matrix[_SCT_co | np.complex128]: ... @overload # float array 2d def matvec(self, /, x: onp.ToFloatStrict2D) -> onp.Array2D[_SCT_co]: ... @overload # complex array 1d def matvec(self, /, x: onp.ToComplexStrict1D) -> onp.Array1D[_SCT_co | np.complex128]: ... - @overload # complex matrix - def matvec(self, /, x: Matrix[_Number]) -> Matrix[_SCT_co | np.complex128]: ... @overload # complex array 2d def matvec(self, /, x: onp.ToComplexStrict2D) -> onp.Array2D[_SCT_co | np.complex128]: ... @overload # float array diff --git a/scipy-stubs/stats/_distn_infrastructure.pyi b/scipy-stubs/stats/_distn_infrastructure.pyi index 35a1ed8e..efb643b1 100644 --- a/scipy-stubs/stats/_distn_infrastructure.pyi +++ b/scipy-stubs/stats/_distn_infrastructure.pyi @@ -1,45 +1,56 @@ # NOTE: Using `@override` on `__call__` or `freeze` in `rv_discrete` causes stubtest to crash (mypy 1.11.1 and 1.13.0) # mypy: disable-error-code="explicit-override, override" +# NOTE: this is needed because of the >50 LSP violations... +# pyright: reportIncompatibleMethodOverride = false + import abc -from collections.abc import Callable, Iterable, Sequence -from typing import Any, Final, Generic, Literal, TypeAlias, overload, type_check_only -from typing_extensions import LiteralString, Self, TypeVar, Unpack, override +from collections.abc import Callable, Iterable, Mapping, Sequence +from typing import Any, Final, Generic, Literal as L, TypeAlias, overload, type_check_only +from typing_extensions import Self, TypeVar, Unpack, override import numpy as np import optype as op import optype.numpy as onp -import scipy._typing as spt +from scipy._typing import RNG, AnyShape, ToRNG from scipy.integrate._typing import QuadOpts as _QuadOpts _T = TypeVar("_T") +_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...], default=tuple[int, ...]) + +_ArgT = TypeVar("_ArgT", bound=_ToFloatOrND, default=_ToFloatOrND) + +_FloatNDT = TypeVar("_FloatNDT", bound=_FloatOrND, default=_FloatOrND) +_FloatNDT_co = TypeVar("_FloatNDT_co", bound=_FloatOrND, default=_FloatOrND, covariant=True) + +_RVT = TypeVar("_RVT", bound=rv_generic, default=rv_generic) +_RVT_co = TypeVar("_RVT_co", bound=rv_generic, default=rv_generic, covariant=True) +_CRVT_co = TypeVar("_CRVT_co", bound=rv_continuous, default=rv_continuous, covariant=True) +_DRVT_co = TypeVar("_DRVT_co", bound=rv_discrete, default=rv_discrete, covariant=True) + _Tuple2: TypeAlias = tuple[_T, _T] _Tuple3: TypeAlias = tuple[_T, _T, _T] _Tuple4: TypeAlias = tuple[_T, _T, _T, _T] -_Scalar_i: TypeAlias = np.integer[Any] -_Scalar_f: TypeAlias = np.float64 | np.float32 | np.float16 # longdouble often results in trouble -_Scalar_if: TypeAlias = _Scalar_f | _Scalar_i # including np.bool_ here would become messy +_Integer: TypeAlias = np.integer[Any] +_Floating: TypeAlias = np.float64 | np.float32 | np.float16 # longdouble often results in trouble +_CoFloat: TypeAlias = _Floating | _Integer -# NOTE: this will be equivalent to `float` in `numpy>=2.2`, see https://github.com/numpy/numpy/pull/27334 -_Scalar_b1: TypeAlias = bool | np.bool_ -_Scalar_i8: TypeAlias = int | np.int64 -_Scalar_f8: TypeAlias = float | np.float64 +_Bool: TypeAlias = bool | np.bool_ +_Int: TypeAlias = int | np.int_ +_Float: TypeAlias = float | np.float64 -_ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...], default=tuple[int, ...]) -_Arr_b1: TypeAlias = onp.Array[_ShapeT, np.bool_] -_Arr_i8: TypeAlias = onp.Array[_ShapeT, np.int64] -_Arr_f8: TypeAlias = onp.Array[_ShapeT, np.float64] +_BoolND: TypeAlias = onp.ArrayND[np.bool_] +_IntND: TypeAlias = onp.ArrayND[np.int_] +_FloatND: TypeAlias = onp.ArrayND[np.float64] +_CoFloatND: TypeAlias = onp.ArrayND[_CoFloat] -_ArrLike_b1: TypeAlias = _Scalar_b1 | _Arr_b1 -_ArrLike_i8: TypeAlias = _Scalar_i8 | _Arr_i8 -_ArrLike_f8: TypeAlias = _Scalar_f8 | _Arr_f8 +_BoolOrND: TypeAlias = _Bool | _BoolND +_IntOrND: TypeAlias = _Int | _IntND +_FloatOrND: TypeAlias = _Float | _FloatND -_Scalar_f8_co: TypeAlias = float | _Scalar_if -_Arr_f8_co: TypeAlias = onp.Array[_ShapeT, _Scalar_if] -_ArrLike_f8_co: TypeAlias = _ArrLike_f8 | onp.CanArray[tuple[int, ...], np.dtype[_Scalar_if]] | Sequence[_ArrLike_f8_co] +_ToFloatOrND: TypeAlias = onp.ToFloat | onp.ToFloatND -_ArgT = TypeVar("_ArgT", bound=_ArrLike_f8_co, default=_ArrLike_f8_co) # there are at most 4 + 2 args _RVArgs: TypeAlias = ( tuple[()] @@ -50,29 +61,29 @@ _RVArgs: TypeAlias = ( | tuple[_ArgT, _ArgT, _ArgT, _ArgT, _ArgT] | tuple[_ArgT, _ArgT, _ArgT, _ArgT, _ArgT, _ArgT] ) -_RVKwds: TypeAlias = dict[str, _ArrLike_f8_co] +_RVKwds: TypeAlias = dict[str, _ToFloatOrND] -_Moments1: TypeAlias = Literal["m", "v", "s", "k"] -_Moments2: TypeAlias = Literal[ +_Moment1: TypeAlias = L["m", "v", "s", "k"] +_Moment2: TypeAlias = L[ "mv", "ms", "mk", "vm", "vs", "vk", "sm", "sv", "sk", "km", "kv", "ks", ] # fmt: skip -_Moments3: TypeAlias = Literal[ +_Moment3: TypeAlias = L[ "mvs", "mvk", "msv", "msk", "mkv", "mks", "vms", "vmk", "vsm", "vsk", "vkm", "vks", "smv", "smk", "svm", "svk", "skm", "skv", "kmv", "kms", "kvm", "kvs", "ksm", "ksv", ] # fmt: skip -_Moments4: TypeAlias = Literal[ +_Moment4: TypeAlias = L[ "mvsk", "mvks", "msvk", "mskv", "mkvs", "mksv", "vmsk", "vmks", "vsmk", "vskm", "vkms", "vksm", "smvk", "smkv", "svmk", "svkm", "skmv", "skvm", "kmvs", "kmsv", "kvms", "kvsm", "ksmv", "ksvm", ] # fmt: skip -_FitMethod: TypeAlias = Literal["MLE", "MM"] +_FitMethod: TypeAlias = L["MLE", "MM"] ### @@ -81,156 +92,153 @@ docdict: Final[dict[str, str]] = ... docdict_discrete: Final[dict[str, str]] = ... parse_arg_template: Final[str] = ... -def argsreduce(cond: _Arr_b1, *args: _ArrLike_f8_co) -> list[_Arr_f8_co]: ... +def argsreduce(cond: _BoolND, *args: _ToFloatOrND) -> list[_CoFloatND]: ... -_RVT = TypeVar("_RVT", bound=rv_generic, default=rv_generic) -_RVT_co = TypeVar("_RVT_co", bound=rv_generic, covariant=True, default=rv_generic) -_VT_f8 = TypeVar("_VT_f8", bound=_ArrLike_f8, default=_ArrLike_f8) -_VT_f8_co = TypeVar("_VT_f8_co", bound=_ArrLike_f8, covariant=True, default=_ArrLike_f8) - -class rv_frozen(Generic[_RVT_co, _VT_f8_co]): +class rv_frozen(Generic[_RVT_co, _FloatNDT_co]): dist: _RVT_co - args: _RVArgs[_VT_f8_co] + args: _RVArgs[_FloatNDT_co] kwds: _RVKwds @property - def random_state(self, /) -> spt.RNG: ... + def random_state(self, /) -> RNG: ... @random_state.setter - def random_state(self, seed: spt.ToRNG, /) -> None: ... + def random_state(self, seed: ToRNG, /) -> None: ... # @overload - def __init__(self: rv_frozen[_RVT, _Scalar_f8], /, dist: _RVT) -> None: ... + def __init__(self: rv_frozen[_RVT, _Float], /, dist: _RVT) -> None: ... @overload - def __init__(self, /, dist: _RVT_co, *args: _VT_f8_co, **kwds: _VT_f8_co) -> None: ... + def __init__(self, /, dist: _RVT_co, *args: _FloatNDT_co, **kwds: _FloatNDT_co) -> None: ... @overload - def __init__(self, /, dist: _RVT_co, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> None: ... + def __init__(self, /, dist: _RVT_co, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> None: ... # @overload - def cdf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def cdf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def cdf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def cdf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def cdf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def cdf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def logcdf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def logcdf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def logcdf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def logcdf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def logcdf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def logcdf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def sf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def sf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def sf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def sf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def sf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def sf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def logsf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def logsf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def logsf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def logsf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def logsf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def logsf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def ppf(self, /, q: _Scalar_f8_co) -> _VT_f8_co: ... + def ppf(self, /, q: onp.ToFloat) -> _FloatNDT_co: ... @overload - def ppf(self, /, q: _Arr_f8_co[Any]) -> _Arr_f8: ... + def ppf(self, /, q: _CoFloatND) -> _FloatND: ... @overload - def ppf(self, /, q: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def ppf(self, /, q: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def isf(self, /, q: _Scalar_f8_co) -> _VT_f8_co: ... + def isf(self, /, q: onp.ToFloat) -> _FloatNDT_co: ... @overload - def isf(self, /, q: _Arr_f8_co[Any]) -> _Arr_f8: ... + def isf(self, /, q: _CoFloatND) -> _FloatND: ... @overload - def isf(self, /, q: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def isf(self, /, q: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # - def rvs(self, /, size: spt.AnyShape | None = None, random_state: spt.ToRNG = None) -> _ArrLike_f8: ... + def rvs(self, /, size: AnyShape | None = None, random_state: ToRNG = None) -> _FloatOrND: ... # @overload - def stats(self, /, moments: _Moments1) -> _VT_f8_co: ... + def stats(self, /, moments: _Moment1) -> _FloatNDT_co: ... @overload - def stats(self, /, moments: _Moments2 = ...) -> _Tuple2[_VT_f8_co]: ... + def stats(self, /, moments: _Moment2 = ...) -> _Tuple2[_FloatNDT_co]: ... @overload - def stats(self, /, moments: _Moments3) -> _Tuple3[_VT_f8_co]: ... + def stats(self, /, moments: _Moment3) -> _Tuple3[_FloatNDT_co]: ... @overload - def stats(self, /, moments: _Moments4) -> _Tuple4[_VT_f8_co]: ... + def stats(self, /, moments: _Moment4) -> _Tuple4[_FloatNDT_co]: ... # - def median(self, /) -> _VT_f8_co: ... - def mean(self, /) -> _VT_f8_co: ... - def var(self, /) -> _VT_f8_co: ... - def std(self, /) -> _VT_f8_co: ... + def median(self, /) -> _FloatNDT_co: ... + def mean(self, /) -> _FloatNDT_co: ... + def var(self, /) -> _FloatNDT_co: ... + def std(self, /) -> _FloatNDT_co: ... # order defaults to `None`, but that will `raise TypeError` - def moment(self, /, order: int | _Scalar_i | None = None) -> _VT_f8_co: ... - def entropy(self, /) -> _VT_f8_co: ... + def moment(self, /, order: onp.ToInt | None = None) -> _FloatNDT_co: ... + def entropy(self, /) -> _FloatNDT_co: ... # - def interval(self, /, confidence: _Scalar_f8_co | None = None) -> _Tuple2[_VT_f8_co]: ... - def support(self, /) -> _Tuple2[_VT_f8_co]: ... + def interval(self, /, confidence: onp.ToFloat | None = None) -> _Tuple2[_FloatNDT_co]: ... + def support(self, /) -> _Tuple2[_FloatNDT_co]: ... # def expect( - self: rv_frozen[_RVT, _Scalar_f8], + self: rv_frozen[_RVT, _Float], /, - func: Callable[[float], _Scalar_f8_co] | None = None, - lb: _Scalar_f8_co | None = None, - ub: _Scalar_f8_co | None = None, - conditional: _Scalar_b1 = False, + func: Callable[[float], onp.ToFloat] | None = None, + lb: onp.ToFloat | None = None, + ub: onp.ToFloat | None = None, + conditional: _Bool = False, **kwds: Unpack[_QuadOpts], - ) -> _Scalar_f8: ... + ) -> _Float: ... -_RVT_c_co = TypeVar("_RVT_c_co", bound=rv_continuous, covariant=True, default=rv_continuous) - -class rv_continuous_frozen(rv_frozen[_RVT_c_co, _VT_f8_co], Generic[_RVT_c_co, _VT_f8_co]): +class rv_continuous_frozen(rv_frozen[_CRVT_co, _FloatNDT_co], Generic[_CRVT_co, _FloatNDT_co]): @overload - def pdf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def pdf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def pdf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def pdf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def pdf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def pdf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def logpdf(self, /, x: _Scalar_f8_co) -> _VT_f8_co: ... + def logpdf(self, /, x: onp.ToFloat) -> _FloatNDT_co: ... @overload - def logpdf(self, /, x: _Arr_f8_co[Any]) -> _Arr_f8: ... + def logpdf(self, /, x: _CoFloatND) -> _FloatND: ... @overload - def logpdf(self, /, x: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... - -_RVT_d_co = TypeVar("_RVT_d_co", bound=rv_discrete, covariant=True, default=rv_discrete) + def logpdf(self, /, x: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... -class rv_discrete_frozen(rv_frozen[_RVT_d_co, _VT_f8_co], Generic[_RVT_d_co, _VT_f8_co]): +class rv_discrete_frozen(rv_frozen[_DRVT_co, _FloatNDT_co], Generic[_DRVT_co, _FloatNDT_co]): @overload - def pmf(self, /, k: _Scalar_f8_co) -> _VT_f8_co: ... + def pmf(self, /, k: onp.ToFloat) -> _FloatNDT_co: ... @overload - def pmf(self, /, k: _Arr_f8_co[Any]) -> _Arr_f8: ... + def pmf(self, /, k: _CoFloatND) -> _FloatND: ... @overload - def pmf(self, /, k: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def pmf(self, /, k: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # @overload - def logpmf(self, /, k: _Scalar_f8_co) -> _VT_f8_co: ... + def logpmf(self, /, k: onp.ToFloat) -> _FloatNDT_co: ... @overload - def logpmf(self, /, k: _Arr_f8_co[Any]) -> _Arr_f8: ... + def logpmf(self, /, k: _CoFloatND) -> _FloatND: ... @overload - def logpmf(self, /, k: _ArrLike_f8_co) -> _VT_f8_co | _Arr_f8: ... + def logpmf(self, /, k: _ToFloatOrND) -> _FloatNDT_co | _FloatND: ... # NOTE: Because of the limitations of `ParamSpec`, there is no proper way to annotate specific "positional or keyword arguments". # Considering the Liskov Substitution Principle, the only remaining option is to annotate `*args, and `**kwargs` as `Any`. class rv_generic: - def __init__(self, /, seed: spt.ToRNG = None) -> None: ... @property - def random_state(self, /) -> spt.RNG: ... + def random_state(self, /) -> RNG: ... @random_state.setter - def random_state(self, seed: spt.ToRNG, /) -> None: ... + def random_state(self, seed: ToRNG, /) -> None: ... + + # + def __init__(self, /, seed: ToRNG = None) -> None: ... + + # @abc.abstractmethod def _attach_methods(self, /) -> None: ... def _attach_argparser_methods(self, /) -> None: ... + + # def _construct_argparser( self, /, @@ -244,117 +252,154 @@ class rv_generic: /, longname: str | None = None, docdict: dict[str, str] | None = None, - discrete: Literal["continuous", "discrete"] = "continuous", + discrete: L["continuous", "discrete"] = "continuous", ) -> None: ... + + # @overload - def __call__(self, /) -> rv_frozen[Self, _Scalar_f8]: ... + def __call__(self, /) -> rv_frozen[Self, _Float]: ... @overload - def __call__(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> rv_frozen[Self, _Scalar_f8]: ... + def __call__(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> rv_frozen[Self, _Float]: ... @overload - def __call__(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> rv_frozen[Self]: ... + def __call__(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> rv_frozen[Self]: ... + + # @overload - def freeze(self, /) -> rv_frozen[Self, _Scalar_f8]: ... + def freeze(self, /) -> rv_frozen[Self, _Float]: ... @overload - def freeze(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> rv_frozen[Self, _Scalar_f8]: ... + def freeze(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> rv_frozen[Self, _Float]: ... @overload - def freeze(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> rv_frozen[Self]: ... - def _stats(self, /, *args: Any, **kwds: Any) -> _Tuple4[_Scalar_f8 | None] | _Tuple4[_Arr_f8 | None]: ... - def _munp(self, /, n: onp.ToInt | onp.ToIntND, *args: Any) -> _Arr_f8: ... + def freeze(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> rv_frozen[Self]: ... + + # + def _stats(self, /, *args: onp.ToFloat, **kwds: Any) -> _Tuple4[_Float | None] | _Tuple4[_FloatND | None]: ... + def _munp(self, /, n: onp.ToInt | onp.ToIntND, *args: onp.ToFloat) -> _FloatND: ... + + # def _argcheck_rvs( self, /, - *args: Any, + *args: onp.ToFloat, size: onp.ToInt | onp.ToIntND | None = None, - ) -> tuple[list[_Arr_f8_co], _Arr_f8_co, _Arr_f8_co, tuple[int, ...] | tuple[np.int_, ...]]: ... - def _argcheck(self, /, *args: Any) -> _ArrLike_b1: ... - def _get_support(self, /, *args: Any, **kwargs: Any) -> _Tuple2[_ArrLike_f8]: ... - def _support_mask(self, /, x: _Arr_f8_co, *args: Any) -> _Arr_b1: ... - def _open_support_mask(self, /, x: _Arr_f8_co, *args: Any) -> _ArrLike_b1: ... - def _rvs(self, /, *args: Any, size: spt.AnyShape | None = None, random_state: spt.ToRNG = None) -> _ArrLike_f8: ... - def _logcdf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _sf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _logsf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _ppf(self, /, q: _VT_f8, *args: Any) -> _VT_f8: ... - def _isf(self, /, q: _VT_f8, *args: Any) -> _VT_f8: ... + ) -> tuple[list[_CoFloatND], _CoFloatND, _CoFloatND, tuple[int, ...] | tuple[np.int_, ...]]: ... + def _argcheck(self, /, *args: onp.ToFloat) -> _BoolOrND: ... + + # + def _get_support(self, /, *args: onp.ToFloat, **kwargs: onp.ToFloat) -> _Tuple2[_FloatOrND]: ... + def _support_mask(self, /, x: _CoFloatND, *args: onp.ToFloat) -> _BoolND: ... + def _open_support_mask(self, /, x: _CoFloatND, *args: onp.ToFloat) -> _BoolOrND: ... + + # + def _rvs(self, /, *args: onp.ToFloat, size: AnyShape | None = None, random_state: ToRNG = None) -> _FloatOrND: ... + + # + def _logcdf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _sf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _logsf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _ppf(self, /, q: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _isf(self, /, q: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + + # @overload def rvs( self, /, - *args: _Scalar_f8_co, - random_state: spt.ToRNG, - discrete: Literal[True, 1], - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_i8: ... + *args: onp.ToFloat, + random_state: ToRNG, + discrete: L[True, 1], + **kwds: _ToFloatOrND, + ) -> _IntOrND: ... @overload def rvs( self, /, - *args: _Scalar_f8_co, - random_state: spt.ToRNG, - discrete: Literal[False, 0] | None = ..., - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + *args: onp.ToFloat, + random_state: ToRNG, + discrete: L[False, 0] | None = ..., + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... + + # @overload - def stats(self, /, *args: _Scalar_f8_co, moment: _Moments1, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def stats(self, /, *args: onp.ToFloat, moment: _Moment1, **kwds: onp.ToFloat) -> _Float: ... @overload - def stats(self, /, *args: _ArrLike_f8_co, moment: _Moments1, **kwds: _ArrLike_f8_co) -> _Scalar_f8 | _Arr_f8: ... + def stats(self, /, *args: _ToFloatOrND, moment: _Moment1, **kwds: _ToFloatOrND) -> _Float | _FloatND: ... @overload - def stats(self, /, *args: _Scalar_f8_co, moment: _Moments2 = ..., **kwds: _Scalar_f8_co) -> _Tuple2[_Scalar_f8]: ... + def stats(self, /, *args: onp.ToFloat, moment: _Moment2 = ..., **kwds: onp.ToFloat) -> _Tuple2[_Float]: ... @overload - def stats(self, /, *args: _ArrLike_f8_co, moment: _Moments2 = ..., **kwds: _ArrLike_f8_co) -> _Tuple2[_ArrLike_f8]: ... + def stats(self, /, *args: _ToFloatOrND, moment: _Moment2 = ..., **kwds: _ToFloatOrND) -> _Tuple2[_FloatOrND]: ... @overload - def stats(self, /, *args: _Scalar_f8_co, moment: _Moments3, **kwds: _Scalar_f8_co) -> _Tuple3[_Scalar_f8]: ... + def stats(self, /, *args: onp.ToFloat, moment: _Moment3, **kwds: onp.ToFloat) -> _Tuple3[_Float]: ... @overload - def stats(self, /, *args: _ArrLike_f8_co, moment: _Moments3, **kwds: _ArrLike_f8_co) -> _Tuple3[_ArrLike_f8]: ... + def stats(self, /, *args: _ToFloatOrND, moment: _Moment3, **kwds: _ToFloatOrND) -> _Tuple3[_FloatOrND]: ... @overload - def stats(self, /, *args: _Scalar_f8_co, moment: _Moments4, **kwds: _Scalar_f8_co) -> _Tuple4[_Scalar_f8]: ... + def stats(self, /, *args: onp.ToFloat, moment: _Moment4, **kwds: onp.ToFloat) -> _Tuple4[_Float]: ... @overload - def stats(self, /, *args: _ArrLike_f8_co, moment: _Moments4, **kwds: _ArrLike_f8_co) -> _Tuple4[_ArrLike_f8]: ... + def stats(self, /, *args: _ToFloatOrND, moment: _Moment4, **kwds: _ToFloatOrND) -> _Tuple4[_FloatOrND]: ... + + # @overload - def entropy(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def entropy(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def entropy(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def entropy(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def moment(self, /, order: onp.ToInt, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def moment(self, /, order: onp.ToInt, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def moment(self, /, order: onp.ToInt, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def moment(self, /, order: onp.ToInt, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def median(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def median(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def median(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def median(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def mean(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def mean(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def mean(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def mean(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def var(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def var(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def var(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def var(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def std(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def std(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Float: ... @overload - def std(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _ArrLike_f8: ... + def std(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _FloatOrND: ... + + # @overload - def interval(self, /, confidence: _Scalar_f8_co, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Tuple2[_Scalar_f8]: ... + def interval(self, /, confidence: onp.ToFloat, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Tuple2[_Float]: ... @overload - def interval(self, /, confidence: _ArrLike_f8_co, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _Tuple2[_ArrLike_f8]: ... + def interval(self, /, confidence: _ToFloatOrND, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _Tuple2[_FloatOrND]: ... + + # @overload - def support(self, /, *args: _Scalar_f8_co, **kwds: _Scalar_f8_co) -> _Tuple2[_Scalar_f8]: ... + def support(self, /, *args: onp.ToFloat, **kwds: onp.ToFloat) -> _Tuple2[_Float]: ... @overload - def support(self, /, *args: _ArrLike_f8_co, **kwds: _ArrLike_f8_co) -> _Tuple2[_Scalar_f8] | _Tuple2[_Arr_f8]: ... - def nnlf(self, /, theta: Sequence[_Scalar_f8_co], x: _ArrLike_f8_co) -> _ArrLike_f8: ... - def _nnlf(self, /, x: _Arr_f8_co, *args: Any) -> _ArrLike_f8: ... - def _penalized_nnlf(self, /, theta: Sequence[Any], x: _Arr_f8_co) -> _Scalar_f8: ... - def _penalized_nlpsf(self, /, theta: Sequence[Any], x: _Arr_f8_co) -> _Scalar_f8: ... + def support(self, /, *args: _ToFloatOrND, **kwds: _ToFloatOrND) -> _Tuple2[_Float] | _Tuple2[_FloatND]: ... + + # + def nnlf(self, /, theta: onp.ToFloat1D, x: _ToFloatOrND) -> _FloatOrND: ... + def _nnlf(self, /, x: _CoFloatND, *args: onp.ToFloat) -> _FloatOrND: ... + def _penalized_nnlf(self, /, theta: Sequence[Any], x: _CoFloatND) -> _Float: ... + def _penalized_nlpsf(self, /, theta: Sequence[Any], x: _CoFloatND) -> _Float: ... class _ShapeInfo: - name: Final[LiteralString] + name: Final[str] integrality: Final[bool] domain: Final[Sequence[float]] # in practice always a list of size two + def __init__( self, /, - name: LiteralString, + name: str, integrality: bool = False, domain: Sequence[float] = ..., inclusive: Sequence[bool] = (True, True), @@ -362,400 +407,418 @@ class _ShapeInfo: @type_check_only class _rv_mixin: - name: Final[LiteralString] + name: Final[str] a: Final[float] b: Final[float] badvalue: Final[float] - shapes: Final[LiteralString] + shapes: Final[str] + + def generic_moment(self, /, n: onp.ToInt | onp.ToIntND, *args: onp.ToFloat) -> _FloatND: ... + # def _shape_info(self, /) -> list[_ShapeInfo]: ... def _param_info(self, /) -> list[_ShapeInfo]: ... def _attach_methods(self, /) -> None: ... - def generic_moment(self, /, n: onp.ToInt | onp.ToIntND, *args: _Scalar_f8_co) -> _Arr_f8: ... - def _logpxf(self, /, x: _Arr_f8_co, *args: Any) -> _Arr_f8: ... - def _cdf_single(self, /, x: _Scalar_f8_co, *args: Any) -> _Scalar_f8: ... - def _cdfvec(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _cdf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _ppfvec(self, /, q: _VT_f8, *args: Any) -> _VT_f8: ... + def _logpxf(self, /, x: _CoFloatND, *args: onp.ToFloat) -> _FloatND: ... + def _cdf_single(self, /, x: onp.ToFloat, *args: onp.ToFloat) -> _Float: ... + def _cdfvec(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _cdf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _ppfvec(self, /, q: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... def _unpack_loc_scale( self, /, - theta: Sequence[_ArrLike_f8_co], - ) -> tuple[_ArrLike_f8_co, _ArrLike_f8_co, tuple[_ArrLike_f8_co, ...]]: ... + theta: Sequence[_ToFloatOrND], + ) -> tuple[_ToFloatOrND, _ToFloatOrND, tuple[_ToFloatOrND, ...]]: ... class rv_continuous(_rv_mixin, rv_generic): - moment_type: Final[Literal[0, 1]] + moment_type: Final[L[0, 1]] xtol: Final[float] def __init__( self, /, - momtype: Literal[0, 1] = 1, + momtype: L[0, 1] = 1, a: float | None = None, b: float | None = None, xtol: float = 1e-14, badvalue: float | None = None, - name: LiteralString | None = None, - longname: LiteralString | None = None, - shapes: LiteralString | None = None, - seed: spt.ToRNG = None, + name: str | None = None, + longname: str | None = None, + shapes: str | None = None, + seed: ToRNG = None, ) -> None: ... + + # @overload - def __call__(self, /) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def __call__(self, /) -> rv_continuous_frozen[Self, _Float]: ... @overload def __call__( self, /, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> rv_continuous_frozen[Self, _Float]: ... @overload def __call__( self, /, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, ) -> rv_continuous_frozen[Self]: ... + # @overload - def freeze(self, /) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def freeze(self, /) -> rv_continuous_frozen[Self, _Float]: ... @overload def freeze( self, /, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> rv_continuous_frozen[Self, _Float]: ... @overload def freeze( self, /, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, ) -> rv_continuous_frozen[Self]: ... # - def _pdf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... - def _logpdf(self, /, x: _VT_f8, *args: Any) -> _VT_f8: ... + def _pdf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... + def _logpdf(self, /, x: _FloatNDT, *args: onp.ToFloat) -> _FloatNDT: ... # @overload def pdf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def pdf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def pdf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def logpdf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def logpdf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logpdf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def cdf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def cdf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def cdf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def logcdf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def logcdf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logcdf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def sf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def sf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def sf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def logsf( self, /, - x: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + x: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def logsf( self, /, - x: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + x: onp.CanArrayND[_CoFloat, _ShapeT], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logsf( self, /, - x: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + x: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def ppf( self, /, - q: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + q: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def ppf( self, /, - q: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + q: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def ppf( self, /, - q: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + q: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload def isf( self, /, - q: _Scalar_f8_co, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Scalar_f8: ... + q: onp.ToFloat, + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> _Float: ... @overload def isf( self, /, - q: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + q: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def isf( self, /, - q: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + q: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # - def _nnlf_and_penalty(self, /, x: _Arr_f8, args: Sequence[Any]) -> _Scalar_f8: ... + def _nnlf_and_penalty(self, /, x: _FloatND, args: Sequence[onp.ToFloat]) -> _Float: ... + # def _fitstart( self, /, - data: _Arr_f8, - args: tuple[Any, ...] | None = None, - ) -> tuple[Unpack[tuple[_Scalar_f8, ...]], _Scalar_f8, _Scalar_f8]: ... + data: _FloatND, + args: tuple[onp.ToFloat, ...] | None = None, + ) -> tuple[Unpack[tuple[_Float, ...]], _Float, _Float]: ... + # def _reduce_func( self, /, - args: tuple[Any, ...], - kwds: dict[str, Any], - data: _ArrLike_f8_co | None = None, + args: tuple[onp.ToFloat, ...], + kwds: Mapping[str, onp.ToFloat], + data: _ToFloatOrND | None = None, ) -> tuple[ - list[_Scalar_f8], - Callable[[list[_Scalar_f8_co], _Arr_f8_co], _Scalar_f8], - Callable[[list[_Scalar_f8_co], _Arr_f8_co], list[_Scalar_f8]], - list[_Scalar_f8], + list[_Float], + Callable[[list[onp.ToFloat], _CoFloatND], _Float], + Callable[[list[onp.ToFloat], _CoFloatND], list[_Float]], + list[_Float], ]: ... - def _moment_error(self, /, theta: list[_Scalar_f8_co], x: _Arr_f8_co, data_moments: _Arr_f8_co[tuple[int]]) -> _Scalar_f8: ... - def _fit_loc_scale_support(self, /, data: _ArrLike_f8_co, *args: Any) -> _Tuple2[np.intp] | _Tuple2[_Scalar_f8]: ... - def fit_loc_scale(self, /, data: _ArrLike_f8_co, *args: _Scalar_f8_co) -> _Tuple2[_Scalar_f8]: ... + # + def _moment_error(self, /, theta: list[onp.ToFloat], x: _CoFloatND, data_moments: onp.ToFloat1D) -> _Float: ... + # + def _fit_loc_scale_support( + self, + /, + data: _ToFloatOrND, + *args: onp.ToFloat, + ) -> _Tuple2[np.intp] | _Tuple2[_Float]: ... + + # + def fit_loc_scale(self, /, data: _ToFloatOrND, *args: onp.ToFloat) -> _Tuple2[_Float]: ... + + # def fit( self, /, - data: _ArrLike_f8_co, - *args: _Scalar_f8_co, - optimizer: Callable[[_Arr_f8, tuple[_Scalar_f8, ...], tuple[_Scalar_f8, ...], bool], tuple[_Scalar_f8, ...]], + data: _ToFloatOrND, + *args: onp.ToFloat, + optimizer: Callable[[_FloatND, tuple[_Float, ...], tuple[_Float, ...], bool], tuple[_Float, ...]], method: _FitMethod = "MLE", - **kwds: _Scalar_f8_co, - ) -> tuple[_Scalar_f8, ...]: ... + **kwds: onp.ToFloat, + ) -> tuple[_Float, ...]: ... # def expect( self, /, - func: Callable[[float], _Scalar_f8] | None = None, - args: tuple[_Scalar_f8_co, ...] = (), - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - lb: _Scalar_f8_co | None = None, - ub: _Scalar_f8_co | None = None, + func: Callable[[float], _Float] | None = None, + args: tuple[onp.ToFloat, ...] = (), + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + lb: onp.ToFloat | None = None, + ub: onp.ToFloat | None = None, conditional: op.CanBool = False, **kwds: Unpack[_QuadOpts], - ) -> _Scalar_f8: ... + ) -> _Float: ... # @override - def rvs( # pyright: ignore[reportIncompatibleMethodOverride] + def rvs( self, /, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - size: spt.AnyShape = 1, - random_state: spt.ToRNG = None, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + size: AnyShape = 1, + random_state: ToRNG = None, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... class rv_discrete(_rv_mixin, rv_generic): inc: Final[int] @@ -763,261 +826,261 @@ class rv_discrete(_rv_mixin, rv_generic): def __new__( cls, - a: _Scalar_f8_co = 0, - b: _Scalar_f8_co = ..., - name: LiteralString | None = None, - badvalue: _Scalar_f8 | None = None, - moment_tol: _Scalar_f8 = 1e-08, - values: _Tuple2[_ArrLike_f8_co] | None = None, + a: onp.ToFloat = 0, + b: onp.ToFloat = ..., + name: str | None = None, + badvalue: _Float | None = None, + moment_tol: _Float = 1e-08, + values: _Tuple2[_ToFloatOrND] | None = None, inc: int | np.int_ = 1, - longname: LiteralString | None = None, - shapes: LiteralString | None = None, - seed: spt.ToRNG = None, + longname: str | None = None, + shapes: str | None = None, + seed: ToRNG = None, ) -> Self: ... def __init__( # pyright: ignore[reportInconsistentConstructor] self, /, - a: _Scalar_f8_co = 0, - b: _Scalar_f8_co = ..., - name: LiteralString | None = None, - badvalue: _Scalar_f8 | None = None, - moment_tol: _Scalar_f8 = 1e-08, + a: onp.ToFloat = 0, + b: onp.ToFloat = ..., + name: str | None = None, + badvalue: _Float | None = None, + moment_tol: _Float = 1e-08, values: None = None, inc: int | np.int_ = 1, - longname: LiteralString | None = None, - shapes: LiteralString | None = None, - seed: spt.ToRNG = None, + longname: str | None = None, + shapes: str | None = None, + seed: ToRNG = None, ) -> None: ... # # NOTE: Using `@override` on `__call__` or `freeze` causes stubtest to crash (mypy 1.11.1) @overload - def __call__(self, /) -> rv_discrete_frozen[Self, _Scalar_f8]: ... + def __call__(self, /) -> rv_discrete_frozen[Self, _Float]: ... @overload def __call__( self, /, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> rv_discrete_frozen[Self, _Scalar_f8]: ... + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> rv_discrete_frozen[Self, _Float]: ... @overload - def __call__(self, /, *args: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, **kwds: _ArrLike_f8_co) -> rv_discrete_frozen[Self]: ... + def __call__(self, /, *args: _ToFloatOrND, loc: _ToFloatOrND = 0, **kwds: _ToFloatOrND) -> rv_discrete_frozen[Self]: ... # @overload - def freeze(self, /) -> rv_discrete_frozen[Self, _Scalar_f8]: ... + def freeze(self, /) -> rv_discrete_frozen[Self, _Float]: ... @overload def freeze( self, /, - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> rv_discrete_frozen[Self, _Scalar_f8]: ... + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> rv_discrete_frozen[Self, _Float]: ... @overload - def freeze(self, /, *args: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, **kwds: _ArrLike_f8_co) -> rv_discrete_frozen[Self]: ... + def freeze(self, /, *args: _ToFloatOrND, loc: _ToFloatOrND = 0, **kwds: _ToFloatOrND) -> rv_discrete_frozen[Self]: ... # @overload - def pmf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def pmf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def pmf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def pmf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def logpmf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def logpmf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def logpmf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logpmf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def cdf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def cdf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def cdf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def cdf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def logcdf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def logcdf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def logcdf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logcdf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def sf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def sf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def sf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def sf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def logsf(self, /, k: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def logsf(self, /, k: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def logsf( self, /, - k: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + k: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def logsf( self, /, - k: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + k: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def ppf(self, /, q: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def ppf(self, /, q: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def ppf( self, /, - q: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + q: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def ppf( self, /, - q: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + q: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # @overload - def isf(self, /, q: _Scalar_f8_co, *args: _Scalar_f8_co, loc: _Scalar_f8_co = 0, **kwds: _Scalar_f8_co) -> _Scalar_f8: ... + def isf(self, /, q: onp.ToFloat, *args: onp.ToFloat, loc: onp.ToFloat = 0, **kwds: onp.ToFloat) -> _Float: ... @overload def isf( self, /, - q: _Arr_f8_co[_ShapeT], - *args: _Scalar_f8_co, - loc: _Scalar_f8_co = 0, - **kwds: _Scalar_f8_co, - ) -> _Arr_f8[_ShapeT]: ... + q: onp.Array[_ShapeT, _CoFloat], + *args: onp.ToFloat, + loc: onp.ToFloat = 0, + **kwds: onp.ToFloat, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload def isf( self, /, - q: _ArrLike_f8_co, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_f8: ... + q: _ToFloatOrND, + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + **kwds: _ToFloatOrND, + ) -> _FloatOrND: ... # def expect( self, /, - func: Callable[[onp.ArrayND[np.int_]], _Arr_f8_co] | None = None, - args: tuple[_Scalar_f8_co, ...] = (), - loc: _Scalar_f8_co = 0, + func: Callable[[onp.ArrayND[np.int_]], _CoFloatND] | None = None, + args: tuple[onp.ToFloat, ...] = (), + loc: onp.ToFloat = 0, lb: onp.ToInt | None = None, ub: onp.ToInt | None = None, conditional: op.CanBool = False, maxcount: onp.ToInt = 1000, - tolerance: _Scalar_f8_co = 1e-10, + tolerance: onp.ToFloat = 1e-10, chunksize: onp.ToInt = 32, - ) -> _Scalar_f8: ... + ) -> _Float: ... # @override - def rvs( # pyright: ignore[reportIncompatibleMethodOverride] + def rvs( self, /, - *args: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - size: spt.AnyShape = 1, - random_state: spt.ToRNG = None, - **kwds: _ArrLike_f8_co, - ) -> _ArrLike_i8: ... + *args: _ToFloatOrND, + loc: _ToFloatOrND = 0, + size: AnyShape = 1, + random_state: ToRNG = None, + **kwds: _ToFloatOrND, + ) -> _IntOrND: ... _XKT_co = TypeVar("_XKT_co", bound=np.number[Any], covariant=True, default=np.number[Any]) -_PKT_co = TypeVar("_PKT_co", bound=_Scalar_f, covariant=True, default=_Scalar_f) +_PKT_co = TypeVar("_PKT_co", bound=_Floating, covariant=True, default=_Floating) class rv_sample(rv_discrete, Generic[_XKT_co, _PKT_co]): xk: onp.Array1D[_XKT_co] @@ -1026,206 +1089,282 @@ class rv_sample(rv_discrete, Generic[_XKT_co, _PKT_co]): def __init__( # pyright: ignore[reportInconsistentConstructor] self, /, - a: _Scalar_f8_co = 0, - b: _Scalar_f8_co = ..., - name: LiteralString | None = None, + a: onp.ToFloat = 0, + b: onp.ToFloat = ..., + name: str | None = None, badvalue: float | None = None, moment_tol: float = 1e-08, - values: tuple[_ArrLike_f8_co, _ArrLike_f8_co] | None = None, + values: tuple[_ToFloatOrND, _ToFloatOrND] | None = None, inc: int = 1, - longname: LiteralString | None = None, - shapes: LiteralString | None = None, - seed: spt.ToRNG = None, + longname: str | None = None, + shapes: str | None = None, + seed: ToRNG = None, ) -> None: ... - def _entropy(self, /) -> _Scalar_f8: ... + def _entropy(self, /) -> _Float: ... vecentropy: Final = _entropy @override - def generic_moment(self, /, n: onp.ToInt | onp.ToIntND | int | Sequence[int]) -> _Arr_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def generic_moment(self, /, n: onp.ToInt | onp.ToIntND | int | Sequence[int]) -> _FloatND: ... -def get_distribution_names(namespace_pairs: Iterable[tuple[str, type]], rv_base_class: type) -> _Tuple2[list[LiteralString]]: ... +def get_distribution_names(namespace_pairs: Iterable[tuple[str, type]], rv_base_class: type) -> _Tuple2[list[str]]: ... # private helper subtypes @type_check_only class _rv_continuous_0(rv_continuous): # overrides of rv_generic - @override - @overload - def stats(self, /, loc: _Scalar_f8_co, scale: _Scalar_f8_co, moment: _Moments1) -> _Scalar_f8: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co, scale: _ArrLike_f8_co, moment: _Moments1) -> _ArrLike_f8: ... - @overload - def stats(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1, *, moment: _Moments1) -> _Scalar_f8: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1, *, moment: _Moments1) -> _ArrLike_f8: ... - @overload - def stats(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1, moment: _Moments2 = ...) -> _Tuple2[_Scalar_f8]: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1, moment: _Moments2 = ...) -> _Tuple2[_ArrLike_f8]: ... - @overload - def stats(self, /, loc: _Scalar_f8_co, scale: _Scalar_f8_co, moment: _Moments3) -> _Tuple3[_Scalar_f8]: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co, scale: _ArrLike_f8_co, moment: _Moments3) -> _Tuple3[_ArrLike_f8]: ... - @overload - def stats(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1, *, moment: _Moments3) -> _Tuple3[_Scalar_f8]: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1, *, moment: _Moments3) -> _Tuple3[_ArrLike_f8]: ... - @overload - def stats(self, /, loc: _Scalar_f8_co, scale: _Scalar_f8_co, moment: _Moments4) -> _Tuple4[_Scalar_f8]: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co, scale: _ArrLike_f8_co, moment: _Moments4) -> _Tuple4[_ArrLike_f8]: ... - @overload - def stats(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1, *, moment: _Moments4) -> _Tuple4[_Scalar_f8]: ... - @overload - def stats(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1, *, moment: _Moments4) -> _Tuple4[_ArrLike_f8]: ... # pyright: ignore[reportIncompatibleMethodOverride] + @overload # loc: 0-d, scale: 0-d, moments: 1 (positional) + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloat, moment: _Moment1) -> _Float: ... + @overload # loc: 0-d, scale: 0-d, moments: 1 (keyword) + def stats(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1, *, moment: _Moment1) -> _Float: ... + @overload # loc: 0-d, scale: 0-d, moments: 2 (default) + def stats(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1, moment: _Moment2 = "mv") -> _Tuple2[_Float]: ... + @overload # loc: 0-d, scale: 0-d, moments: 3 (positional) + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloat, moment: _Moment3) -> _Tuple3[_Float]: ... + @overload # loc: 0-d, scale: 0-d, moments: 3 (keyword) + def stats(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1, *, moment: _Moment3) -> _Tuple3[_Float]: ... + @overload # loc: 0-d, scale: 0-d, moments: 4 (positional) + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloat, moment: _Moment4) -> _Tuple4[_Float]: ... + @overload # loc: 0-d, scale: 0-d, moments: 4 (keyword) + def stats(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1, *, moment: _Moment4) -> _Tuple4[_Float]: ... + # + @overload # loc: 0-d, scale: n-d (positional), moments: 1 + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloatND, moment: _Moment1) -> _FloatND: ... + @overload # loc: 0-d, scale: n-d (positional), moments: 2 (default) + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloatND, moment: _Moment2 = "mv") -> _Tuple2[_FloatND]: ... + @overload # loc: 0-d, scale: n-d (positional), moments: 3 + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloatND, moment: _Moment3) -> _Tuple3[_FloatND]: ... + @overload # loc: 0-d, scale: n-d (positional), moments: 4 + def stats(self, /, loc: onp.ToFloat, scale: onp.ToFloatND, moment: _Moment4) -> _Tuple4[_FloatND]: ... + # + @overload # loc: 0-d, scale: n-d (keyword), moments: 1 + def stats(self, /, loc: onp.ToFloat = 0, *, scale: onp.ToFloatND, moment: _Moment1) -> _FloatND: ... + @overload # loc: 0-d, scale: n-d (keyword), moments: 2 (default) + def stats(self, /, loc: onp.ToFloat = 0, *, scale: onp.ToFloatND, moment: _Moment2 = "mv") -> _Tuple2[_FloatND]: ... + @overload # loc: 0-d, scale: n-d (keyword), moments: 3 + def stats(self, /, loc: onp.ToFloat = 0, *, scale: onp.ToFloatND, moment: _Moment3) -> _Tuple3[_FloatND]: ... + @overload # loc: 0-d, scale: n-d (keyword), moments: 4 + def stats(self, /, loc: onp.ToFloat = 0, *, scale: onp.ToFloatND, moment: _Moment4) -> _Tuple4[_FloatND]: ... + # + @overload # loc: n-d, scale: ?-d, moments: 1 (positional) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND, moment: _Moment1) -> _FloatND: ... + @overload # loc: n-d, scale: ?-d, moments: 1 (keyword) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND = 1, *, moment: _Moment1) -> _FloatND: ... + @overload # loc: n-d, scale: ?-d, moments: 2 (default) + def stats( + self, + /, + loc: onp.ToFloatND, + scale: _ToFloatOrND = 1, + moment: _Moment2 = "mv", + ) -> _Tuple2[_FloatND]: ... + @overload # loc: n-d, scale: ?-d, moments: 3 (positional) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND, moment: _Moment3) -> _Tuple3[_FloatND]: ... + @overload # loc: n-d, scale: ?-d, moments: 3 (keyword) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND = 1, *, moment: _Moment3) -> _Tuple3[_FloatND]: ... + @overload # loc: n-d, scale: ?-d, moments: 4 (positional) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND, moment: _Moment4) -> _Tuple4[_FloatND]: ... + @overload # loc: n-d, scale: ?-d, moments: 4 (keyword) + def stats(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND = 1, *, moment: _Moment4) -> _Tuple4[_FloatND]: ... # @override @overload - def entropy(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def entropy(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... + @overload + def entropy(self, /, loc: onp.ToFloat, scale: onp.ToFloatND) -> _FloatND: ... @overload - def entropy(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def entropy(self, /, loc: onp.ToFloat = 0, *, scale: onp.ToFloatND) -> _FloatND: ... + @overload + def entropy(self, /, loc: onp.ToFloatND, scale: _ToFloatOrND = 1) -> _FloatND: ... # @override @overload - def moment(self, /, order: int | _Scalar_i, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def moment(self, /, order: onp.ToInt, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def moment(self, /, order: int | _Scalar_i, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def moment(self, /, order: onp.ToInt, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def median(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def median(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def median(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def median(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def mean(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def mean(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def mean(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def mean(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def var(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def var(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def var(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def var(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def std(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def std(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def std(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def std(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def interval(self, /, confidence: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Tuple2[_Scalar_f8]: ... + def interval(self, /, confidence: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Tuple2[_Float]: ... @overload - def interval( # pyright: ignore[reportIncompatibleMethodOverride] + def interval( self, /, - confidence: _ArrLike_f8_co, - loc: _ArrLike_f8_co = 0, - scale: _ArrLike_f8_co = 1, - ) -> _Tuple2[_Scalar_f8] | _Tuple2[_Arr_f8]: ... + confidence: _ToFloatOrND, + loc: _ToFloatOrND = 0, + scale: _ToFloatOrND = 1, + ) -> _Tuple2[_Float] | _Tuple2[_FloatND]: ... # @override @overload - def support(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Tuple2[_Scalar_f8]: ... + def support(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Tuple2[_Float]: ... @overload - def support(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _Tuple2[_Scalar_f8] | _Tuple2[_Arr_f8]: ... # pyright: ignore[reportIncompatibleMethodOverride] + def support(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _Tuple2[_Float] | _Tuple2[_FloatND]: ... # overrides of rv_continuous @override @overload - def __call__(self, /) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def __call__(self, /) -> rv_continuous_frozen[Self, _Float]: ... @overload - def __call__(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def __call__(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> rv_continuous_frozen[Self, _Float]: ... @overload - def __call__(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> rv_continuous_frozen[Self]: ... # pyright: ignore[reportIncompatibleMethodOverride] + def __call__(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> rv_continuous_frozen[Self]: ... # @override @overload - def freeze(self, /) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def freeze(self, /) -> rv_continuous_frozen[Self, _Float]: ... @overload - def freeze(self, /, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> rv_continuous_frozen[Self, _Scalar_f8]: ... + def freeze(self, /, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> rv_continuous_frozen[Self, _Float]: ... @overload - def freeze(self, /, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> rv_continuous_frozen[Self]: ... # pyright: ignore[reportIncompatibleMethodOverride] + def freeze(self, /, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> rv_continuous_frozen[Self]: ... # @override @overload - def pdf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def pdf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def pdf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def pdf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def pdf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def pdf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def logpdf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def logpdf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def logpdf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def logpdf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def logpdf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def logpdf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def cdf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def cdf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def cdf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def cdf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def cdf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def cdf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def logcdf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def logcdf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def logcdf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def logcdf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def logcdf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def logcdf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def sf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def sf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def sf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def sf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def sf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def sf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def logsf(self, /, x: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def logsf(self, /, x: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def logsf(self, /, x: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def logsf( + self, + /, + x: onp.CanArrayND[_CoFloat, _ShapeT], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def logsf(self, /, x: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def logsf(self, /, x: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def ppf(self, /, q: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def ppf(self, /, q: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def ppf(self, /, q: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def ppf( + self, + /, + q: onp.Array[_ShapeT, _CoFloat], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def ppf(self, /, q: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def ppf(self, /, q: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override @overload - def isf(self, /, q: _Scalar_f8_co, loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Scalar_f8: ... + def isf(self, /, q: onp.ToFloat, loc: onp.ToFloat = 0, scale: onp.ToFloat = 1) -> _Float: ... @overload - def isf(self, /, q: _Arr_f8_co[_ShapeT], loc: _Scalar_f8_co = 0, scale: _Scalar_f8_co = 1) -> _Arr_f8[_ShapeT]: ... + def isf( + self, + /, + q: onp.Array[_ShapeT, _CoFloat], + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + ) -> onp.Array[_ShapeT, np.float64]: ... @overload - def isf(self, /, q: _ArrLike_f8_co, loc: _ArrLike_f8_co = 0, scale: _ArrLike_f8_co = 1) -> _ArrLike_f8: ... # pyright: ignore[reportIncompatibleMethodOverride] + def isf(self, /, q: _ToFloatOrND, loc: _ToFloatOrND = 0, scale: _ToFloatOrND = 1) -> _FloatOrND: ... # @override - def rvs( # pyright: ignore[reportIncompatibleMethodOverride] + def rvs( self, /, - loc: _Scalar_f8_co = 0, - scale: _Scalar_f8_co = 1, - size: spt.AnyShape = 1, - random_state: spt.ToRNG = None, - ) -> _ArrLike_f8: ... + loc: onp.ToFloat = 0, + scale: onp.ToFloat = 1, + size: AnyShape = 1, + random_state: ToRNG = None, + ) -> _FloatOrND: ... diff --git a/tests/linalg/test_special_matrices.pyi b/tests/linalg/test_special_matrices.pyi index 13577354..20fa0c8b 100644 --- a/tests/linalg/test_special_matrices.pyi +++ b/tests/linalg/test_special_matrices.pyi @@ -6,7 +6,7 @@ from scipy.linalg import kron, toeplitz arr_f8_1d: onp.Array1D[np.float64] arr_f8_2d: onp.Array2D[np.float64] -arr_f8_nd: onp.ArrayND[np.float64] +arr_f8_nd: onp.Array[tuple[int, ...], np.float64] ### # kron diff --git a/uv.lock b/uv.lock index 79f7a161..571dfbd3 100644 --- a/uv.lock +++ b/uv.lock @@ -349,14 +349,14 @@ wheels = [ [[package]] name = "optype" -version = "0.7.3" +version = "0.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/08/b7/3053b7d8b648b077422cfd7235f83909b6b192c2fa42bb9dba51cdc773bf/optype-0.7.3.tar.gz", hash = "sha256:51c8dd104ac197457059bcee5e256160a641ca72c6c852012d952790a5e0cac0", size = 80608 } +sdist = { url = "https://files.pythonhosted.org/packages/89/42/543e02c72aba7ebe78adb76bbfbed1bc1314eba633ad453984948e5a5f46/optype-0.8.0.tar.gz", hash = "sha256:8cbfd452d6f06c7c70502048f38a0d5451bc601054d3a577dd09c7d6363950e1", size = 85295 } wheels = [ - { url = "https://files.pythonhosted.org/packages/2b/92/466c23b21b341d062f33be00a307b1581b90ca86b07f27a4a71ecbec830b/optype-0.7.3-py3-none-any.whl", hash = "sha256:856416484131038799e0e9cefc19d0ef37e7b4fde2144f25e8bb0e8981ebbe95", size = 70043 }, + { url = "https://files.pythonhosted.org/packages/86/ff/604be975eb0e9fd02358cdacf496f4411db97bffc27279ce260e8f50aba4/optype-0.8.0-py3-none-any.whl", hash = "sha256:90a7760177f2e7feae379a60445fceec37b932b75a00c3d96067497573c5e84d", size = 74228 }, ] [[package]] @@ -444,16 +444,16 @@ wheels = [ [[package]] name = "poethepoet" -version = "0.31.1" +version = "0.32.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pastel" }, { name = "pyyaml" }, { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8f/96/15bce512c8027696b20586b18ac4b239afe8d312dbaa2a0099e8fb8f8424/poethepoet-0.31.1.tar.gz", hash = "sha256:d6b66074edf85daf115bb916eae0afd6387d19e1562e1c9ef7d61d5c585696aa", size = 61520 } +sdist = { url = "https://files.pythonhosted.org/packages/8a/f6/1692a42cf426494d89dbc693ba55ebd653bd2e84bbb6b3da4127b87956df/poethepoet-0.32.0.tar.gz", hash = "sha256:a700be02e932e1a8907ae630928fc769ea9a77986189ba6867e6e3fd8f60e5b7", size = 62962 } wheels = [ - { url = "https://files.pythonhosted.org/packages/06/e1/04f56c9d848d6135ca3328c5a2ca84d3303c358ad7828db290385e36a8cc/poethepoet-0.31.1-py3-none-any.whl", hash = "sha256:7fdfa0ac6074be9936723e7231b5bfaad2923e96c674a9857e81d326cf8ccdc2", size = 80238 }, + { url = "https://files.pythonhosted.org/packages/27/12/2994011e33d37772228439fe215fc022ff180b161ab7bd8ea5ac92717556/poethepoet-0.32.0-py3-none-any.whl", hash = "sha256:fba84c72d923feac228d1ea7734c5a54701f2e71fad42845f027c0fbf998a073", size = 81717 }, ] [[package]] @@ -724,7 +724,7 @@ typecheck = [ [package.metadata] requires-dist = [ - { name = "optype", specifier = ">=0.7.3" }, + { name = "optype", specifier = ">=0.8.0" }, { name = "scipy", marker = "extra == 'scipy'", specifier = ">=1.15.0rc2,<1.16" }, ] @@ -739,7 +739,7 @@ dev = [ { name = "mdformat-gfm", specifier = ">=0.4.1" }, { name = "mdformat-gfm-alerts", specifier = ">=1.0.1" }, { name = "packaging", specifier = ">=24.2" }, - { name = "poethepoet", specifier = ">=0.31.1,<1" }, + { name = "poethepoet", specifier = ">=0.32.0,<1" }, { name = "pre-commit", specifier = ">=4.0.1,<5" }, { name = "pre-commit-uv", specifier = ">=4.1.4,<5" }, { name = "ruff", specifier = ">=0.8.4" }, @@ -837,26 +837,26 @@ wheels = [ [[package]] name = "uv" -version = "0.5.11" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c8/28/3000f4e3331a7ad3e9c842268110d6cd1686c12a4e3f44df12fffbc39931/uv-0.5.11.tar.gz", hash = "sha256:6094ca4c5f917d58f884011416bb15066e222ef8d0494f26b0156ac97ad6810b", size = 2527307 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/27/a0/be21638a31d0fde51ebf027a040893962f5d69615c10bbcb2808baa8d58f/uv-0.5.11-py3-none-linux_armv6l.whl", hash = "sha256:736c9b8c86b18eb4dded22cd0f61cc0302bf387de860806c6700b561a4bb95f9", size = 14509010 }, - { url = "https://files.pythonhosted.org/packages/f0/2f/becf81ef79a2a38d5c30ac5554062081731765069ae2164858b252f03cbc/uv-0.5.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:164e068ebdf1177c8863c870bb68e411105b44d53cd91e3b9d8f5fd9202420d8", size = 14440761 }, - { url = "https://files.pythonhosted.org/packages/33/8e/287acf621210c1c2d81c3dc5616ef56471e589d3879f9b26fbc135df85d8/uv-0.5.11-py3-none-macosx_11_0_arm64.whl", hash = "sha256:bac233c1e3ae343d0904f78e4a18ca0b479d304aa8de2175df9d72b76dd7764e", size = 13382438 }, - { url = "https://files.pythonhosted.org/packages/55/41/8a2fb89de0341586d2988e0874b6610278200e48b52f10f29f0ec144d507/uv-0.5.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:1fe74893f77f343a43bcfaee2600b63f99a26a82568cfe16d0d1b5a77d9b033f", size = 13681092 }, - { url = "https://files.pythonhosted.org/packages/7a/85/553f32ea6640a534081d8f46a1575a107d9b3e79d0b8758e94406f3c7400/uv-0.5.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7d1e78c010cf112ddd02d704579e6501c3104a34c944c01f618fc417d6fd55a8", size = 14285797 }, - { url = "https://files.pythonhosted.org/packages/65/dc/2b018f459628c43bd34b72feba515d18ba576a87819e5914d48c05a1e07f/uv-0.5.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9c2d455db44cc5de70e359e88da9659397f52e78190a9a8922defdee7ed26787", size = 14962196 }, - { url = "https://files.pythonhosted.org/packages/d7/34/8d740eaa1768ab196b1b03854a51df963b1207cb266a83f4f505edc7c36d/uv-0.5.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:cefa3ec37f83acdcb4b067ef09622a78e56a22fc6376f5705cd64435bc9bc280", size = 15478207 }, - { url = "https://files.pythonhosted.org/packages/8e/02/d20701859a3c82a20120942b87cf3bc54af162b62a2660d3ca942268c64e/uv-0.5.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:914dd829808e5d65bf261cbfbb8a01ee80f7d90bc8c9e54f2fc5aa2501f5eec1", size = 15229713 }, - { url = "https://files.pythonhosted.org/packages/98/51/10834427c3f7d3600e8a955ab69d8c85acba9ad3d5c77f05cd63dc212140/uv-0.5.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1f6a7d727e86deb67d0a4df669de8c03033cd19ed23d27c7113abd7cb0b9bd7", size = 19847854 }, - { url = "https://files.pythonhosted.org/packages/9b/97/13a5a464529148f79f2aa2877bc0033357c5f9fb42c72b3cb4a2a66641f3/uv-0.5.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08c660c69e7dd874b52ad96b597b57e9f999659f3d9827cdbad884a68e48f7e9", size = 14974091 }, - { url = "https://files.pythonhosted.org/packages/88/65/b18bcff24029615075bf9987b3249befdfbc858ef9711b56844239117992/uv-0.5.11-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:d24d4e816010b692d1180b69eb8aef1d16657a43b5e2edab8be71a2e700ccf9f", size = 13911399 }, - { url = "https://files.pythonhosted.org/packages/e9/dc/ac5da28965b6cc6ef9eb34f8617f94577bfe7345b14c90fb54efae0905e7/uv-0.5.11-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:a2461a563e28b75cc3b396ed910feecac9518a90c49ac312b1a9da77bae10911", size = 14247167 }, - { url = "https://files.pythonhosted.org/packages/ec/5d/fd9b447f1f3e40d3b4c5ad404e0bf29ab8126ddf8ded128c440fff6cb295/uv-0.5.11-py3-none-musllinux_1_1_i686.whl", hash = "sha256:7d2571f175ded2631220c4586e3e14e93952db4a681d0ca094e6cc4124001a83", size = 14629087 }, - { url = "https://files.pythonhosted.org/packages/06/1b/dbf2473888d41f553d37ccb811a2645fe85386e19799eb2b35e4ba8519c6/uv-0.5.11-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:398eb87ef23b0cd25a8bfcc0dddf0d360d92aba03f660962f447a6585ced440b", size = 15126094 }, - { url = "https://files.pythonhosted.org/packages/81/4f/d533c3975ae295a3a4528ec5022cf49162200e1721a9d0ed110369099560/uv-0.5.11-py3-none-win32.whl", hash = "sha256:4bd0c2868dde8ddef89b9e33a85913e450bb71b834f6d73b525e450e840639c8", size = 14383230 }, - { url = "https://files.pythonhosted.org/packages/45/83/a1f73ef111979d6e16b717a9333af2962434a9ea47122836840cdc80d31e/uv-0.5.11-py3-none-win_amd64.whl", hash = "sha256:48a3bcbc480d5f922145cd2c68182dcb11effa3ca9f5a9ae9b2f6ce21f9ade32", size = 16204754 }, +version = "0.5.13" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a4/09/dc3b7beb8abc663c962320eff9862e5c718383bd6e03e9490da5621f77c5/uv-0.5.13.tar.gz", hash = "sha256:58a66786f2e95c89539bafd819cf2959f56199457301eac8faa920c1872c4f36", size = 2555484 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/52/bf/142c1aefdb0cdb1200d8fd2193073d3b4b28028a7cacbce3fcaafe5fd9bf/uv-0.5.13-py3-none-linux_armv6l.whl", hash = "sha256:45301cb355fc0525e692d220ea7cb196e8378a53162b27d6eea6e65c7635ed3d", size = 14408033 }, + { url = "https://files.pythonhosted.org/packages/a0/3e/dc408e34fbb6e7bb5d1462dfeb765074c7951d400e31ba31c9b21ac46250/uv-0.5.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ff96602b7d391f35dc25122c2661e680a9e94864e96801611ef05c853826c82c", size = 14406050 }, + { url = "https://files.pythonhosted.org/packages/04/da/2e8cd58fb76c213a03c2fb556ad0858a6e585cd6e4b5f0e531ac81f113a8/uv-0.5.13-py3-none-macosx_11_0_arm64.whl", hash = "sha256:941c13f15a8726a2f5ad3fffa0bbe98e221c98fbe73adbca62cf327bd3fb029c", size = 13370750 }, + { url = "https://files.pythonhosted.org/packages/92/f1/4a0c9c1dbf6a237bd48fca67b9732e2d33e05536e2f54e8290c90e552ebc/uv-0.5.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:642d7e62c376487a63a03fb830749fb24dd7653f715864df2fb8788f29dfb85e", size = 13646567 }, + { url = "https://files.pythonhosted.org/packages/83/41/c39977fdc5eb6c2060a7705963460a0214452ee8d3f79bb8b96b3bbdaca2/uv-0.5.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5aab53db952f7f4505cfc2f62ecedb4a7977d746622f67cbadf052bef0d916e", size = 14172837 }, + { url = "https://files.pythonhosted.org/packages/d2/21/0823f2ac33febb103dfc51e0aa43c4540375b29689dfc846a897b1d704cb/uv-0.5.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f57250f46914affab4e4ca50822f1fbc7910df01818a22b7d91d4f5ccc5eb80c", size = 14907424 }, + { url = "https://files.pythonhosted.org/packages/82/51/04ed1d8e5cac1f3f26f20c9cb0202b1fad0bb3fb1c8c0ba320f82eb0b205/uv-0.5.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6fb26d2b6d4b6467b98acc22b67bbdd16360a1b843842d7cd77ff4df70884567", size = 15497699 }, + { url = "https://files.pythonhosted.org/packages/f7/b9/dd859a72bfde9c2daa7f64ebad699e4e75fda1e45dcf6ac8026f88296b55/uv-0.5.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:414dd7083bd7e06ab2db0ee6cfe81b0810c416e79ff1643701e15e2df5e1db2b", size = 15225898 }, + { url = "https://files.pythonhosted.org/packages/c0/bd/faed9861a27b9a24c0e93b5c18fbf0f4cc7a88e46bf15ad0fa03ffc7fb98/uv-0.5.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01fc5e928efba822ff28007f827c3c274b644508253fe358ec79085bae1da0c9", size = 19963452 }, + { url = "https://files.pythonhosted.org/packages/a7/64/00896d517e95621aa10e7a19dc6de636edab73f80b5e6ff4df73188731be/uv-0.5.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82479440765e507af1f2732bd496ec6ed849488f5ce310b8556cfe8c12da1c5f", size = 14970047 }, + { url = "https://files.pythonhosted.org/packages/d0/8f/f62f7fe20b7ead1e2afbe050932e698eb5ce6c2649fe49c2d2f96dc5fcba/uv-0.5.13-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:18f2141e71f6cb4c0ab44f1a100838d336f14c1d7a1c62444c79c2c2554331be", size = 13854500 }, + { url = "https://files.pythonhosted.org/packages/52/2b/efef56357acb6a63aab425f03c8d819eef7cd261a34bf8b6f64bc86a82d2/uv-0.5.13-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:4c2e75845c9c5adae3e8274967f70023b740488d732f88100baeef70090b60a0", size = 14178985 }, + { url = "https://files.pythonhosted.org/packages/e3/83/394d65c16d058eda1179c05418c68289f983aab2c278d06ea273e3e6299a/uv-0.5.13-py3-none-musllinux_1_1_i686.whl", hash = "sha256:6de38097d5efa86ae62a71ff268e16f7eab86f4afa63c32b546cb7f5a182874f", size = 14552142 }, + { url = "https://files.pythonhosted.org/packages/4b/6e/712477a76954f64bb6f0391c9dd1081e41c97d1f653c92688b1618e7fcdc/uv-0.5.13-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:30440409a28f1d5d34af8839a48ba9c26da06fc295f363ba9b12689b796453d4", size = 15088698 }, + { url = "https://files.pythonhosted.org/packages/7d/b6/a06fa33db44426275ab0ba87dc4a4e770acfab0897ee212a6ff4d3423e1d/uv-0.5.13-py3-none-win32.whl", hash = "sha256:df2a751e8319e11ef2d8bec30d549ee13949027aaa936ab2a0ab126602f4232b", size = 14459272 }, + { url = "https://files.pythonhosted.org/packages/a5/c8/b3bdc883e4ca0612ddd9f956d116308742f12d9140361dba6b2fcf66294d/uv-0.5.13-py3-none-win_amd64.whl", hash = "sha256:4219f1ed370bb2cec5f10dcc93fa9ecf5615fa67e0b71eef4817d571291f0bfc", size = 16315884 }, ] [[package]]