From 5fcda25ecbf8c44f93b7527d5729e1c8107a353f Mon Sep 17 00:00:00 2001 From: jorenham Date: Thu, 28 Nov 2024 21:23:07 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A8=20codemod=20to=20ensure=20`sel?= =?UTF-8?q?f`=20is=20pos-only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codegen/README.md | 1 + codegen/mods.py | 50 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/codegen/README.md b/codegen/README.md index 51fdb436..0e6235c5 100644 --- a/codegen/README.md +++ b/codegen/README.md @@ -10,6 +10,7 @@ where `$NAME` is the name is the name of the codemod, which can be one of: - `AnnotateMissing` - Sets the default return type to `None`, and sets the other missing annotations to `scipy._typing.Untyped`. - `FixTrailingComma` - Adds a trailing comma to parameters that don't fit on one line, so that ruff formats them correctly. +- `PosOnlySelf` - nsures `self` is a positional-only parameter. > [!NOTE] > The codemods require `libcst`, which is installable through the **optional** `codegen` dependency group: diff --git a/codegen/mods.py b/codegen/mods.py index a9e38245..a3258efc 100644 --- a/codegen/mods.py +++ b/codegen/mods.py @@ -46,7 +46,7 @@ def __init__(self, /, context: CodemodContext) -> None: super().__init__(context) @override - def leave_Module(self, original_node: cst.Module, updated_node: cst.Module) -> cst.Module: + def leave_Module(self, /, original_node: cst.Module, updated_node: cst.Module) -> cst.Module: if not self.updated: raise SkipFile("unchanged") @@ -100,7 +100,7 @@ class FixTrailingComma(_BaseMod): DESCRIPTION = "Adds a trailing comma to parameters that don't fit on one line, so that ruff formats them correctly." @override - def leave_FunctionDef(self, original_node: cst.FunctionDef, updated_node: cst.FunctionDef) -> cst.FunctionDef: + def leave_FunctionDef(self, /, original_node: cst.FunctionDef, updated_node: cst.FunctionDef) -> cst.FunctionDef: params = updated_node.params.params if ( @@ -119,3 +119,49 @@ def leave_FunctionDef(self, original_node: cst.FunctionDef, updated_node: cst.Fu return updated_node.with_deep_changes(params[-1], comma=cst.Comma()) return updated_node + + +@final +class PosOnlySelf(_BaseMod): + DESCRIPTION = "Ensures `self` is a positional-only parameter." + + class_depth: int + + @override + def __init__(self, /, context: CodemodContext) -> None: + self.class_depth = 0 + super().__init__(context) + + @override + def visit_ClassDef(self, node: cst.ClassDef) -> bool | None: + self.class_depth += 1 + return super().visit_ClassDef(node) + + @override + def leave_ClassDef(self, original_node: cst.ClassDef, updated_node: cst.ClassDef) -> cst.ClassDef: + self.class_depth -= 1 + return updated_node + + @override + def leave_FunctionDef(self, /, original_node: cst.FunctionDef, updated_node: cst.FunctionDef) -> cst.FunctionDef: + params = updated_node.params + if not self.class_depth or params.posonly_params or not params.params: + return updated_node + + decorators = {get_full_name_for_node(d.decorator) for d in updated_node.decorators} + if "staticmethod" in decorators or "classmethod" in decorators: + return updated_node + + # TODO(jorenham): pos-only `@property` setter value parameters + + self_param = params.params[0] + if self_param.name.value != "self": + return updated_node + + self.updated += 1 + return updated_node.with_changes( + params=params.with_changes( + params=params.params[1:], + posonly_params=(self_param,), + ) + ) From 32294fa99a8baa1a7cd3c2ff4b41dfe4084780d4 Mon Sep 17 00:00:00 2001 From: jorenham Date: Thu, 28 Nov 2024 21:25:52 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20`poe=20codemod=20PosOn?= =?UTF-8?q?lySelf=20--=20--no-format`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scipy-stubs/_lib/_ccallback.pyi | 2 +- scipy-stubs/_lib/_docscrape.pyi | 22 ++-- scipy-stubs/_lib/_testutils.pyi | 14 +-- scipy-stubs/_typing.pyi | 10 +- scipy-stubs/integrate/_ivp/base.pyi | 8 +- scipy-stubs/interpolate/_bsplines.pyi | 14 +-- scipy-stubs/interpolate/_cubic.pyi | 9 +- scipy-stubs/interpolate/_fitpack2.pyi | 51 ++++++--- scipy-stubs/interpolate/_interpolate.pyi | 2 +- scipy-stubs/interpolate/_ndbspline.pyi | 4 +- scipy-stubs/interpolate/_polyint.pyi | 15 +-- scipy-stubs/interpolate/_rbf.pyi | 6 +- scipy-stubs/interpolate/_rbfinterp.pyi | 3 +- scipy-stubs/interpolate/_rgi.pyi | 3 +- scipy-stubs/interpolate/fitpack.pyi | 14 +-- scipy-stubs/interpolate/fitpack2.pyi | 40 ++++--- scipy-stubs/interpolate/polyint.pyi | 12 +- scipy-stubs/interpolate/rbf.pyi | 6 +- scipy-stubs/io/matlab/mio5_params.pyi | 2 +- scipy-stubs/odr/_odrpack.pyi | 2 +- scipy-stubs/optimize/_dcsrch.pyi | 2 + .../optimize/_differentialevolution.pyi | 27 ++--- scipy-stubs/optimize/_dual_annealing.pyi | 29 ++--- scipy-stubs/optimize/_lbfgsb_py.pyi | 4 +- scipy-stubs/optimize/_shgo.pyi | 59 +++++----- scipy-stubs/optimize/_trlib/_trlib.pyi | 2 +- scipy-stubs/optimize/_trustregion.pyi | 17 +-- scipy-stubs/optimize/_trustregion_dogleg.pyi | 6 +- scipy-stubs/optimize/_trustregion_exact.pyi | 3 +- scipy-stubs/optimize/_trustregion_ncg.pyi | 2 +- scipy-stubs/optimize/lbfgsb.pyi | 4 +- scipy-stubs/optimize/nonlin.pyi | 28 ++--- scipy-stubs/signal/_czt.pyi | 7 +- scipy-stubs/signal/_ltisys.pyi | 108 +++++++++--------- scipy-stubs/signal/_short_time_fft.pyi | 76 ++++++------ scipy-stubs/signal/_upfirdn.pyi | 1 + scipy-stubs/signal/ltisys.pyi | 106 ++++++++--------- scipy-stubs/signal/signaltools.pyi | 16 +-- scipy-stubs/sparse/_base.pyi | 78 ++++++------- scipy-stubs/sparse/_bsr.pyi | 3 +- scipy-stubs/sparse/_compressed.pyi | 29 ++--- scipy-stubs/sparse/_coo.pyi | 15 +-- scipy-stubs/sparse/_csr.pyi | 2 +- scipy-stubs/sparse/_data.pyi | 12 +- scipy-stubs/sparse/_dia.pyi | 5 +- scipy-stubs/sparse/_dok.pyi | 14 ++- scipy-stubs/sparse/_lil.pyi | 9 +- scipy-stubs/sparse/_matrix.pyi | 20 ++-- scipy-stubs/sparse/base.pyi | 20 ++-- scipy-stubs/sparse/bsr.pyi | 20 ++-- scipy-stubs/sparse/coo.pyi | 20 ++-- scipy-stubs/sparse/csc.pyi | 20 ++-- scipy-stubs/sparse/csr.pyi | 20 ++-- scipy-stubs/sparse/dia.pyi | 20 ++-- scipy-stubs/sparse/dok.pyi | 37 +++--- scipy-stubs/sparse/lil.pyi | 7 +- .../sparse/linalg/_eigen/arpack/arpack.pyi | 12 +- scipy-stubs/sparse/linalg/_expm_multiply.pyi | 10 +- scipy-stubs/sparse/linalg/_interface.pyi | 20 ++-- scipy-stubs/sparse/linalg/_matfuncs.pyi | 42 +++---- .../sparse/linalg/_special_sparse_arrays.pyi | 40 +++---- scipy-stubs/sparse/linalg/eigen.pyi | 4 +- scipy-stubs/sparse/linalg/interface.pyi | 6 +- scipy-stubs/sparse/linalg/matfuncs.pyi | 6 +- scipy-stubs/spatial/_ckdtree.pyi | 40 +++---- scipy-stubs/spatial/transform/_rotation.pyi | 41 ++++--- .../spatial/transform/_rotation_spline.pyi | 4 +- scipy-stubs/spatial/transform/rotation.pyi | 41 +++---- scipy-stubs/special/_orthogonal.pyi | 7 +- scipy-stubs/special/_ufuncs.pyi | 72 ++++++------ scipy-stubs/stats/_binomtest.pyi | 3 +- scipy-stubs/stats/_censored_data.pyi | 5 +- scipy-stubs/stats/_continuous_distns.pyi | 1 + scipy-stubs/stats/_fit.pyi | 4 +- scipy-stubs/stats/_hypotests.pyi | 2 +- scipy-stubs/stats/_kde.pyi | 6 +- scipy-stubs/stats/_levy_stable/levyst.pyi | 2 +- scipy-stubs/stats/_morestats.pyi | 26 ++--- scipy-stubs/stats/_multivariate.pyi | 2 +- scipy-stubs/stats/_odds_ratio.pyi | 4 +- scipy-stubs/stats/_sensitivity_analysis.pyi | 4 +- scipy-stubs/stats/_stats_py.pyi | 2 +- scipy-stubs/stats/_unuran/unuran_wrapper.pyi | 54 +++++---- 83 files changed, 810 insertions(+), 737 deletions(-) diff --git a/scipy-stubs/_lib/_ccallback.pyi b/scipy-stubs/_lib/_ccallback.pyi index e5895ea3..9e1f60e4 100644 --- a/scipy-stubs/_lib/_ccallback.pyi +++ b/scipy-stubs/_lib/_ccallback.pyi @@ -41,7 +41,7 @@ class _CFFIType(Protocol): def is_integer_type(self, /) -> bool: ... def has_c_name(self, /) -> bool: ... def get_c_name(self, /, replace_with: str = "", context: str = "a C file", quals: int = 0) -> str: ... - def get_cached_btype(self, ffi: object, finishlist: list[object], can_delay: bool = False) -> _CFFIBackendType: ... + def get_cached_btype(self, /, ffi: object, finishlist: list[object], can_delay: bool = False) -> _CFFIBackendType: ... # virtual def build_backend_type(self, /, ffi: object, finishlist: list[object]) -> _CFFIBackendType: ... diff --git a/scipy-stubs/_lib/_docscrape.pyi b/scipy-stubs/_lib/_docscrape.pyi index 6f69bf9f..7a07ce07 100644 --- a/scipy-stubs/_lib/_docscrape.pyi +++ b/scipy-stubs/_lib/_docscrape.pyi @@ -17,15 +17,15 @@ class Parameter(NamedTuple): class Reader: def __init__(self, /, data: str | list[str]) -> None: ... def __getitem__(self, n: op.CanIndex, /) -> str: ... - def reset(self) -> None: ... - def read(self) -> str: ... - def seek_next_non_empty_line(self) -> None: ... - def eof(self) -> bool: ... - def read_to_condition(self, condition_func: Callable[[str], object]) -> list[str]: ... - def read_to_next_empty_line(self) -> list[str]: ... - def read_to_next_unindented_line(self) -> list[str]: ... - def peek(self, n: int = 0) -> str: ... - def is_empty(self) -> bool: ... + def reset(self, /) -> None: ... + def read(self, /) -> str: ... + def seek_next_non_empty_line(self, /) -> None: ... + def eof(self, /) -> bool: ... + def read_to_condition(self, /, condition_func: Callable[[str], object]) -> list[str]: ... + def read_to_next_empty_line(self, /) -> list[str]: ... + def read_to_next_unindented_line(self, /) -> list[str]: ... + def peek(self, /, n: int = 0) -> str: ... + def is_empty(self, /) -> bool: ... class NumpyDocString(Mapping[str, _SectionValue]): empty_description: ClassVar[str] = ".." @@ -58,9 +58,9 @@ class ClassDoc(NumpyDocString): extra_public_methods: ClassVar[Sequence[str]] show_inherited_members: Final[bool] @property - def methods(self) -> list[str]: ... + def methods(self, /) -> list[str]: ... @property - def properties(self) -> list[str]: ... + def properties(self, /) -> list[str]: ... def __init__( self, /, diff --git a/scipy-stubs/_lib/_testutils.pyi b/scipy-stubs/_lib/_testutils.pyi index f95f7a00..81fcd3c7 100644 --- a/scipy-stubs/_lib/_testutils.pyi +++ b/scipy-stubs/_lib/_testutils.pyi @@ -33,12 +33,12 @@ class _TestPythranFunc: arguments: dict[int, tuple[onp.Array, list[np.generic]]] partialfunc: Callable[..., object] | None expected: object | None - def setup_method(self) -> None: ... - def get_optional_args(self, func: Callable[..., object]) -> dict[str, object]: ... - def get_max_dtype_list_length(self) -> int: ... - def get_dtype(self, dtype_list: Sequence[np.generic], dtype_idx: int) -> np.generic: ... - def test_all_dtypes(self) -> None: ... - def test_views(self) -> None: ... - def test_strided(self) -> None: ... + def setup_method(self, /) -> None: ... + def get_optional_args(self, /, func: Callable[..., object]) -> dict[str, object]: ... + def get_max_dtype_list_length(self, /) -> int: ... + def get_dtype(self, /, dtype_list: Sequence[np.generic], dtype_idx: int) -> np.generic: ... + def test_all_dtypes(self, /) -> None: ... + def test_views(self, /) -> None: ... + def test_strided(self, /) -> None: ... def check_free_memory(free_mb: float) -> None: ... diff --git a/scipy-stubs/_typing.pyi b/scipy-stubs/_typing.pyi index 17a2b14c..3c933602 100644 --- a/scipy-stubs/_typing.pyi +++ b/scipy-stubs/_typing.pyi @@ -86,13 +86,13 @@ NormalizationMode: TypeAlias = Literal["backward", "ortho", "forward"] @type_check_only class _FortranFunction(Protocol): @property - def dtype(self) -> np.dtype[np.number[Any]]: ... + def dtype(self, /) -> np.dtype[np.number[Any]]: ... @property - def int_dtype(self) -> np.dtype[np.integer[Any]]: ... + def int_dtype(self, /) -> np.dtype[np.integer[Any]]: ... @property - def module_name(self) -> LiteralString: ... + def module_name(self, /) -> LiteralString: ... @property - def prefix(self) -> LiteralString: ... + def prefix(self, /) -> LiteralString: ... @property - def typecode(self) -> LiteralString: ... + def typecode(self, /) -> LiteralString: ... def __call__(self, /, *args: object, **kwargs: object) -> object: ... diff --git a/scipy-stubs/integrate/_ivp/base.pyi b/scipy-stubs/integrate/_ivp/base.pyi index fa4d9196..52e24318 100644 --- a/scipy-stubs/integrate/_ivp/base.pyi +++ b/scipy-stubs/integrate/_ivp/base.pyi @@ -26,6 +26,7 @@ class OdeSolver: @overload def __init__( self, + /, fun: Callable[[float, onp.ArrayND[np.float64]], onp.ToFloatND], t0: onp.ToFloatND, y0: onp.ToFloatND, @@ -36,6 +37,7 @@ class OdeSolver: @overload def __init__( self, + /, fun: Callable[[float, onp.ArrayND[np.float64 | np.complex128]], onp.ToComplexND], t0: onp.ToFloat, y0: onp.ToComplexND, @@ -44,9 +46,9 @@ class OdeSolver: support_complex: Literal[True], ) -> None: ... @property - def step_size(self) -> float | None: ... - def step(self) -> str | None: ... - def dense_output(self) -> ConstantDenseOutput: ... + def step_size(self, /) -> float | None: ... + def step(self, /) -> str | None: ... + def dense_output(self, /) -> ConstantDenseOutput: ... class DenseOutput: t_old: Final[float] diff --git a/scipy-stubs/interpolate/_bsplines.pyi b/scipy-stubs/interpolate/_bsplines.pyi index 62fd8e3a..b0d35ada 100644 --- a/scipy-stubs/interpolate/_bsplines.pyi +++ b/scipy-stubs/interpolate/_bsplines.pyi @@ -9,13 +9,13 @@ class BSpline: extrapolate: Untyped axis: Untyped @property - def tck(self) -> Untyped: ... - def __init__(self, t: Untyped, c: Untyped, k: Untyped, extrapolate: bool = True, axis: int = 0) -> None: ... - def __call__(self, x: Untyped, nu: int = 0, extrapolate: Untyped | None = None) -> Untyped: ... - def derivative(self, nu: int = 1) -> Untyped: ... - def antiderivative(self, nu: int = 1) -> Untyped: ... - def integrate(self, a: Untyped, b: Untyped, extrapolate: Untyped | None = None) -> Untyped: ... - def insert_knot(self, x: Untyped, m: int = 1) -> Untyped: ... + def tck(self, /) -> Untyped: ... + def __init__(self, /, t: Untyped, c: Untyped, k: Untyped, extrapolate: bool = True, axis: int = 0) -> None: ... + def __call__(self, /, x: Untyped, nu: int = 0, extrapolate: Untyped | None = None) -> Untyped: ... + def derivative(self, /, nu: int = 1) -> Untyped: ... + def antiderivative(self, /, nu: int = 1) -> Untyped: ... + def integrate(self, /, a: Untyped, b: Untyped, extrapolate: Untyped | None = None) -> Untyped: ... + def insert_knot(self, /, x: Untyped, m: int = 1) -> Untyped: ... @classmethod def basis_element(cls, t: Untyped, extrapolate: bool = True) -> Untyped: ... @classmethod diff --git a/scipy-stubs/interpolate/_cubic.pyi b/scipy-stubs/interpolate/_cubic.pyi index d5a46eea..bc530452 100644 --- a/scipy-stubs/interpolate/_cubic.pyi +++ b/scipy-stubs/interpolate/_cubic.pyi @@ -27,6 +27,7 @@ class CubicHermiteSpline(PPoly[_CT_co]): @overload def __init__( self: CubicHermiteSpline[np.float64], + /, x: onp.ToFloat1D, y: onp.ToFloatND, dydx: onp.ToFloatND, @@ -36,6 +37,7 @@ class CubicHermiteSpline(PPoly[_CT_co]): @overload def __init__( self: CubicHermiteSpline[np.float64 | np.complex128], + /, x: onp.ToFloat1D, y: onp.ToComplexND, dydx: onp.ToComplexND, @@ -44,11 +46,12 @@ class CubicHermiteSpline(PPoly[_CT_co]): ) -> None: ... class PchipInterpolator(CubicHermiteSpline[np.float64]): - def __init__(self, x: onp.ToFloat1D, y: onp.ToFloatND, axis: _ToAxis = 0, extrapolate: bool | None = None) -> None: ... + def __init__(self, /, x: onp.ToFloat1D, y: onp.ToFloatND, axis: _ToAxis = 0, extrapolate: bool | None = None) -> None: ... class Akima1DInterpolator(CubicHermiteSpline[np.float64]): def __init__( self, + /, x: onp.ToFloat1D, y: onp.ToFloatND, axis: _ToAxis = 0, @@ -59,7 +62,7 @@ class Akima1DInterpolator(CubicHermiteSpline[np.float64]): # the following (class)methods will raise `NotImplementedError` when called @override - def extend(self, c: object, x: object, right: object = True) -> Never: ... + def extend(self, /, c: object, x: object, right: object = True) -> Never: ... @classmethod @override def from_spline(cls, tck: object, extrapolate: object = ...) -> Never: ... @@ -71,6 +74,7 @@ class CubicSpline(CubicHermiteSpline[_CT_co], Generic[_CT_co]): @overload def __init__( self: CubicSpline[np.float64], + /, x: onp.ToFloat1D, y: onp.ToFloatND, axis: _ToAxis = 0, @@ -80,6 +84,7 @@ class CubicSpline(CubicHermiteSpline[_CT_co], Generic[_CT_co]): @overload def __init__( self: CubicSpline[np.float64 | np.complex128], + /, x: onp.ToFloat1D, y: onp.ToComplexND, axis: _ToAxis = 0, diff --git a/scipy-stubs/interpolate/_fitpack2.pyi b/scipy-stubs/interpolate/_fitpack2.pyi index c65ef913..f515158d 100644 --- a/scipy-stubs/interpolate/_fitpack2.pyi +++ b/scipy-stubs/interpolate/_fitpack2.pyi @@ -22,6 +22,7 @@ class UnivariateSpline: # at runtime the `__init__` might change the `__class__` attribute... def __init__( self, + /, x: npt.ArrayLike, y: npt.ArrayLike, w: npt.ArrayLike | None = None, @@ -31,16 +32,16 @@ class UnivariateSpline: ext: int | str = 0, check_finite: bool = False, ) -> None: ... - def __call__(self, x: Untyped, nu: int = 0, ext: Untyped | None = None) -> Untyped: ... - def set_smoothing_factor(self, s: Untyped) -> None: ... - def get_knots(self) -> Untyped: ... - def get_coeffs(self) -> Untyped: ... - def get_residual(self) -> Untyped: ... - def integral(self, a: Untyped, b: Untyped) -> Untyped: ... - def derivatives(self, x: Untyped) -> Untyped: ... - def roots(self) -> Untyped: ... - def derivative(self, n: int = 1) -> Untyped: ... - def antiderivative(self, n: int = 1) -> Untyped: ... + def __call__(self, /, x: Untyped, nu: int = 0, ext: Untyped | None = None) -> Untyped: ... + def set_smoothing_factor(self, /, s: Untyped) -> None: ... + def get_knots(self, /) -> Untyped: ... + def get_coeffs(self, /) -> Untyped: ... + def get_residual(self, /) -> Untyped: ... + def integral(self, /, a: Untyped, b: Untyped) -> Untyped: ... + def derivatives(self, /, x: Untyped) -> Untyped: ... + def roots(self, /) -> Untyped: ... + def derivative(self, /, n: int = 1) -> Untyped: ... + def antiderivative(self, /, n: int = 1) -> Untyped: ... @staticmethod def validate_input( x: npt.ArrayLike, @@ -56,6 +57,7 @@ class UnivariateSpline: class InterpolatedUnivariateSpline(UnivariateSpline): def __init__( self, + /, x: npt.ArrayLike, y: npt.ArrayLike, w: npt.ArrayLike | None = None, @@ -68,6 +70,7 @@ class InterpolatedUnivariateSpline(UnivariateSpline): class LSQUnivariateSpline(UnivariateSpline): def __init__( self, + /, x: npt.ArrayLike, y: npt.ArrayLike, t: npt.ArrayLike, @@ -79,19 +82,19 @@ class LSQUnivariateSpline(UnivariateSpline): ) -> None: ... class _BivariateSplineBase: # undocumented - def __call__(self, x: Untyped, y: Untyped, dx: int = 0, dy: int = 0, grid: bool = True) -> Untyped: ... - def get_residual(self) -> Untyped: ... - def get_knots(self) -> Untyped: ... - def get_coeffs(self) -> Untyped: ... - def partial_derivative(self, dx: Untyped, dy: Untyped) -> Untyped: ... + def __call__(self, /, x: Untyped, y: Untyped, dx: int = 0, dy: int = 0, grid: bool = True) -> Untyped: ... + def get_residual(self, /) -> Untyped: ... + def get_knots(self, /) -> Untyped: ... + def get_coeffs(self, /) -> Untyped: ... + def partial_derivative(self, /, dx: Untyped, dy: Untyped) -> Untyped: ... class BivariateSpline(_BivariateSplineBase): - def ev(self, xi: Untyped, yi: Untyped, dx: int = 0, dy: int = 0) -> Untyped: ... - def integral(self, xa: Untyped, xb: Untyped, ya: Untyped, yb: Untyped) -> Untyped: ... + def ev(self, /, xi: Untyped, yi: Untyped, dx: int = 0, dy: int = 0) -> Untyped: ... + def integral(self, /, xa: Untyped, xb: Untyped, ya: Untyped, yb: Untyped) -> Untyped: ... class _DerivedBivariateSpline(_BivariateSplineBase): # undocumented @property - def fp(self) -> Untyped: ... + def fp(self, /) -> Untyped: ... class SmoothBivariateSpline(BivariateSpline): fp: Untyped @@ -100,6 +103,7 @@ class SmoothBivariateSpline(BivariateSpline): def __init__( self, + /, x: Untyped, y: Untyped, z: Untyped, @@ -117,6 +121,7 @@ class LSQBivariateSpline(BivariateSpline): degrees: Untyped def __init__( self, + /, x: Untyped, y: Untyped, z: Untyped, @@ -136,6 +141,7 @@ class RectBivariateSpline(BivariateSpline): def __init__( self, + /, x: Untyped, y: Untyped, z: Untyped, @@ -149,13 +155,14 @@ class SphereBivariateSpline(_BivariateSplineBase): @override def __call__( # type: ignore[override] self, + /, theta: Untyped, phi: Untyped, dtheta: int = 0, dphi: int = 0, grid: bool = True, ) -> Untyped: ... - def ev(self, theta: Untyped, phi: Untyped, dtheta: int = 0, dphi: int = 0) -> Untyped: ... + def ev(self, /, theta: Untyped, phi: Untyped, dtheta: int = 0, dphi: int = 0) -> Untyped: ... class SmoothSphereBivariateSpline(SphereBivariateSpline): fp: Untyped @@ -164,6 +171,7 @@ class SmoothSphereBivariateSpline(SphereBivariateSpline): def __init__( self, + /, theta: Untyped, phi: Untyped, r: Untyped, @@ -174,6 +182,7 @@ class SmoothSphereBivariateSpline(SphereBivariateSpline): @override def __call__( # type: ignore[override] self, + /, theta: Untyped, phi: Untyped, dtheta: int = 0, @@ -187,6 +196,7 @@ class LSQSphereBivariateSpline(SphereBivariateSpline): degrees: Untyped def __init__( self, + /, theta: Untyped, phi: Untyped, r: Untyped, @@ -198,6 +208,7 @@ class LSQSphereBivariateSpline(SphereBivariateSpline): @override def __call__( # type: ignore[override] self, + /, theta: Untyped, phi: Untyped, dtheta: int = 0, @@ -212,6 +223,7 @@ class RectSphereBivariateSpline(SphereBivariateSpline): v0: Untyped def __init__( self, + /, u: Untyped, v: Untyped, r: Untyped, @@ -224,6 +236,7 @@ class RectSphereBivariateSpline(SphereBivariateSpline): @override def __call__( # type: ignore[override] self, + /, theta: Untyped, phi: Untyped, dtheta: int = 0, diff --git a/scipy-stubs/interpolate/_interpolate.pyi b/scipy-stubs/interpolate/_interpolate.pyi index 6c171d9b..dbe20161 100644 --- a/scipy-stubs/interpolate/_interpolate.pyi +++ b/scipy-stubs/interpolate/_interpolate.pyi @@ -57,7 +57,7 @@ class interp1d(_Interpolator1D): x_bds: onp.Array1D[np.floating[Any]] # only set if `kind in {"nearest", "nearest-up"}` @property - def fill_value(self) -> _Interp1dFillValue: ... + def fill_value(self, /) -> _Interp1dFillValue: ... @fill_value.setter def fill_value(self, fill_value: _Interp1dFillValue | Literal["extrapolate"], /) -> None: ... diff --git a/scipy-stubs/interpolate/_ndbspline.pyi b/scipy-stubs/interpolate/_ndbspline.pyi index 8cb85cdd..0ae08090 100644 --- a/scipy-stubs/interpolate/_ndbspline.pyi +++ b/scipy-stubs/interpolate/_ndbspline.pyi @@ -8,8 +8,8 @@ class NdBSpline: c: Untyped extrapolate: Untyped - def __init__(self, t: Untyped, c: Untyped, k: Untyped, *, extrapolate: bool | None = None) -> None: ... - def __call__(self, xi: Untyped, *, nu: Untyped | None = None, extrapolate: bool | None = None) -> Untyped: ... + def __init__(self, /, t: Untyped, c: Untyped, k: Untyped, *, extrapolate: bool | None = None) -> None: ... + def __call__(self, /, xi: Untyped, *, nu: Untyped | None = None, extrapolate: bool | None = None) -> Untyped: ... @classmethod def design_matrix(cls, xvals: Untyped, t: Untyped, k: Untyped, extrapolate: bool = True) -> Untyped: ... diff --git a/scipy-stubs/interpolate/_polyint.pyi b/scipy-stubs/interpolate/_polyint.pyi index 522034bb..9ee0b987 100644 --- a/scipy-stubs/interpolate/_polyint.pyi +++ b/scipy-stubs/interpolate/_polyint.pyi @@ -10,18 +10,18 @@ __all__ = [ class _Interpolator1D: # undocumented dtype: Untyped - def __init__(self, xi: Untyped | None = None, yi: Untyped | None = None, axis: Untyped | None = None) -> None: ... - def __call__(self, x: Untyped) -> Untyped: ... + def __init__(self, /, xi: Untyped | None = None, yi: Untyped | None = None, axis: Untyped | None = None) -> None: ... + def __call__(self, /, x: Untyped) -> Untyped: ... class _Interpolator1DWithDerivatives(_Interpolator1D): # undocumented - def derivatives(self, x: Untyped, der: Untyped | None = None) -> Untyped: ... - def derivative(self, x: Untyped, der: int = 1) -> Untyped: ... + def derivatives(self, /, x: Untyped, der: Untyped | None = None) -> Untyped: ... + def derivative(self, /, x: Untyped, der: int = 1) -> Untyped: ... class KroghInterpolator(_Interpolator1DWithDerivatives): xi: Untyped yi: Untyped c: Untyped - def __init__(self, xi: Untyped, yi: Untyped, axis: int = 0) -> None: ... + def __init__(self, /, xi: Untyped, yi: Untyped, axis: int = 0) -> None: ... class BarycentricInterpolator(_Interpolator1DWithDerivatives): xi: Untyped @@ -31,6 +31,7 @@ class BarycentricInterpolator(_Interpolator1DWithDerivatives): def __init__( self, + /, xi: Untyped, yi: Untyped | None = None, axis: int = 0, @@ -38,8 +39,8 @@ class BarycentricInterpolator(_Interpolator1DWithDerivatives): wi: Untyped | None = None, random_state: Untyped | None = None, ) -> None: ... - def set_yi(self, yi: Untyped, axis: Untyped | None = None) -> None: ... - def add_xi(self, xi: Untyped, yi: Untyped | None = None) -> None: ... + def set_yi(self, /, yi: Untyped, axis: Untyped | None = None) -> None: ... + def add_xi(self, /, xi: Untyped, yi: Untyped | None = None) -> None: ... def krogh_interpolate(xi: Untyped, yi: Untyped, x: Untyped, der: int = 0, axis: int = 0) -> Untyped: ... def approximate_taylor_polynomial( diff --git a/scipy-stubs/interpolate/_rbf.pyi b/scipy-stubs/interpolate/_rbf.pyi index 8b644fe1..10588cc8 100644 --- a/scipy-stubs/interpolate/_rbf.pyi +++ b/scipy-stubs/interpolate/_rbf.pyi @@ -13,6 +13,6 @@ class Rbf: function: Untyped nodes: Untyped @property - def A(self) -> Untyped: ... - def __init__(self, *args: Untyped, **kwargs: Untyped) -> None: ... - def __call__(self, *args: Untyped) -> Untyped: ... + def A(self, /) -> Untyped: ... + def __init__(self, /, *args: Untyped, **kwargs: Untyped) -> None: ... + def __call__(self, /, *args: Untyped) -> Untyped: ... diff --git a/scipy-stubs/interpolate/_rbfinterp.pyi b/scipy-stubs/interpolate/_rbfinterp.pyi index f19f1d1c..d7ed7799 100644 --- a/scipy-stubs/interpolate/_rbfinterp.pyi +++ b/scipy-stubs/interpolate/_rbfinterp.pyi @@ -14,6 +14,7 @@ class RBFInterpolator: powers: Untyped def __init__( self, + /, y: Untyped, d: Untyped, neighbors: Untyped | None = None, @@ -22,4 +23,4 @@ class RBFInterpolator: epsilon: Untyped | None = None, degree: Untyped | None = None, ) -> None: ... - def __call__(self, x: Untyped) -> Untyped: ... + def __call__(self, /, x: Untyped) -> Untyped: ... diff --git a/scipy-stubs/interpolate/_rgi.pyi b/scipy-stubs/interpolate/_rgi.pyi index ffff6039..0d0c82c1 100644 --- a/scipy-stubs/interpolate/_rgi.pyi +++ b/scipy-stubs/interpolate/_rgi.pyi @@ -9,6 +9,7 @@ class RegularGridInterpolator: fill_value: Untyped def __init__( self, + /, points: Untyped, values: Untyped, method: str = "linear", @@ -18,7 +19,7 @@ class RegularGridInterpolator: solver: Untyped | None = None, solver_args: Untyped | None = None, ) -> None: ... - def __call__(self, xi: Untyped, method: Untyped | None = None, *, nu: Untyped | None = None) -> Untyped: ... + def __call__(self, /, xi: Untyped, method: Untyped | None = None, *, nu: Untyped | None = None) -> Untyped: ... def interpn( points: Untyped, diff --git a/scipy-stubs/interpolate/fitpack.pyi b/scipy-stubs/interpolate/fitpack.pyi index 4ce16aee..c534878f 100644 --- a/scipy-stubs/interpolate/fitpack.pyi +++ b/scipy-stubs/interpolate/fitpack.pyi @@ -65,22 +65,22 @@ def splantider(tck: object, n: object = ...) -> object: ... # bsplines @deprecated("will be removed in SciPy v2.0.0") class BSpline: - def __init__(self, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> None: ... + def __init__(self, /, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> None: ... @classmethod def construct_fast(cls, t: object, c: object, k: object, extrapolate: object = ..., axis: object = ...) -> object: ... @property - def tck(self) -> object: ... + def tck(self, /) -> object: ... @classmethod def basis_element(cls, t: object, extrapolate: object = ...) -> object: ... @classmethod def design_matrix(cls, x: object, t: object, k: object, extrapolate: object = ...) -> object: ... - def __call__(self, x: object, nu: object = ..., extrapolate: object = ...) -> object: ... - def derivative(self, nu: object = ...) -> object: ... - def antiderivative(self, nu: object = ...) -> object: ... - def integrate(self, a: object, b: object, extrapolate: object = ...) -> object: ... + def __call__(self, /, x: object, nu: object = ..., extrapolate: object = ...) -> object: ... + def derivative(self, /, nu: object = ...) -> object: ... + def antiderivative(self, /, nu: object = ...) -> object: ... + def integrate(self, /, a: object, b: object, extrapolate: object = ...) -> object: ... @classmethod def from_power_basis(cls, pp: object, bc_type: object = ...) -> object: ... - def insert_knot(self, x: object, m: object = ...) -> object: ... + def insert_knot(self, /, x: object, m: object = ...) -> object: ... # fitpack_impl @deprecated("will be removed in SciPy v2.0.0") diff --git a/scipy-stubs/interpolate/fitpack2.pyi b/scipy-stubs/interpolate/fitpack2.pyi index 44271d4e..b2d88435 100644 --- a/scipy-stubs/interpolate/fitpack2.pyi +++ b/scipy-stubs/interpolate/fitpack2.pyi @@ -18,6 +18,7 @@ __all__ = [ class UnivariateSpline: def __init__( self, + /, x: object, y: object, w: object = ..., @@ -38,21 +39,22 @@ class UnivariateSpline: ext: object, check_finite: object, ) -> object: ... - def set_smoothing_factor(self, s: object) -> None: ... - def __call__(self, x: object, nu: object = ..., ext: object = ...) -> object: ... - def get_knots(self) -> object: ... - def get_coeffs(self) -> object: ... - def get_residual(self) -> object: ... - def integral(self, a: object, b: object) -> object: ... - def derivatives(self, x: object) -> object: ... - def roots(self) -> object: ... - def derivative(self, n: object = ...) -> object: ... - def antiderivative(self, n: object = ...) -> object: ... + def set_smoothing_factor(self, /, s: object) -> None: ... + def __call__(self, /, x: object, nu: object = ..., ext: object = ...) -> object: ... + def get_knots(self, /) -> object: ... + def get_coeffs(self, /) -> object: ... + def get_residual(self, /) -> object: ... + def integral(self, /, a: object, b: object) -> object: ... + def derivatives(self, /, x: object) -> object: ... + def roots(self, /) -> object: ... + def derivative(self, /, n: object = ...) -> object: ... + def antiderivative(self, /, n: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class InterpolatedUnivariateSpline: def __init__( self, + /, x: object, y: object, w: object = ..., @@ -66,6 +68,7 @@ class InterpolatedUnivariateSpline: class LSQUnivariateSpline: def __init__( self, + /, x: object, y: object, t: object, @@ -78,13 +81,14 @@ class LSQUnivariateSpline: @deprecated("will be removed in SciPy v2.0.0") class BivariateSpline: - def ev(self, xi: object, yi: object, dx: object = ..., dy: object = ...) -> object: ... - def integral(self, xa: object, xb: object, ya: object, yb: object) -> object: ... + def ev(self, /, xi: object, yi: object, dx: object = ..., dy: object = ...) -> object: ... + def integral(self, /, xa: object, xb: object, ya: object, yb: object) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class SmoothBivariateSpline: def __init__( self, + /, x: object, y: object, z: object, @@ -100,6 +104,7 @@ class SmoothBivariateSpline: class LSQBivariateSpline: def __init__( self, + /, x: object, y: object, z: object, @@ -116,6 +121,7 @@ class LSQBivariateSpline: class RectBivariateSpline: def __init__( self, + /, x: object, y: object, z: object, @@ -127,13 +133,14 @@ class RectBivariateSpline: @deprecated("will be removed in SciPy v2.0.0") class SmoothSphereBivariateSpline: - def __init__(self, theta: object, phi: object, r: object, w: object = ..., s: object = ..., eps: object = ...) -> None: ... - def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... + def __init__(self, /, theta: object, phi: object, r: object, w: object = ..., s: object = ..., eps: object = ...) -> None: ... + def __call__(self, /, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class LSQSphereBivariateSpline: def __init__( self, + /, theta: object, phi: object, r: object, @@ -142,12 +149,13 @@ class LSQSphereBivariateSpline: w: object = ..., eps: object = ..., ) -> None: ... - def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... + def __call__(self, /, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class RectSphereBivariateSpline: def __init__( self, + /, u: object, v: object, r: object, @@ -157,4 +165,4 @@ class RectSphereBivariateSpline: pole_exact: object = ..., pole_flat: object = ..., ) -> None: ... - def __call__(self, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... + def __call__(self, /, theta: object, phi: object, dtheta: object = ..., dphi: object = ..., grid: object = ...) -> object: ... diff --git a/scipy-stubs/interpolate/polyint.pyi b/scipy-stubs/interpolate/polyint.pyi index 40f34fa6..3932de39 100644 --- a/scipy-stubs/interpolate/polyint.pyi +++ b/scipy-stubs/interpolate/polyint.pyi @@ -11,17 +11,17 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class KroghInterpolator: - def __init__(self: object, xi: object, yi: object, axis: object = ...) -> None: ... + def __init__(self: object, /, xi: object, yi: object, axis: object = ...) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class BarycentricInterpolator: def __init__( - self: object, xi: object, yi: object = ..., axis: object = ..., *, wi: object = ..., random_state: object = ... + self: object, /, xi: object, yi: object = ..., axis: object = ..., *, wi: object = ..., random_state: object = ... ) -> None: ... - def __call__(self: object, x: object) -> object: ... - def set_yi(self: object, yi: object, axis: object = ...) -> None: ... - def add_xi(self: object, xi: object, yi: object = ...) -> None: ... - def derivative(self: object, x: object, der: object = ...) -> object: ... + def __call__(self: object, /, x: object) -> object: ... + def set_yi(self: object, /, yi: object, axis: object = ...) -> None: ... + def add_xi(self: object, /, xi: object, yi: object = ...) -> None: ... + def derivative(self: object, /, x: object, der: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def krogh_interpolate(xi: object, yi: object, x: object, der: object = ..., axis: object = ...) -> object: ... diff --git a/scipy-stubs/interpolate/rbf.pyi b/scipy-stubs/interpolate/rbf.pyi index af3a9b83..ecc5269d 100644 --- a/scipy-stubs/interpolate/rbf.pyi +++ b/scipy-stubs/interpolate/rbf.pyi @@ -6,6 +6,6 @@ __all__ = ["Rbf"] @deprecated("will be removed in SciPy v2.0.0") class Rbf: @property - def A(self) -> object: ... - def __init__(self, *args: object, **kwargs: object) -> None: ... - def __call__(self, *args: object) -> object: ... + def A(self, /) -> object: ... + def __init__(self, /, *args: object, **kwargs: object) -> None: ... + def __call__(self, /, *args: object) -> object: ... diff --git a/scipy-stubs/io/matlab/mio5_params.pyi b/scipy-stubs/io/matlab/mio5_params.pyi index 4c07e7c4..83205783 100644 --- a/scipy-stubs/io/matlab/mio5_params.pyi +++ b/scipy-stubs/io/matlab/mio5_params.pyi @@ -11,7 +11,7 @@ class MatlabFunction: @deprecated("will be removed in SciPy v2.0.0") class MatlabObject: def __new__(cls, input_array: object, classname: object = ...) -> Self: ... - def __array_finalize__(self, obj: Self) -> None: ... + def __array_finalize__(self, /, obj: Self) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class MatlabOpaque: diff --git a/scipy-stubs/odr/_odrpack.pyi b/scipy-stubs/odr/_odrpack.pyi index 88c11c99..d1176449 100644 --- a/scipy-stubs/odr/_odrpack.pyi +++ b/scipy-stubs/odr/_odrpack.pyi @@ -186,7 +186,7 @@ class Model: implicit: AnyBool = 0, meta: Mapping[str, object] | None = None, ) -> None: ... - def set_meta(self, **kwds: object) -> None: ... + def set_meta(self, /, **kwds: object) -> None: ... class Output: beta: Final[onp.Array1D[_ToFloatScalar]] diff --git a/scipy-stubs/optimize/_dcsrch.pyi b/scipy-stubs/optimize/_dcsrch.pyi index 2325d71e..a146cf57 100644 --- a/scipy-stubs/optimize/_dcsrch.pyi +++ b/scipy-stubs/optimize/_dcsrch.pyi @@ -24,6 +24,7 @@ class DCSRCH: derphi: Untyped def __init__( self, + /, phi: Untyped, derphi: Untyped, ftol: Untyped, @@ -34,6 +35,7 @@ class DCSRCH: ) -> None: ... def __call__( self, + /, alpha1: Untyped, phi0: Untyped | None = None, derphi0: Untyped | None = None, diff --git a/scipy-stubs/optimize/_differentialevolution.pyi b/scipy-stubs/optimize/_differentialevolution.pyi index 3e99b763..ea5e6b7d 100644 --- a/scipy-stubs/optimize/_differentialevolution.pyi +++ b/scipy-stubs/optimize/_differentialevolution.pyi @@ -76,6 +76,7 @@ class DifferentialEvolutionSolver(EnterSelfMixin): disp: Untyped def __init__( self, + /, func: Untyped, bounds: Untyped, args: Untyped = (), @@ -102,18 +103,18 @@ class DifferentialEvolutionSolver(EnterSelfMixin): ) -> None: ... population: Untyped population_energies: Untyped - def init_population_lhs(self) -> None: ... - def init_population_qmc(self, qmc_engine: Untyped) -> None: ... - def init_population_random(self) -> None: ... - def init_population_array(self, init: Untyped) -> None: ... + def init_population_lhs(self, /) -> None: ... + def init_population_qmc(self, /, qmc_engine: Untyped) -> None: ... + def init_population_random(self, /) -> None: ... + def init_population_array(self, /, init: Untyped) -> None: ... @property - def x(self) -> Untyped: ... + def x(self, /) -> Untyped: ... @property - def convergence(self) -> Untyped: ... - def converged(self) -> Untyped: ... - def solve(self) -> Untyped: ... - def __iter__(self) -> Self: ... - def __next__(self) -> Untyped: ... + def convergence(self, /) -> Untyped: ... + def converged(self, /) -> Untyped: ... + def solve(self, /) -> Untyped: ... + def __iter__(self, /) -> Self: ... + def __next__(self, /) -> Untyped: ... # undocumented class _ConstraintWrapper: @@ -122,6 +123,6 @@ class _ConstraintWrapper: num_constr: Untyped parameter_count: Untyped bounds: Untyped - def __init__(self, constraint: Untyped, x0: Untyped) -> None: ... - def __call__(self, x: Untyped) -> Untyped: ... - def violation(self, x: Untyped) -> Untyped: ... + def __init__(self, /, constraint: Untyped, x0: Untyped) -> None: ... + def __call__(self, /, x: Untyped) -> Untyped: ... + def violation(self, /, x: Untyped) -> Untyped: ... diff --git a/scipy-stubs/optimize/_dual_annealing.pyi b/scipy-stubs/optimize/_dual_annealing.pyi index 890cc528..e681866e 100644 --- a/scipy-stubs/optimize/_dual_annealing.pyi +++ b/scipy-stubs/optimize/_dual_annealing.pyi @@ -24,9 +24,9 @@ class VisitingDistribution: lower: Untyped upper: Untyped bound_range: Untyped - def __init__(self, lb: Untyped, ub: Untyped, visiting_param: Untyped, rand_gen: Untyped) -> None: ... - def visiting(self, x: Untyped, step: Untyped, temperature: Untyped) -> Untyped: ... - def visit_fn(self, temperature: Untyped, dim: Untyped) -> Untyped: ... + def __init__(self, /, lb: Untyped, ub: Untyped, visiting_param: Untyped, rand_gen: Untyped) -> None: ... + def visiting(self, /, x: Untyped, step: Untyped, temperature: Untyped) -> Untyped: ... + def visit_fn(self, /, temperature: Untyped, dim: Untyped) -> Untyped: ... class EnergyState: MAX_REINIT_COUNT: int @@ -37,10 +37,10 @@ class EnergyState: lower: Untyped upper: Untyped callback: Untyped - def __init__(self, lower: Untyped, upper: Untyped, callback: Untyped | None = None) -> None: ... - def reset(self, func_wrapper: Untyped, rand_gen: Untyped, x0: Untyped | None = None) -> None: ... - def update_best(self, e: Untyped, x: Untyped, context: Untyped) -> Untyped: ... - def update_current(self, e: Untyped, x: Untyped) -> None: ... + def __init__(self, /, lower: Untyped, upper: Untyped, callback: Untyped | None = None) -> None: ... + def reset(self, /, func_wrapper: Untyped, rand_gen: Untyped, x0: Untyped | None = None) -> None: ... + def update_best(self, /, e: Untyped, x: Untyped, context: Untyped) -> Untyped: ... + def update_current(self, /, e: Untyped, x: Untyped) -> None: ... class StrategyChain: emin: Untyped @@ -56,6 +56,7 @@ class StrategyChain: K: Untyped def __init__( self, + /, acceptance_param: Untyped, visit_dist: Untyped, func_wrapper: Untyped, @@ -63,10 +64,10 @@ class StrategyChain: rand_gen: Untyped, energy_state: Untyped, ) -> None: ... - def accept_reject(self, j: Untyped, e: Untyped, x_visit: Untyped) -> None: ... + def accept_reject(self, /, j: Untyped, e: Untyped, x_visit: Untyped) -> None: ... energy_state_improved: bool - def run(self, step: Untyped, temperature: Untyped) -> Untyped: ... - def local_search(self) -> Untyped: ... + def run(self, /, step: Untyped, temperature: Untyped) -> Untyped: ... + def local_search(self, /) -> Untyped: ... class ObjectiveFunWrapper: func: Untyped @@ -75,8 +76,8 @@ class ObjectiveFunWrapper: ngev: int nhev: int maxfun: Untyped - def __init__(self, func: Untyped, maxfun: float = 10000000.0, *args: Untyped) -> None: ... - def fun(self, x: Untyped) -> Untyped: ... + def __init__(self, /, func: Untyped, maxfun: float = 10000000.0, *args: Untyped) -> None: ... + def fun(self, /, x: Untyped) -> Untyped: ... class LocalSearchWrapper: LS_MAXITER_RATIO: int @@ -90,8 +91,8 @@ class LocalSearchWrapper: minimizer: Untyped lower: Untyped upper: Untyped - def __init__(self, search_bounds: Untyped, func_wrapper: Untyped, *args: Untyped, **kwargs: Untyped) -> None: ... - def local_search(self, x: Untyped, e: Untyped) -> Untyped: ... + def __init__(self, /, search_bounds: Untyped, func_wrapper: Untyped, *args: Untyped, **kwargs: Untyped) -> None: ... + def local_search(self, /, x: Untyped, e: Untyped) -> Untyped: ... def dual_annealing( func: Untyped, diff --git a/scipy-stubs/optimize/_lbfgsb_py.pyi b/scipy-stubs/optimize/_lbfgsb_py.pyi index 856fe9d5..5efd3ead 100644 --- a/scipy-stubs/optimize/_lbfgsb_py.pyi +++ b/scipy-stubs/optimize/_lbfgsb_py.pyi @@ -27,5 +27,5 @@ class LbfgsInvHessProduct(LinearOperator): yk: Untyped n_corrs: Untyped rho: Untyped - def __init__(self, sk: Untyped, yk: Untyped) -> None: ... - def todense(self) -> Untyped: ... + def __init__(self, /, sk: Untyped, yk: Untyped) -> None: ... + def todense(self, /) -> Untyped: ... diff --git a/scipy-stubs/optimize/_shgo.pyi b/scipy-stubs/optimize/_shgo.pyi index e802d77d..e6660262 100644 --- a/scipy-stubs/optimize/_shgo.pyi +++ b/scipy-stubs/optimize/_shgo.pyi @@ -99,6 +99,7 @@ class SHGO(EnterSelfMixin): Xs: Untyped def __init__( self, + /, func: UntypedCallable, bounds: Untyped, args: tuple[object, ...] = (), @@ -111,35 +112,35 @@ class SHGO(EnterSelfMixin): sampling_method: _SamplingMethod = "simplicial", workers: int = 1, ) -> None: ... - def init_options(self, options: Untyped) -> None: ... - def iterate_all(self) -> None: ... - def find_minima(self) -> None: ... - def find_lowest_vertex(self) -> None: ... - def finite_iterations(self) -> Untyped: ... - def finite_fev(self) -> Untyped: ... - def finite_ev(self) -> None: ... - def finite_time(self) -> None: ... - def finite_precision(self) -> Untyped: ... - def finite_homology_growth(self) -> Untyped: ... - def stopping_criteria(self) -> Untyped: ... - def iterate(self) -> None: ... - def iterate_hypercube(self) -> None: ... - def iterate_delaunay(self) -> None: ... - def minimizers(self) -> Untyped: ... - def minimise_pool(self, force_iter: bool = False) -> None: ... - def sort_min_pool(self) -> None: ... - def trim_min_pool(self, trim_ind: Untyped) -> None: ... - def g_topograph(self, x_min: Untyped, X_min: Untyped) -> Untyped: ... - def construct_lcb_simplicial(self, v_min: Untyped) -> Untyped: ... - def construct_lcb_delaunay(self, v_min: Untyped, ind: Untyped | None = None) -> Untyped: ... - def minimize(self, x_min: Untyped, ind: Untyped | None = None) -> Untyped: ... - def sort_result(self) -> Untyped: ... - def fail_routine(self, mes: str = "Failed to converge") -> None: ... - def sampled_surface(self, infty_cons_sampl: bool = False) -> None: ... - def sampling_custom(self, n: Untyped, dim: Untyped) -> Untyped: ... - def sampling_subspace(self) -> None: ... - def sorted_samples(self) -> Untyped: ... - def delaunay_triangulation(self, n_prc: int = 0) -> Untyped: ... + def init_options(self, /, options: Untyped) -> None: ... + def iterate_all(self, /) -> None: ... + def find_minima(self, /) -> None: ... + def find_lowest_vertex(self, /) -> None: ... + def finite_iterations(self, /) -> Untyped: ... + def finite_fev(self, /) -> Untyped: ... + def finite_ev(self, /) -> None: ... + def finite_time(self, /) -> None: ... + def finite_precision(self, /) -> Untyped: ... + def finite_homology_growth(self, /) -> Untyped: ... + def stopping_criteria(self, /) -> Untyped: ... + def iterate(self, /) -> None: ... + def iterate_hypercube(self, /) -> None: ... + def iterate_delaunay(self, /) -> None: ... + def minimizers(self, /) -> Untyped: ... + def minimise_pool(self, /, force_iter: bool = False) -> None: ... + def sort_min_pool(self, /) -> None: ... + def trim_min_pool(self, /, trim_ind: Untyped) -> None: ... + def g_topograph(self, /, x_min: Untyped, X_min: Untyped) -> Untyped: ... + def construct_lcb_simplicial(self, /, v_min: Untyped) -> Untyped: ... + def construct_lcb_delaunay(self, /, v_min: Untyped, ind: Untyped | None = None) -> Untyped: ... + def minimize(self, /, x_min: Untyped, ind: Untyped | None = None) -> Untyped: ... + def sort_result(self, /) -> Untyped: ... + def fail_routine(self, /, mes: str = "Failed to converge") -> None: ... + def sampled_surface(self, /, infty_cons_sampl: bool = False) -> None: ... + def sampling_custom(self, /, n: Untyped, dim: Untyped) -> Untyped: ... + def sampling_subspace(self, /) -> None: ... + def sorted_samples(self, /) -> Untyped: ... + def delaunay_triangulation(self, /, n_prc: int = 0) -> Untyped: ... # undocumented class LMap: diff --git a/scipy-stubs/optimize/_trlib/_trlib.pyi b/scipy-stubs/optimize/_trlib/_trlib.pyi index 6261258e..0d237d0b 100644 --- a/scipy-stubs/optimize/_trlib/_trlib.pyi +++ b/scipy-stubs/optimize/_trlib/_trlib.pyi @@ -23,4 +23,4 @@ class TRLIBQuadraticSubproblem(BaseQuadraticSubproblem): disp: bool = False, ) -> None: ... @override - def solve(self, trust_radius: float | np.float64) -> tuple[onp.ArrayND[np.float64], bool]: ... + def solve(self, /, trust_radius: float | np.float64) -> tuple[onp.ArrayND[np.float64], bool]: ... diff --git a/scipy-stubs/optimize/_trustregion.pyi b/scipy-stubs/optimize/_trustregion.pyi index 5fcd354e..94efdb4e 100644 --- a/scipy-stubs/optimize/_trustregion.pyi +++ b/scipy-stubs/optimize/_trustregion.pyi @@ -8,22 +8,23 @@ __all__: list[str] = [] class BaseQuadraticSubproblem: def __init__( self, + /, x: Untyped, fun: Untyped, jac: Untyped, hess: Untyped | None = None, hessp: Untyped | None = None, ) -> None: ... - def __call__(self, p: Untyped) -> Untyped: ... + def __call__(self, /, p: Untyped) -> Untyped: ... @property - def fun(self) -> Untyped: ... + def fun(self, /) -> Untyped: ... @property - def jac(self) -> Untyped: ... + def jac(self, /) -> Untyped: ... @property - def hess(self) -> Untyped: ... - def hessp(self, p: Untyped) -> Untyped: ... + def hess(self, /) -> Untyped: ... + def hessp(self, /, p: Untyped) -> Untyped: ... @property - def jac_mag(self) -> Untyped: ... - def get_boundaries_intersections(self, z: Untyped, d: Untyped, trust_radius: Untyped) -> Untyped: ... + def jac_mag(self, /) -> Untyped: ... + def get_boundaries_intersections(self, /, z: Untyped, d: Untyped, trust_radius: Untyped) -> Untyped: ... @abc.abstractmethod - def solve(self, trust_radius: float | np.float64) -> Untyped: ... + def solve(self, /, trust_radius: float | np.float64) -> Untyped: ... diff --git a/scipy-stubs/optimize/_trustregion_dogleg.pyi b/scipy-stubs/optimize/_trustregion_dogleg.pyi index bcfb76ac..ce01967a 100644 --- a/scipy-stubs/optimize/_trustregion_dogleg.pyi +++ b/scipy-stubs/optimize/_trustregion_dogleg.pyi @@ -7,7 +7,7 @@ from ._trustregion import BaseQuadraticSubproblem __all__: list[str] = [] class DoglegSubproblem(BaseQuadraticSubproblem): - def cauchy_point(self) -> Untyped: ... - def newton_point(self) -> Untyped: ... + def cauchy_point(self, /) -> Untyped: ... + def newton_point(self, /) -> Untyped: ... @override - def solve(self, trust_radius: float | np.float64) -> Untyped: ... + def solve(self, /, trust_radius: float | np.float64) -> Untyped: ... diff --git a/scipy-stubs/optimize/_trustregion_exact.pyi b/scipy-stubs/optimize/_trustregion_exact.pyi index 918a2ba8..ffb48947 100644 --- a/scipy-stubs/optimize/_trustregion_exact.pyi +++ b/scipy-stubs/optimize/_trustregion_exact.pyi @@ -34,6 +34,7 @@ class IterativeSubproblem(BaseQuadraticSubproblem): lambda_current: Untyped def __init__( self, + /, x: Untyped, fun: UntypedCallable, jac: Untyped, @@ -43,4 +44,4 @@ class IterativeSubproblem(BaseQuadraticSubproblem): k_hard: float = 0.2, ) -> None: ... @override - def solve(self, trust_radius: float | np.float64) -> tuple[onp.ArrayND[np.float64], bool]: ... + def solve(self, /, trust_radius: float | np.float64) -> tuple[onp.ArrayND[np.float64], bool]: ... diff --git a/scipy-stubs/optimize/_trustregion_ncg.pyi b/scipy-stubs/optimize/_trustregion_ncg.pyi index 1c50305e..adfb4677 100644 --- a/scipy-stubs/optimize/_trustregion_ncg.pyi +++ b/scipy-stubs/optimize/_trustregion_ncg.pyi @@ -8,4 +8,4 @@ __all__: list[str] = [] class CGSteihaugSubproblem(BaseQuadraticSubproblem): @override - def solve(self, trust_radius: float | np.float64) -> Untyped: ... + def solve(self, /, trust_radius: float | np.float64) -> Untyped: ... diff --git a/scipy-stubs/optimize/lbfgsb.pyi b/scipy-stubs/optimize/lbfgsb.pyi index b2f3e896..65105e88 100644 --- a/scipy-stubs/optimize/lbfgsb.pyi +++ b/scipy-stubs/optimize/lbfgsb.pyi @@ -37,5 +37,5 @@ def fmin_l_bfgs_b( ) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class LbfgsInvHessProduct: - def __init__(self, sk: object, yk: object) -> None: ... - def todense(self) -> object: ... + def __init__(self, /, sk: object, yk: object) -> None: ... + def todense(self, /) -> object: ... diff --git a/scipy-stubs/optimize/nonlin.pyi b/scipy-stubs/optimize/nonlin.pyi index 0b752651..d1efbfee 100644 --- a/scipy-stubs/optimize/nonlin.pyi +++ b/scipy-stubs/optimize/nonlin.pyi @@ -19,29 +19,31 @@ __all__ = [ class BroydenFirst: def __init__( self, + /, alpha: object = ..., reduction_method: object = ..., max_rank: object = ..., ) -> None: ... - def todense(self) -> object: ... - def solve(self, f: object, tol: object = ...) -> object: ... - def matvec(self, f: object) -> object: ... - def rsolve(self, f: object, tol: object = ...) -> object: ... - def rmatvec(self, f: object) -> object: ... - def setup(self, x: object, F: object, func: object) -> None: ... + def todense(self, /) -> object: ... + def solve(self, /, f: object, tol: object = ...) -> object: ... + def matvec(self, /, f: object) -> object: ... + def rsolve(self, /, f: object, tol: object = ...) -> object: ... + def rmatvec(self, /, f: object) -> object: ... + def setup(self, /, x: object, F: object, func: object) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class InverseJacobian: - def __init__(self, jacobian: object) -> None: ... + def __init__(self, /, jacobian: object) -> None: ... @property - def shape(self) -> object: ... + def shape(self, /) -> object: ... @property - def dtype(self) -> object: ... + def dtype(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class KrylovJacobian: def __init__( self, + /, rdiff: object = ..., method: object = ..., inner_maxiter: object = ..., @@ -49,10 +51,10 @@ class KrylovJacobian: outer_k: object = ..., **kw: object, ) -> None: ... - def matvec(self, v: object) -> object: ... - def solve(self, rhs: object, tol: object = ...) -> object: ... - def update(self, x: object, f: object) -> object: ... - def setup(self, x: object, f: object, func: object) -> object: ... + def matvec(self, /, v: object) -> object: ... + def solve(self, /, rhs: object, tol: object = ...) -> object: ... + def update(self, /, x: object, f: object) -> object: ... + def setup(self, /, x: object, f: object, func: object) -> object: ... # Deprecated broyden1: object diff --git a/scipy-stubs/signal/_czt.pyi b/scipy-stubs/signal/_czt.pyi index 23f10db0..8288fd4d 100644 --- a/scipy-stubs/signal/_czt.pyi +++ b/scipy-stubs/signal/_czt.pyi @@ -9,9 +9,9 @@ _Float: TypeAlias = np.float64 | np.float32 _Complex: TypeAlias = np.complex128 | np.complex64 class CZT: - def __init__(self, n: int, m: int | None = None, w: onp.ToComplex | None = None, a: onp.ToComplex = 1 + 0j) -> None: ... - def __call__(self, x: onp.ToComplexND, *, axis: int = -1) -> onp.ArrayND[_Complex]: ... - def points(self) -> onp.ArrayND[_Complex]: ... + def __init__(self, /, n: int, m: int | None = None, w: onp.ToComplex | None = None, a: onp.ToComplex = 1 + 0j) -> None: ... + def __call__(self, /, x: onp.ToComplexND, *, axis: int = -1) -> onp.ArrayND[_Complex]: ... + def points(self, /) -> onp.ArrayND[_Complex]: ... class ZoomFFT(CZT): w: complex @@ -26,6 +26,7 @@ class ZoomFFT(CZT): def __init__( self, + /, n: int, fn: onp.ToFloat | onp.ToFloatND, m: int | None = None, diff --git a/scipy-stubs/signal/_ltisys.pyi b/scipy-stubs/signal/_ltisys.pyi index d3452211..1378aba4 100644 --- a/scipy-stubs/signal/_ltisys.pyi +++ b/scipy-stubs/signal/_ltisys.pyi @@ -28,66 +28,66 @@ class LinearTimeInvariant: @abstractmethod def __new__(cls, *system: Untyped, **kwargs: Untyped) -> Self: ... @property - def dt(self) -> Untyped: ... + def dt(self, /) -> Untyped: ... @property - def zeros(self) -> Untyped: ... + def zeros(self, /) -> Untyped: ... @property - def poles(self) -> Untyped: ... + def poles(self, /) -> Untyped: ... class lti(LinearTimeInvariant): def __new__(cls, *system: Untyped) -> Self: ... - def __init__(self, *system: Untyped) -> None: ... - def impulse(self, X0: Untyped | None = None, T: Untyped | None = None, N: Untyped | None = None) -> Untyped: ... - def step(self, X0: Untyped | None = None, T: Untyped | None = None, N: Untyped | None = None) -> Untyped: ... - def output(self, U: Untyped, T: Untyped, X0: Untyped | None = None) -> Untyped: ... - def bode(self, w: Untyped | None = None, n: int = 100) -> Untyped: ... - def freqresp(self, w: Untyped | None = None, n: int = 10000) -> Untyped: ... - def to_discrete(self, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... + def __init__(self, /, *system: Untyped) -> None: ... + def impulse(self, /, X0: Untyped | None = None, T: Untyped | None = None, N: Untyped | None = None) -> Untyped: ... + def step(self, /, X0: Untyped | None = None, T: Untyped | None = None, N: Untyped | None = None) -> Untyped: ... + def output(self, /, U: Untyped, T: Untyped, X0: Untyped | None = None) -> Untyped: ... + def bode(self, /, w: Untyped | None = None, n: int = 100) -> Untyped: ... + def freqresp(self, /, w: Untyped | None = None, n: int = 10000) -> Untyped: ... + def to_discrete(self, /, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... class dlti(LinearTimeInvariant): def __new__(cls, *system: Untyped, **kwargs: Untyped) -> Self: ... - def __init__(self, *system: Untyped, **kwargs: Untyped) -> None: ... - def impulse(self, x0: Untyped | None = None, t: Untyped | None = None, n: Untyped | None = None) -> Untyped: ... - def step(self, x0: Untyped | None = None, t: Untyped | None = None, n: Untyped | None = None) -> Untyped: ... - def output(self, u: Untyped, t: Untyped, x0: Untyped | None = None) -> Untyped: ... - def bode(self, w: Untyped | None = None, n: int = 100) -> Untyped: ... - def freqresp(self, w: Untyped | None = None, n: int = 10000, whole: bool = False) -> Untyped: ... + def __init__(self, /, *system: Untyped, **kwargs: Untyped) -> None: ... + def impulse(self, /, x0: Untyped | None = None, t: Untyped | None = None, n: Untyped | None = None) -> Untyped: ... + def step(self, /, x0: Untyped | None = None, t: Untyped | None = None, n: Untyped | None = None) -> Untyped: ... + def output(self, /, u: Untyped, t: Untyped, x0: Untyped | None = None) -> Untyped: ... + def bode(self, /, w: Untyped | None = None, n: int = 100) -> Untyped: ... + def freqresp(self, /, w: Untyped | None = None, n: int = 10000, whole: bool = False) -> Untyped: ... class TransferFunction(LinearTimeInvariant): def __new__(cls, *system: Untyped, **kwargs: Untyped) -> Self: ... - def __init__(self, *system: Untyped, **kwargs: Untyped) -> None: ... + def __init__(self, /, *system: Untyped, **kwargs: Untyped) -> None: ... @property - def num(self) -> Untyped: ... + def num(self, /) -> Untyped: ... @num.setter - def num(self, num: Untyped) -> None: ... + def num(self, /, num: Untyped) -> None: ... @property - def den(self) -> Untyped: ... + def den(self, /) -> Untyped: ... @den.setter - def den(self, den: Untyped) -> None: ... - def to_tf(self) -> Untyped: ... - def to_zpk(self) -> Untyped: ... - def to_ss(self) -> Untyped: ... + def den(self, /, den: Untyped) -> None: ... + def to_tf(self, /) -> Untyped: ... + def to_zpk(self, /) -> Untyped: ... + def to_ss(self, /) -> Untyped: ... class TransferFunctionContinuous(TransferFunction, lti): @override - def to_discrete(self, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... + def to_discrete(self, /, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... class TransferFunctionDiscrete(TransferFunction, dlti): ... class ZerosPolesGain(LinearTimeInvariant): def __new__(cls, *system: Untyped, **kwargs: Untyped) -> Self: ... - def __init__(self, *system: Untyped, **kwargs: Untyped) -> None: ... + def __init__(self, /, *system: Untyped, **kwargs: Untyped) -> None: ... @property - def gain(self) -> Untyped: ... + def gain(self, /) -> Untyped: ... @gain.setter - def gain(self, gain: Untyped) -> None: ... - def to_tf(self) -> Untyped: ... - def to_zpk(self) -> Untyped: ... - def to_ss(self) -> Untyped: ... + def gain(self, /, gain: Untyped) -> None: ... + def to_tf(self, /) -> Untyped: ... + def to_zpk(self, /) -> Untyped: ... + def to_ss(self, /) -> Untyped: ... class ZerosPolesGainContinuous(ZerosPolesGain, lti): @override - def to_discrete(self, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... + def to_discrete(self, /, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... class ZerosPolesGainDiscrete(ZerosPolesGain, dlti): ... @@ -95,41 +95,41 @@ class StateSpace(LinearTimeInvariant): __array_priority__: float __array_ufunc__: Untyped def __new__(cls, *system: Untyped, **kwargs: Untyped) -> Self: ... - def __init__(self, *system: Untyped, **kwargs: Untyped) -> None: ... - def __mul__(self, other: Untyped) -> Untyped: ... - def __rmul__(self, other: Untyped) -> Untyped: ... - def __neg__(self) -> Untyped: ... - def __add__(self, other: Untyped) -> Untyped: ... - def __sub__(self, other: Untyped) -> Untyped: ... - def __radd__(self, other: Untyped) -> Untyped: ... - def __rsub__(self, other: Untyped) -> Untyped: ... - def __truediv__(self, other: Untyped) -> Untyped: ... + def __init__(self, /, *system: Untyped, **kwargs: Untyped) -> None: ... + def __mul__(self, /, other: Untyped) -> Untyped: ... + def __rmul__(self, /, other: Untyped) -> Untyped: ... + def __neg__(self, /) -> Untyped: ... + def __add__(self, /, other: Untyped) -> Untyped: ... + def __sub__(self, /, other: Untyped) -> Untyped: ... + def __radd__(self, /, other: Untyped) -> Untyped: ... + def __rsub__(self, /, other: Untyped) -> Untyped: ... + def __truediv__(self, /, other: Untyped) -> Untyped: ... @property - def A(self) -> Untyped: ... + def A(self, /) -> Untyped: ... @A.setter - def A(self, A: Untyped) -> None: ... + def A(self, /, A: Untyped) -> None: ... @property - def B(self) -> Untyped: ... + def B(self, /) -> Untyped: ... @B.setter - def B(self, B: Untyped) -> None: ... + def B(self, /, B: Untyped) -> None: ... @property - def C(self) -> Untyped: ... + def C(self, /) -> Untyped: ... @C.setter - def C(self, C: Untyped) -> None: ... + def C(self, /, C: Untyped) -> None: ... @property - def D(self) -> Untyped: ... + def D(self, /) -> Untyped: ... @D.setter - def D(self, D: Untyped) -> None: ... - def to_tf(self, **kwargs: Untyped) -> Untyped: ... - def to_zpk(self, **kwargs: Untyped) -> Untyped: ... - def to_ss(self) -> Untyped: ... + def D(self, /, D: Untyped) -> None: ... + def to_tf(self, /, **kwargs: Untyped) -> Untyped: ... + def to_zpk(self, /, **kwargs: Untyped) -> Untyped: ... + def to_ss(self, /) -> Untyped: ... class StateSpaceContinuous(StateSpace, lti): @override - def to_discrete(self, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... + def to_discrete(self, /, dt: Untyped, method: str = "zoh", alpha: Untyped | None = None) -> Untyped: ... class Bunch: - def __init__(self, **kwds: Untyped) -> None: ... + def __init__(self, /, **kwds: Untyped) -> None: ... class StateSpaceDiscrete(StateSpace, dlti): ... diff --git a/scipy-stubs/signal/_short_time_fft.pyi b/scipy-stubs/signal/_short_time_fft.pyi index 00963320..aaf151f0 100644 --- a/scipy-stubs/signal/_short_time_fft.pyi +++ b/scipy-stubs/signal/_short_time_fft.pyi @@ -15,6 +15,7 @@ FFT_MODE_TYPE: TypeAlias = Literal["twosided", "centered", "onesided", "onesided class ShortTimeFFT: def __init__( self, + /, win: onp.ArrayND[np.inexact[Any]], hop: int, fs: float, @@ -52,34 +53,35 @@ class ShortTimeFFT: phase_shift: int | None = 0, ) -> Self: ... @property - def win(self) -> onp.ArrayND[np.inexact[Any]]: ... + def win(self, /) -> onp.ArrayND[np.inexact[Any]]: ... @property - def hop(self) -> int: ... + def hop(self, /) -> int: ... @property - def T(self) -> float: ... + def T(self, /) -> float: ... @T.setter - def T(self, v: float) -> None: ... + def T(self, /, v: float) -> None: ... @property - def fs(self) -> float: ... + def fs(self, /) -> float: ... @fs.setter - def fs(self, v: float) -> None: ... + def fs(self, /, v: float) -> None: ... @property - def fft_mode(self) -> FFT_MODE_TYPE: ... + def fft_mode(self, /) -> FFT_MODE_TYPE: ... @fft_mode.setter - def fft_mode(self, t: FFT_MODE_TYPE) -> None: ... + def fft_mode(self, /, t: FFT_MODE_TYPE) -> None: ... @property - def mfft(self) -> int: ... + def mfft(self, /) -> int: ... @mfft.setter - def mfft(self, n_: int) -> None: ... + def mfft(self, /, n_: int) -> None: ... @property - def scaling(self) -> Literal["magnitude", "psd"] | None: ... - def scale_to(self, scaling: Literal["magnitude", "psd"]) -> None: ... + def scaling(self, /) -> Literal["magnitude", "psd"] | None: ... + def scale_to(self, /, scaling: Literal["magnitude", "psd"]) -> None: ... @property - def phase_shift(self) -> int | None: ... + def phase_shift(self, /) -> int | None: ... @phase_shift.setter - def phase_shift(self, v: int | None) -> None: ... + def phase_shift(self, /, v: int | None) -> None: ... def stft( self, + /, x: onp.ArrayND[np.inexact[Any]], p0: int | None = None, p1: int | None = None, @@ -90,6 +92,7 @@ class ShortTimeFFT: ) -> onp.ArrayND[np.inexact[Any]]: ... def stft_detrend( self, + /, x: onp.ArrayND[np.inexact[Any]], detr: Callable[[onp.ArrayND[np.inexact[Any]]], onp.ArrayND[np.inexact[Any]]] | Literal["linear", "constant"] | None, p0: int | None = None, @@ -101,6 +104,7 @@ class ShortTimeFFT: ) -> onp.ArrayND[np.inexact[Any]]: ... def spectrogram( self, + /, x: onp.ArrayND[np.inexact[Any]], y: onp.ArrayND[np.inexact[Any]] | None = None, detr: Callable[[onp.ArrayND[np.inexact[Any]]], onp.ArrayND[np.inexact[Any]]] @@ -114,11 +118,12 @@ class ShortTimeFFT: axis: int = -1, ) -> onp.ArrayND[np.inexact[Any]]: ... @property - def dual_win(self) -> onp.ArrayND[np.inexact[Any]]: ... + def dual_win(self, /) -> onp.ArrayND[np.inexact[Any]]: ... @property - def invertible(self) -> bool: ... + def invertible(self, /) -> bool: ... def istft( self, + /, S: onp.ArrayND[np.inexact[Any]], k0: int = 0, k1: int | None = None, @@ -127,38 +132,39 @@ class ShortTimeFFT: t_axis: int = -1, ) -> onp.ArrayND[np.inexact[Any]]: ... @property - def fac_magnitude(self) -> float: ... + def fac_magnitude(self, /) -> float: ... @property - def fac_psd(self) -> float: ... + def fac_psd(self, /) -> float: ... @property - def m_num(self) -> int: ... + def m_num(self, /) -> int: ... @property - def m_num_mid(self) -> int: ... + def m_num_mid(self, /) -> int: ... @property - def k_min(self) -> int: ... + def k_min(self, /) -> int: ... @property - def p_min(self) -> int: ... - def k_max(self, n: int) -> int: ... - def p_max(self, n: int) -> int: ... - def p_num(self, n: int) -> int: ... + def p_min(self, /) -> int: ... + def k_max(self, /, n: int) -> int: ... + def p_max(self, /, n: int) -> int: ... + def p_num(self, /, n: int) -> int: ... @property - def lower_border_end(self) -> tuple[int, int]: ... - def upper_border_begin(self, n: int) -> tuple[int, int]: ... + def lower_border_end(self, /) -> tuple[int, int]: ... + def upper_border_begin(self, /, n: int) -> tuple[int, int]: ... @property - def delta_t(self) -> float: ... - def p_range(self, n: int, p0: int | None = None, p1: int | None = None) -> tuple[int, int]: ... - def t(self, n: int, p0: int | None = None, p1: int | None = None, k_offset: int = 0) -> onp.ArrayND[np.inexact[Any]]: ... - def nearest_k_p(self, k: int, left: bool = True) -> int: ... + def delta_t(self, /) -> float: ... + def p_range(self, /, n: int, p0: int | None = None, p1: int | None = None) -> tuple[int, int]: ... + def t(self, /, n: int, p0: int | None = None, p1: int | None = None, k_offset: int = 0) -> onp.ArrayND[np.inexact[Any]]: ... + def nearest_k_p(self, /, k: int, left: bool = True) -> int: ... @property - def delta_f(self) -> float: ... + def delta_f(self, /) -> float: ... @property - def f_pts(self) -> int: ... + def f_pts(self, /) -> int: ... @property - def onesided_fft(self) -> bool: ... + def onesided_fft(self, /) -> bool: ... @property - def f(self) -> onp.ArrayND[np.inexact[Any]]: ... + def f(self, /) -> onp.ArrayND[np.inexact[Any]]: ... def extent( self, + /, n: int, axes_seq: Literal["tf", "ft"] = "tf", center_bins: bool = False, diff --git a/scipy-stubs/signal/_upfirdn.pyi b/scipy-stubs/signal/_upfirdn.pyi index 6608f249..896e6963 100644 --- a/scipy-stubs/signal/_upfirdn.pyi +++ b/scipy-stubs/signal/_upfirdn.pyi @@ -12,6 +12,7 @@ class _UpFIRDn: def __init__(self, /, h: onp.ArrayND[np.floating[Any]], x_dtype: np.dtype[np.floating[Any]], up: int, down: int) -> None: ... def apply_filter( self, + /, x: onp.ArrayND[np.number[Any]], axis: int = -1, mode: _FIRMode = "constant", diff --git a/scipy-stubs/signal/ltisys.pyi b/scipy-stubs/signal/ltisys.pyi index fb44b390..d7deb418 100644 --- a/scipy-stubs/signal/ltisys.pyi +++ b/scipy-stubs/signal/ltisys.pyi @@ -77,95 +77,95 @@ class StateSpace: __array_priority__: object __array_ufunc__: object def __new__(cls, *system: object, **kwargs: object) -> Self: ... - def __init__(self, *system: object, **kwargs: object) -> None: ... - def __mul__(self, other: object) -> object: ... - def __rmul__(self, other: object) -> object: ... - def __neg__(self) -> object: ... - def __add__(self, other: object) -> object: ... - def __sub__(self, other: object) -> object: ... - def __radd__(self, other: object) -> object: ... - def __rsub__(self, other: object) -> object: ... - def __truediv__(self, other: object) -> object: ... + def __init__(self, /, *system: object, **kwargs: object) -> None: ... + def __mul__(self, /, other: object) -> object: ... + def __rmul__(self, /, other: object) -> object: ... + def __neg__(self, /) -> object: ... + def __add__(self, /, other: object) -> object: ... + def __sub__(self, /, other: object) -> object: ... + def __radd__(self, /, other: object) -> object: ... + def __rsub__(self, /, other: object) -> object: ... + def __truediv__(self, /, other: object) -> object: ... @property - def A(self) -> object: ... + def A(self, /) -> object: ... @A.setter - def A(self, A: object) -> None: ... + def A(self, /, A: object) -> None: ... @property - def B(self) -> object: ... + def B(self, /) -> object: ... @B.setter - def B(self, B: object) -> None: ... + def B(self, /, B: object) -> None: ... @property - def C(self) -> object: ... + def C(self, /) -> object: ... @C.setter - def C(self, C: object) -> None: ... + def C(self, /, C: object) -> None: ... @property - def D(self) -> object: ... + def D(self, /) -> object: ... @D.setter - def D(self, D: object) -> None: ... - def to_tf(self, **kwargs: object) -> object: ... - def to_zpk(self, **kwargs: object) -> object: ... - def to_ss(self) -> object: ... + def D(self, /, D: object) -> None: ... + def to_tf(self, /, **kwargs: object) -> object: ... + def to_zpk(self, /, **kwargs: object) -> object: ... + def to_ss(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class TransferFunction: def __new__(cls, *system: object, **kwargs: object) -> Self: ... - def __init__(self, *system: object, **kwargs: object) -> None: ... + def __init__(self, /, *system: object, **kwargs: object) -> None: ... @property - def num(self) -> object: ... + def num(self, /) -> object: ... @num.setter - def num(self, num: object) -> None: ... + def num(self, /, num: object) -> None: ... @property - def den(self) -> object: ... + def den(self, /) -> object: ... @den.setter - def den(self, den: object) -> None: ... - def to_tf(self) -> object: ... - def to_zpk(self) -> object: ... - def to_ss(self) -> object: ... + def den(self, /, den: object) -> None: ... + def to_tf(self, /) -> object: ... + def to_zpk(self, /) -> object: ... + def to_ss(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class ZerosPolesGain: def __new__(cls, *system: object, **kwargs: object) -> Self: ... - def __init__(self, *system: object, **kwargs: object) -> None: ... + def __init__(self, /, *system: object, **kwargs: object) -> None: ... @property - def zeros(self) -> object: ... + def zeros(self, /) -> object: ... @zeros.setter - def zeros(self, zeros: object) -> None: ... + def zeros(self, /, zeros: object) -> None: ... @property - def poles(self) -> object: ... + def poles(self, /) -> object: ... @poles.setter - def poles(self, poles: object) -> None: ... + def poles(self, /, poles: object) -> None: ... @property - def gain(self) -> object: ... + def gain(self, /) -> object: ... @gain.setter - def gain(self, gain: object) -> None: ... - def to_tf(self) -> object: ... - def to_zpk(self) -> object: ... - def to_ss(self) -> object: ... + def gain(self, /, gain: object) -> None: ... + def to_tf(self, /) -> object: ... + def to_zpk(self, /) -> object: ... + def to_ss(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class lti: def __new__(cls, *system: object) -> Self: ... - def __init__(self, *system: object) -> None: ... - def impulse(self, X0: object = ..., T: object = ..., N: object = ...) -> object: ... - def step(self, X0: object = ..., T: object = ..., N: object = ...) -> object: ... - def output(self, U: object, T: object, X0: object = ...) -> object: ... - def bode(self, w: object = ..., n: object = ...) -> object: ... - def freqresp(self, w: object = ..., n: object = ...) -> object: ... - def to_discrete(self, dt: object, method: object = ..., alpha: object = ...) -> object: ... + def __init__(self, /, *system: object) -> None: ... + def impulse(self, /, X0: object = ..., T: object = ..., N: object = ...) -> object: ... + def step(self, /, X0: object = ..., T: object = ..., N: object = ...) -> object: ... + def output(self, /, U: object, T: object, X0: object = ...) -> object: ... + def bode(self, /, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, /, w: object = ..., n: object = ...) -> object: ... + def to_discrete(self, /, dt: object, method: object = ..., alpha: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class dlti: def __new__(cls, *system: object, **kwargs: object) -> Self: ... - def __init__(self, *system: object, **kwargs: object) -> None: ... + def __init__(self, /, *system: object, **kwargs: object) -> None: ... @property - def dt(self) -> object: ... + def dt(self, /) -> object: ... @dt.setter - def dt(self, dt: object) -> None: ... - def impulse(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... - def step(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... - def output(self, u: object, t: object, x0: object = ...) -> object: ... - def bode(self, w: object = ..., n: object = ...) -> object: ... - def freqresp(self, w: object = ..., n: object = ..., whole: object = ...) -> object: ... + def dt(self, /, dt: object) -> None: ... + def impulse(self, /, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def step(self, /, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def output(self, /, u: object, t: object, x0: object = ...) -> object: ... + def bode(self, /, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, /, w: object = ..., n: object = ..., whole: object = ...) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def lsim(system: object, U: object, T: object, X0: object = ..., interp: object = ...) -> object: ... diff --git a/scipy-stubs/signal/signaltools.pyi b/scipy-stubs/signal/signaltools.pyi index 2f9cdd89..1954fb70 100644 --- a/scipy-stubs/signal/signaltools.pyi +++ b/scipy-stubs/signal/signaltools.pyi @@ -71,16 +71,16 @@ def firwin( @deprecated("will be removed in SciPy v2.0.0") class dlti: def __new__(cls, *system: object, **kwargs: object) -> Self: ... - def __init__(self, *system: object, **kwargs: object) -> None: ... + def __init__(self, /, *system: object, **kwargs: object) -> None: ... @property - def dt(self) -> object: ... + def dt(self, /) -> object: ... @dt.setter - def dt(self, dt: object) -> None: ... - def impulse(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... - def step(self, x0: object = ..., t: object = ..., n: object = ...) -> object: ... - def output(self, u: object, t: object, x0: object = ...) -> object: ... - def bode(self, w: object = ..., n: object = ...) -> object: ... - def freqresp(self, w: object = ..., n: object = ..., whole: object = ...) -> object: ... + def dt(self, /, dt: object) -> None: ... + def impulse(self, /, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def step(self, /, x0: object = ..., t: object = ..., n: object = ...) -> object: ... + def output(self, /, u: object, t: object, x0: object = ...) -> object: ... + def bode(self, /, w: object = ..., n: object = ...) -> object: ... + def freqresp(self, /, w: object = ..., n: object = ..., whole: object = ...) -> object: ... # upfirdn def upfirdn( diff --git a/scipy-stubs/sparse/_base.pyi b/scipy-stubs/sparse/_base.pyi index 95e3ae83..1d3737e8 100644 --- a/scipy-stubs/sparse/_base.pyi +++ b/scipy-stubs/sparse/_base.pyi @@ -16,34 +16,34 @@ class _spbase: __array_priority__: float maxprint: Final = 50 @property - def ndim(self) -> int: ... - def __init__(self, arg1: Untyped, maxprint: int | None = 50) -> None: ... + def ndim(self, /) -> int: ... + def __init__(self, /, arg1: Untyped, maxprint: int | None = 50) -> None: ... @property - def shape(self) -> tuple[int, ...]: ... - def reshape(self, *args: Untyped, **kwargs: Untyped) -> Untyped: ... - def resize(self, shape: tuple[int, int]) -> None: ... - def astype(self, dtype: Untyped, casting: str = "unsafe", copy: bool = True) -> Untyped: ... - def __iter__(self) -> Untyped: ... - def count_nonzero(self) -> int: ... + def shape(self, /) -> tuple[int, ...]: ... + def reshape(self, /, *args: Untyped, **kwargs: Untyped) -> Untyped: ... + def resize(self, /, shape: tuple[int, int]) -> None: ... + def astype(self, /, dtype: Untyped, casting: str = "unsafe", copy: bool = True) -> Untyped: ... + def __iter__(self, /) -> Untyped: ... + def count_nonzero(self, /) -> int: ... @property - def nnz(self) -> int: ... + def nnz(self, /) -> int: ... @property - def size(self) -> int: ... + def size(self, /) -> int: ... @property - def format(self) -> str: ... + def format(self, /) -> str: ... @property - def T(self) -> Self: ... + def T(self, /) -> Self: ... @property - def real(self) -> Self: ... + def real(self, /) -> Self: ... @property - def imag(self) -> Self: ... + def imag(self, /) -> Self: ... def __bool__(self, /) -> bool: ... - def asformat(self, format: Untyped, copy: bool = False) -> Untyped: ... - def multiply(self, other: Untyped) -> Untyped: ... - def maximum(self, other: Untyped) -> Untyped: ... - def minimum(self, other: Untyped) -> Untyped: ... - def dot(self, other: Untyped) -> Untyped: ... - def power(self, n: Untyped, dtype: Untyped | None = None) -> Self: ... + def asformat(self, /, format: Untyped, copy: bool = False) -> Untyped: ... + def multiply(self, /, other: Untyped) -> Untyped: ... + def maximum(self, /, other: Untyped) -> Untyped: ... + def minimum(self, /, other: Untyped) -> Untyped: ... + def dot(self, /, other: Untyped) -> Untyped: ... + def power(self, /, n: Untyped, dtype: Untyped | None = None) -> Self: ... def __lt__(self, other: Untyped, /) -> Untyped: ... def __gt__(self, other: Untyped, /) -> Untyped: ... def __le__(self, other: Untyped, /) -> Untyped: ... @@ -62,25 +62,25 @@ class _spbase: def __div__(self, other: Untyped, /) -> Untyped: ... def __neg__(self, /) -> Self: ... def __pow__(self, other: Untyped, /) -> Untyped: ... - def transpose(self, axes: Untyped | None = None, copy: bool = False) -> Self: ... - def conjugate(self, copy: bool = True) -> Self: ... - def conj(self, copy: bool = True) -> Self: ... - def nonzero(self) -> Untyped: ... - def todense(self, order: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... - def toarray(self, order: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... - def tocsr(self, copy: bool = False) -> Untyped: ... - def todok(self, copy: bool = False) -> Untyped: ... - def tocoo(self, copy: bool = False) -> Untyped: ... - def tolil(self, copy: bool = False) -> Untyped: ... - def todia(self, copy: bool = False) -> Untyped: ... - def tobsr(self, blocksize: tuple[int, int] | None = None, copy: bool = False) -> Untyped: ... - def tocsc(self, copy: bool = False) -> Untyped: ... - def copy(self) -> Self: ... - def sum(self, axis: Untyped | None = None, dtype: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... - def mean(self, axis: Untyped | None = None, dtype: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... - def diagonal(self, k: int = 0) -> Untyped: ... - def trace(self, offset: int = 0) -> Untyped: ... - def setdiag(self, values: Untyped, k: int = 0) -> None: ... + def transpose(self, /, axes: Untyped | None = None, copy: bool = False) -> Self: ... + def conjugate(self, /, copy: bool = True) -> Self: ... + def conj(self, /, copy: bool = True) -> Self: ... + def nonzero(self, /) -> Untyped: ... + def todense(self, /, order: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... + def toarray(self, /, order: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... + def tocsr(self, /, copy: bool = False) -> Untyped: ... + def todok(self, /, copy: bool = False) -> Untyped: ... + def tocoo(self, /, copy: bool = False) -> Untyped: ... + def tolil(self, /, copy: bool = False) -> Untyped: ... + def todia(self, /, copy: bool = False) -> Untyped: ... + def tobsr(self, /, blocksize: tuple[int, int] | None = None, copy: bool = False) -> Untyped: ... + def tocsc(self, /, copy: bool = False) -> Untyped: ... + def copy(self, /) -> Self: ... + def sum(self, /, axis: Untyped | None = None, dtype: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... + def mean(self, /, axis: Untyped | None = None, dtype: Untyped | None = None, out: Untyped | None = None) -> Untyped: ... + def diagonal(self, /, k: int = 0) -> Untyped: ... + def trace(self, /, offset: int = 0) -> Untyped: ... + def setdiag(self, /, values: Untyped, k: int = 0) -> None: ... class sparray: ... diff --git a/scipy-stubs/sparse/_bsr.pyi b/scipy-stubs/sparse/_bsr.pyi index 5cdaf7a3..d38e7ca6 100644 --- a/scipy-stubs/sparse/_bsr.pyi +++ b/scipy-stubs/sparse/_bsr.pyi @@ -16,6 +16,7 @@ class _bsr_base(_cs_matrix, _minmax_mixin): indptr: Untyped def __init__( self, + /, arg1: Untyped, shape: onp.ToInt | Sequence[onp.ToInt] | None = None, dtype: npt.DTypeLike | None = None, @@ -23,7 +24,7 @@ class _bsr_base(_cs_matrix, _minmax_mixin): blocksize: tuple[int, int] | None = None, ) -> None: ... @property - def blocksize(self) -> tuple[int, int]: ... + def blocksize(self, /) -> tuple[int, int]: ... class bsr_array(_bsr_base, sparray): ... class bsr_matrix(spmatrix, _bsr_base): ... diff --git a/scipy-stubs/sparse/_compressed.pyi b/scipy-stubs/sparse/_compressed.pyi index dc958158..0f30652a 100644 --- a/scipy-stubs/sparse/_compressed.pyi +++ b/scipy-stubs/sparse/_compressed.pyi @@ -14,30 +14,31 @@ class _cs_matrix(_data_matrix, _minmax_mixin, IndexMixin): indptr: Untyped def __init__( self: Untyped, + /, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False, ) -> None: ... @override - def count_nonzero(self, axis: Untyped | None = None) -> int: ... - def check_format(self, full_check: bool = True) -> Untyped: ... - def eliminate_zeros(self) -> Untyped: ... + def count_nonzero(self, /, axis: Untyped | None = None) -> int: ... + def check_format(self, /, full_check: bool = True) -> Untyped: ... + def eliminate_zeros(self, /) -> Untyped: ... @property - def has_canonical_format(self) -> bool: ... + def has_canonical_format(self, /) -> bool: ... @has_canonical_format.setter - def has_canonical_format(self, val: bool) -> None: ... - def sum_duplicates(self) -> Untyped: ... + def has_canonical_format(self, /, val: bool) -> None: ... + def sum_duplicates(self, /) -> Untyped: ... @property - def has_sorted_indices(self) -> bool: ... + def has_sorted_indices(self, /) -> bool: ... @has_sorted_indices.setter - def has_sorted_indices(self, val: bool) -> None: ... - def sorted_indices(self) -> Untyped: ... - def sort_indices(self) -> None: ... - def prune(self) -> None: ... + def has_sorted_indices(self, /, val: bool) -> None: ... + def sorted_indices(self, /) -> Untyped: ... + def sort_indices(self, /) -> None: ... + def prune(self, /) -> None: ... @overload # type: ignore[explicit-override] - def resize(self, shape: tuple[int, int]) -> None: ... + def resize(self, /, shape: tuple[int, int]) -> None: ... @overload - def resize(self, *shape: int) -> None: ... + def resize(self, /, *shape: int) -> None: ... @override - def tocoo(self, copy: bool = True) -> _coo_base: ... + def tocoo(self, /, copy: bool = True) -> _coo_base: ... diff --git a/scipy-stubs/sparse/_coo.pyi b/scipy-stubs/sparse/_coo.pyi index ddef547e..dbf657bc 100644 --- a/scipy-stubs/sparse/_coo.pyi +++ b/scipy-stubs/sparse/_coo.pyi @@ -13,23 +13,24 @@ class _coo_base(_data_matrix, _minmax_mixin): has_canonical_format: bool def __init__( self, + /, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False, ) -> None: ... @property - def row(self) -> Untyped: ... + def row(self, /) -> Untyped: ... @row.setter - def row(self, new_row: Untyped) -> None: ... + def row(self, /, new_row: Untyped) -> None: ... @property - def col(self) -> Untyped: ... + def col(self, /) -> Untyped: ... @col.setter - def col(self, new_col: Untyped) -> None: ... + def col(self, /, new_col: Untyped) -> None: ... @override - def reshape(self, *args: Untyped, **kwargs: Untyped) -> Untyped: ... - def sum_duplicates(self) -> None: ... - def eliminate_zeros(self) -> Untyped: ... + def reshape(self, /, *args: Untyped, **kwargs: Untyped) -> Untyped: ... + def sum_duplicates(self, /) -> None: ... + def eliminate_zeros(self, /) -> Untyped: ... class coo_array(_coo_base, sparray): ... class coo_matrix(spmatrix, _coo_base): ... diff --git a/scipy-stubs/sparse/_csr.pyi b/scipy-stubs/sparse/_csr.pyi index 7434bb35..2a5938a6 100644 --- a/scipy-stubs/sparse/_csr.pyi +++ b/scipy-stubs/sparse/_csr.pyi @@ -10,7 +10,7 @@ __all__ = ["csr_array", "csr_matrix", "isspmatrix_csr"] class _csr_base(_cs_matrix): @override - def tobsr(self, blocksize: tuple[int, int] | None = None, copy: bool = True) -> _bsr_base: ... + def tobsr(self, /, blocksize: tuple[int, int] | None = None, copy: bool = True) -> _bsr_base: ... class csr_array(_csr_base, sparray): ... class csr_matrix(spmatrix, _csr_base): ... diff --git a/scipy-stubs/sparse/_data.pyi b/scipy-stubs/sparse/_data.pyi index 07a514c6..f05d5746 100644 --- a/scipy-stubs/sparse/_data.pyi +++ b/scipy-stubs/sparse/_data.pyi @@ -38,9 +38,9 @@ class _data_matrix(_spbase): def trunc(self, /) -> Self: ... class _minmax_mixin: - def max(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... - def min(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... - def nanmax(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... - def nanmin(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... - def argmax(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... - def argmin(self, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def max(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def min(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def nanmax(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def nanmin(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def argmax(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... + def argmin(self, /, axis: int | None = None, out: Untyped | None = None) -> Untyped: ... diff --git a/scipy-stubs/sparse/_dia.pyi b/scipy-stubs/sparse/_dia.pyi index c2968d23..145511b1 100644 --- a/scipy-stubs/sparse/_dia.pyi +++ b/scipy-stubs/sparse/_dia.pyi @@ -11,15 +11,16 @@ class _dia_base(_data_matrix): offsets: Untyped def __init__( self, + /, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False, ) -> None: ... @override - def resize(self, *shape: int) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] + def resize(self, /, *shape: int) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] @override - def count_nonzero(self) -> int: ... + def count_nonzero(self, /) -> int: ... class dia_array(_dia_base, sparray): ... class dia_matrix(spmatrix, _dia_base): ... diff --git a/scipy-stubs/sparse/_dok.pyi b/scipy-stubs/sparse/_dok.pyi index 6a2c75a9..bf77699b 100644 --- a/scipy-stubs/sparse/_dok.pyi +++ b/scipy-stubs/sparse/_dok.pyi @@ -11,9 +11,11 @@ __all__ = ["dok_array", "dok_matrix", "isspmatrix_dok"] class _dok_base(_spbase, IndexMixin, dict[tuple[int, ...], Untyped]): # type: ignore[misc] # pyright: ignore[reportIncompatibleMethodOverride] dtype: Untyped - def __init__(self, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False) -> None: ... + def __init__( + self, /, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False + ) -> None: ... @override - def update(self, val: Untyped) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] + def update(self, /, val: Untyped) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] @override def setdefault(self, key: Untyped, default: Untyped | None = None, /) -> Untyped: ... @override @@ -26,20 +28,20 @@ class _dok_base(_spbase, IndexMixin, dict[tuple[int, ...], Untyped]): # type: i def __ior__(self, other: Never, /) -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] @override def get(self, key: Untyped, /, default: float = 0.0) -> Untyped: ... # type: ignore[override] - def conjtransp(self) -> Untyped: ... + def conjtransp(self, /) -> Untyped: ... @classmethod @override def fromkeys(cls, iterable: Iterable[tuple[int, ...]], value: int = 1, /) -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] @override - def count_nonzero(self) -> int: ... + def count_nonzero(self, /) -> int: ... class dok_array(_dok_base, sparray): ... # type: ignore[misc] class dok_matrix(spmatrix, _dok_base): # type: ignore[misc] @property @override - def shape(self) -> tuple[int, int]: ... + def shape(self, /) -> tuple[int, int]: ... @override - def get_shape(self) -> tuple[int, int]: ... + def get_shape(self, /) -> tuple[int, int]: ... def isspmatrix_dok(x: Untyped) -> bool: ... diff --git a/scipy-stubs/sparse/_lil.pyi b/scipy-stubs/sparse/_lil.pyi index 4df79311..57429428 100644 --- a/scipy-stubs/sparse/_lil.pyi +++ b/scipy-stubs/sparse/_lil.pyi @@ -13,17 +13,18 @@ class _lil_base(_spbase, IndexMixin): data: Untyped def __init__( self, + /, arg1: Untyped, shape: Untyped | None = None, dtype: Untyped | None = None, copy: bool = False, ) -> None: ... - def getrowview(self, i: int) -> Untyped: ... - def getrow(self, i: int) -> Untyped: ... + def getrowview(self, /, i: int) -> Untyped: ... + def getrow(self, /, i: int) -> Untyped: ... @override - def resize(self, *shape: int) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] + def resize(self, /, *shape: int) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] @override - def count_nonzero(self) -> int: ... + def count_nonzero(self, /) -> int: ... def isspmatrix_lil(x: Untyped) -> Untyped: ... diff --git a/scipy-stubs/sparse/_matrix.pyi b/scipy-stubs/sparse/_matrix.pyi index b37b86e4..7042a82f 100644 --- a/scipy-stubs/sparse/_matrix.pyi +++ b/scipy-stubs/sparse/_matrix.pyi @@ -2,16 +2,16 @@ from scipy._typing import Untyped class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: Untyped, /) -> Untyped: ... def __rmul__(self, other: Untyped, /) -> Untyped: ... def __pow__(self, power: Untyped, /) -> Untyped: ... - def set_shape(self, shape: Untyped) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> Untyped: ... - def getmaxprint(self) -> Untyped: ... - def getformat(self) -> Untyped: ... - def getnnz(self, axis: Untyped | None = None) -> Untyped: ... - def getH(self) -> Untyped: ... - def getcol(self, j: int) -> Untyped: ... - def getrow(self, i: int) -> Untyped: ... + def set_shape(self, /, shape: Untyped) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> Untyped: ... + def getmaxprint(self, /) -> Untyped: ... + def getformat(self, /) -> Untyped: ... + def getnnz(self, /, axis: Untyped | None = None) -> Untyped: ... + def getH(self, /) -> Untyped: ... + def getcol(self, /, j: int) -> Untyped: ... + def getrow(self, /, i: int) -> Untyped: ... diff --git a/scipy-stubs/sparse/base.pyi b/scipy-stubs/sparse/base.pyi index 39007962..eb6c1f0b 100644 --- a/scipy-stubs/sparse/base.pyi +++ b/scipy-stubs/sparse/base.pyi @@ -33,19 +33,19 @@ class SparseEfficiencyWarning(UserWarning): ... @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def issparse(x: object) -> object: ... diff --git a/scipy-stubs/sparse/bsr.pyi b/scipy-stubs/sparse/bsr.pyi index 3db58b31..f3dfc600 100644 --- a/scipy-stubs/sparse/bsr.pyi +++ b/scipy-stubs/sparse/bsr.pyi @@ -25,19 +25,19 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class bsr_matrix: ... diff --git a/scipy-stubs/sparse/coo.pyi b/scipy-stubs/sparse/coo.pyi index 4318c5fd..a3ca8a1a 100644 --- a/scipy-stubs/sparse/coo.pyi +++ b/scipy-stubs/sparse/coo.pyi @@ -31,19 +31,19 @@ class SparseEfficiencyWarning(UserWarning): ... @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class coo_matrix: ... diff --git a/scipy-stubs/sparse/csc.pyi b/scipy-stubs/sparse/csc.pyi index 837126e7..636fb26a 100644 --- a/scipy-stubs/sparse/csc.pyi +++ b/scipy-stubs/sparse/csc.pyi @@ -13,19 +13,19 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class csc_matrix: ... diff --git a/scipy-stubs/sparse/csr.pyi b/scipy-stubs/sparse/csr.pyi index 0a6322a8..e6aa4ddd 100644 --- a/scipy-stubs/sparse/csr.pyi +++ b/scipy-stubs/sparse/csr.pyi @@ -15,19 +15,19 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class csr_matrix: ... diff --git a/scipy-stubs/sparse/dia.pyi b/scipy-stubs/sparse/dia.pyi index 7d74fea9..77340180 100644 --- a/scipy-stubs/sparse/dia.pyi +++ b/scipy-stubs/sparse/dia.pyi @@ -17,19 +17,19 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object | None = None) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object | None = None) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class dia_matrix: ... diff --git a/scipy-stubs/sparse/dok.pyi b/scipy-stubs/sparse/dok.pyi index 1ccb02f5..038ca9c2 100644 --- a/scipy-stubs/sparse/dok.pyi +++ b/scipy-stubs/sparse/dok.pyi @@ -22,45 +22,46 @@ __all__ = [ @deprecated("will be removed in SciPy v2.0.0") class spmatrix: @property - def shape(self) -> tuple[int, ...]: ... + def shape(self, /) -> tuple[int, ...]: ... def __mul__(self, other: object, /) -> object: ... def __rmul__(self, other: object, /) -> object: ... def __pow__(self, power: object, /) -> object: ... - def set_shape(self, shape: object) -> None: ... - def get_shape(self) -> tuple[int, ...]: ... - def asfptype(self) -> object: ... - def getmaxprint(self) -> object: ... - def getformat(self) -> object: ... - def getnnz(self, axis: object = ...) -> object: ... - def getH(self) -> object: ... - def getcol(self, j: int) -> object: ... - def getrow(self, i: int) -> object: ... + def set_shape(self, /, shape: object) -> None: ... + def get_shape(self, /) -> tuple[int, ...]: ... + def asfptype(self, /) -> object: ... + def getmaxprint(self, /) -> object: ... + def getformat(self, /) -> object: ... + def getnnz(self, /, axis: object = ...) -> object: ... + def getH(self, /) -> object: ... + def getcol(self, /, j: int) -> object: ... + def getrow(self, /, i: int) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class dok_matrix: def __init__( self, + /, arg1: object, shape: object = ..., dtype: object = ..., copy: object = ..., ) -> None: ... - def update(self, val: object) -> None: ... + def update(self, /, val: object) -> None: ... def setdefault(self, key: object, default: object = ..., /) -> object: ... def __delitem__(self, key: object, /) -> None: ... def __or__(self, other: object, /) -> object: ... def __ror__(self, other: object, /) -> object: ... def __ior__(self, other: object, /) -> Self: ... - def __iter__(self) -> object: ... - def __reversed__(self) -> object: ... - def get(self, key: object, default: object = ...) -> object: ... - def conjtransp(self) -> object: ... + def __iter__(self, /) -> object: ... + def __reversed__(self, /) -> object: ... + def get(self, /, key: object, default: object = ...) -> object: ... + def conjtransp(self, /) -> object: ... @classmethod def fromkeys(cls, iterable: object, value: object = ..., /) -> Self: ... @property - def shape(self) -> object: ... - def get_shape(self) -> object: ... - def set_shape(self, shape: object) -> None: ... + def shape(self, /) -> object: ... + def get_shape(self, /) -> object: ... + def set_shape(self, /, shape: object) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class IndexMixin: diff --git a/scipy-stubs/sparse/lil.pyi b/scipy-stubs/sparse/lil.pyi index c6453d67..834376a9 100644 --- a/scipy-stubs/sparse/lil.pyi +++ b/scipy-stubs/sparse/lil.pyi @@ -7,14 +7,15 @@ __all__ = ["isspmatrix_lil", "lil_array", "lil_matrix"] class lil_array: def __init__( self, + /, arg1: object, shape: object = ..., dtype: object = ..., copy: object = ..., ) -> None: ... - def getrowview(self, i: object) -> object: ... - def getrow(self, i: object) -> object: ... - def resize(self, *shape: int) -> None: ... + def getrowview(self, /, i: object) -> object: ... + def getrow(self, /, i: object) -> object: ... + def resize(self, /, *shape: int) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class lil_matrix: ... diff --git a/scipy-stubs/sparse/linalg/_eigen/arpack/arpack.pyi b/scipy-stubs/sparse/linalg/_eigen/arpack/arpack.pyi index 7f055aac..8a67fb1a 100644 --- a/scipy-stubs/sparse/linalg/_eigen/arpack/arpack.pyi +++ b/scipy-stubs/sparse/linalg/_eigen/arpack/arpack.pyi @@ -21,23 +21,23 @@ DSEUPD_ERRORS: Final[dict[int, str]] SSEUPD_ERRORS: Final[dict[int, str]] class ArpackError(RuntimeError): - def __init__(self, info: Untyped, infodict: Untyped = ...) -> None: ... + def __init__(self, /, info: Untyped, infodict: Untyped = ...) -> None: ... class ArpackNoConvergence(ArpackError): eigenvalues: Untyped eigenvectors: Untyped - def __init__(self, msg: Untyped, eigenvalues: Untyped, eigenvectors: Untyped) -> None: ... + def __init__(self, /, msg: Untyped, eigenvalues: Untyped, eigenvectors: Untyped) -> None: ... def choose_ncv(k: Untyped) -> Untyped: ... class SpLuInv(LinearOperator): M_lu: Untyped isreal: Untyped - def __init__(self, M: Untyped) -> None: ... + def __init__(self, /, M: Untyped) -> None: ... class LuInv(LinearOperator): M_lu: Untyped - def __init__(self, M: Untyped) -> None: ... + def __init__(self, /, M: Untyped) -> None: ... def gmres_loose(A: Untyped, b: Untyped, tol: Untyped) -> Untyped: ... @@ -45,7 +45,7 @@ class IterInv(LinearOperator): M: Untyped ifunc: Untyped tol: Untyped - def __init__(self, M: Untyped, ifunc: Untyped = ..., tol: float = 0) -> None: ... + def __init__(self, /, M: Untyped, ifunc: Untyped = ..., tol: float = 0) -> None: ... class IterOpInv(LinearOperator): A: Untyped @@ -57,7 +57,7 @@ class IterOpInv(LinearOperator): @property @override def dtype(self, /) -> np.dtype[np.generic]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleVariableOverride] - def __init__(self, A: Untyped, M: Untyped, sigma: Untyped, ifunc: Untyped = ..., tol: float = 0) -> None: ... + def __init__(self, /, A: Untyped, M: Untyped, sigma: Untyped, ifunc: Untyped = ..., tol: float = 0) -> None: ... def get_inv_matvec(M: Untyped, hermitian: bool = False, tol: float = 0) -> Untyped: ... def get_OPinv_matvec(A: Untyped, M: Untyped, sigma: Untyped, hermitian: bool = False, tol: float = 0) -> Untyped: ... diff --git a/scipy-stubs/sparse/linalg/_expm_multiply.pyi b/scipy-stubs/sparse/linalg/_expm_multiply.pyi index 07a1a633..3d0bb826 100644 --- a/scipy-stubs/sparse/linalg/_expm_multiply.pyi +++ b/scipy-stubs/sparse/linalg/_expm_multiply.pyi @@ -14,8 +14,8 @@ def expm_multiply( ) -> Untyped: ... class LazyOperatorNormInfo: - def __init__(self, A: Untyped, A_1_norm: Untyped | None = None, ell: int = 2, scale: int = 1) -> None: ... - def set_scale(self, scale: Untyped) -> None: ... - def onenorm(self) -> Untyped: ... - def d(self, p: Untyped) -> Untyped: ... - def alpha(self, p: Untyped) -> Untyped: ... + def __init__(self, /, A: Untyped, A_1_norm: Untyped | None = None, ell: int = 2, scale: int = 1) -> None: ... + def set_scale(self, /, scale: Untyped) -> None: ... + def onenorm(self, /) -> Untyped: ... + def d(self, /, p: Untyped) -> Untyped: ... + def alpha(self, /, p: Untyped) -> Untyped: ... diff --git a/scipy-stubs/sparse/linalg/_interface.pyi b/scipy-stubs/sparse/linalg/_interface.pyi index 4d9ed9e2..36be9297 100644 --- a/scipy-stubs/sparse/linalg/_interface.pyi +++ b/scipy-stubs/sparse/linalg/_interface.pyi @@ -49,7 +49,7 @@ class LinearOperator: def H(self, /) -> _AdjointLinearOperator: ... def transpose(self, /) -> _TransposedLinearOperator: ... @property - def T(self) -> _TransposedLinearOperator: ... + def T(self, /) -> _TransposedLinearOperator: ... class _CustomLinearOperator(LinearOperator): args: UntypedTuple @@ -67,33 +67,33 @@ class _CustomLinearOperator(LinearOperator): class _AdjointLinearOperator(LinearOperator): A: LinearOperator args: tuple[LinearOperator] - def __init__(self, A: LinearOperator) -> None: ... + def __init__(self, /, A: LinearOperator) -> None: ... class _TransposedLinearOperator(LinearOperator): A: LinearOperator args: tuple[LinearOperator] - def __init__(self, A: LinearOperator) -> None: ... + def __init__(self, /, A: LinearOperator) -> None: ... class _SumLinearOperator(LinearOperator): args: tuple[LinearOperator, LinearOperator] - def __init__(self, A: LinearOperator, B: LinearOperator) -> None: ... + def __init__(self, /, A: LinearOperator, B: LinearOperator) -> None: ... class _ProductLinearOperator(LinearOperator): args: tuple[LinearOperator, LinearOperator] - def __init__(self, A: LinearOperator, B: LinearOperator) -> None: ... + def __init__(self, /, A: LinearOperator, B: LinearOperator) -> None: ... class _ScaledLinearOperator(LinearOperator): args: tuple[LinearOperator, onp.ToScalar] - def __init__(self, A: LinearOperator, alpha: onp.ToScalar) -> None: ... + def __init__(self, /, A: LinearOperator, alpha: onp.ToScalar) -> None: ... class _PowerLinearOperator(LinearOperator): args: tuple[LinearOperator, onp.ToInt] - def __init__(self, A: LinearOperator, p: onp.ToInt) -> None: ... + def __init__(self, /, A: LinearOperator, p: onp.ToInt) -> None: ... class MatrixLinearOperator(LinearOperator): A: LinearOperator args: tuple[LinearOperator] - def __init__(self, A: LinearOperator) -> None: ... + def __init__(self, /, A: LinearOperator) -> None: ... class _AdjointMatrixOperator(MatrixLinearOperator): A: LinearOperator @@ -102,9 +102,9 @@ class _AdjointMatrixOperator(MatrixLinearOperator): @property @override def dtype(self, /) -> np.dtype[np.generic]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleVariableOverride] - def __init__(self, adjoint: LinearOperator) -> None: ... + def __init__(self, /, adjoint: LinearOperator) -> None: ... class IdentityOperator(LinearOperator): - def __init__(self, shape: Untyped, dtype: Untyped | None = None) -> None: ... + def __init__(self, /, shape: Untyped, dtype: Untyped | None = None) -> None: ... def aslinearoperator(A: Untyped) -> Untyped: ... diff --git a/scipy-stubs/sparse/linalg/_matfuncs.pyi b/scipy-stubs/sparse/linalg/_matfuncs.pyi index 2f7a8b05..7be022f4 100644 --- a/scipy-stubs/sparse/linalg/_matfuncs.pyi +++ b/scipy-stubs/sparse/linalg/_matfuncs.pyi @@ -10,48 +10,48 @@ UPPER_TRIANGULAR: Final = "upper_triangular" def inv(A: Untyped) -> Untyped: ... class MatrixPowerOperator(LinearOperator): - def __init__(self, A: Untyped, p: Untyped, structure: Untyped | None = None) -> None: ... + def __init__(self, /, A: Untyped, p: Untyped, structure: Untyped | None = None) -> None: ... class ProductOperator(LinearOperator): - def __init__(self, *args: Untyped, **kwargs: Untyped) -> None: ... + def __init__(self, /, *args: Untyped, **kwargs: Untyped) -> None: ... class _ExpmPadeHelper: A: Untyped ident: Untyped structure: Untyped use_exact_onenorm: Untyped - def __init__(self, A: Untyped, structure: Untyped | None = None, use_exact_onenorm: bool = False) -> None: ... + def __init__(self, /, A: Untyped, structure: Untyped | None = None, use_exact_onenorm: bool = False) -> None: ... @property - def A2(self) -> Untyped: ... + def A2(self, /) -> Untyped: ... @property - def A4(self) -> Untyped: ... + def A4(self, /) -> Untyped: ... @property - def A6(self) -> Untyped: ... + def A6(self, /) -> Untyped: ... @property - def A8(self) -> Untyped: ... + def A8(self, /) -> Untyped: ... @property - def A10(self) -> Untyped: ... + def A10(self, /) -> Untyped: ... @property - def d4_tight(self) -> Untyped: ... + def d4_tight(self, /) -> Untyped: ... @property - def d6_tight(self) -> Untyped: ... + def d6_tight(self, /) -> Untyped: ... @property - def d8_tight(self) -> Untyped: ... + def d8_tight(self, /) -> Untyped: ... @property - def d10_tight(self) -> Untyped: ... + def d10_tight(self, /) -> Untyped: ... @property - def d4_loose(self) -> Untyped: ... + def d4_loose(self, /) -> Untyped: ... @property - def d6_loose(self) -> Untyped: ... + def d6_loose(self, /) -> Untyped: ... @property - def d8_loose(self) -> Untyped: ... + def d8_loose(self, /) -> Untyped: ... @property - def d10_loose(self) -> Untyped: ... - def pade3(self) -> Untyped: ... - def pade5(self) -> Untyped: ... - def pade7(self) -> Untyped: ... - def pade9(self) -> Untyped: ... - def pade13_scaled(self, s: Untyped) -> Untyped: ... + def d10_loose(self, /) -> Untyped: ... + def pade3(self, /) -> Untyped: ... + def pade5(self, /) -> Untyped: ... + def pade7(self, /) -> Untyped: ... + def pade9(self, /) -> Untyped: ... + def pade13_scaled(self, /, s: Untyped) -> Untyped: ... def expm(A: Untyped) -> Untyped: ... def matrix_power(A: Untyped, power: Untyped) -> Untyped: ... diff --git a/scipy-stubs/sparse/linalg/_special_sparse_arrays.pyi b/scipy-stubs/sparse/linalg/_special_sparse_arrays.pyi index 644dc1eb..b0439d15 100644 --- a/scipy-stubs/sparse/linalg/_special_sparse_arrays.pyi +++ b/scipy-stubs/sparse/linalg/_special_sparse_arrays.pyi @@ -6,31 +6,31 @@ __all__ = ["LaplacianNd"] class LaplacianNd(LinearOperator): grid_shape: Untyped boundary_conditions: Untyped - def __init__(self, grid_shape: Untyped, *, boundary_conditions: str = "neumann", dtype: Untyped = ...) -> None: ... - def eigenvalues(self, m: Untyped | None = None) -> Untyped: ... - def eigenvectors(self, m: Untyped | None = None) -> Untyped: ... - def toarray(self) -> Untyped: ... - def tosparse(self) -> Untyped: ... + def __init__(self, /, grid_shape: Untyped, *, boundary_conditions: str = "neumann", dtype: Untyped = ...) -> None: ... + def eigenvalues(self, /, m: Untyped | None = None) -> Untyped: ... + def eigenvectors(self, /, m: Untyped | None = None) -> Untyped: ... + def toarray(self, /) -> Untyped: ... + def tosparse(self, /) -> Untyped: ... class Sakurai(LinearOperator): n: Untyped - def __init__(self, n: Untyped, dtype: Untyped = ...) -> None: ... - def eigenvalues(self, m: Untyped | None = None) -> Untyped: ... - def tobanded(self) -> Untyped: ... - def tosparse(self) -> Untyped: ... - def toarray(self) -> Untyped: ... + def __init__(self, /, n: Untyped, dtype: Untyped = ...) -> None: ... + def eigenvalues(self, /, m: Untyped | None = None) -> Untyped: ... + def tobanded(self, /) -> Untyped: ... + def tosparse(self, /) -> Untyped: ... + def toarray(self, /) -> Untyped: ... class MikotaM(LinearOperator): - def __init__(self, shape: Untyped, dtype: Untyped = ...) -> None: ... - def tobanded(self) -> Untyped: ... - def tosparse(self) -> Untyped: ... - def toarray(self) -> Untyped: ... + def __init__(self, /, shape: Untyped, dtype: Untyped = ...) -> None: ... + def tobanded(self, /) -> Untyped: ... + def tosparse(self, /) -> Untyped: ... + def toarray(self, /) -> Untyped: ... class MikotaK(LinearOperator): - def __init__(self, shape: Untyped, dtype: Untyped = ...) -> None: ... - def tobanded(self) -> Untyped: ... - def tosparse(self) -> Untyped: ... - def toarray(self) -> Untyped: ... + def __init__(self, /, shape: Untyped, dtype: Untyped = ...) -> None: ... + def tobanded(self, /) -> Untyped: ... + def tosparse(self, /) -> Untyped: ... + def toarray(self, /) -> Untyped: ... class MikotaPair: n: Untyped @@ -38,5 +38,5 @@ class MikotaPair: shape: Untyped m: Untyped k: Untyped - def __init__(self, n: Untyped, dtype: Untyped = ...) -> None: ... - def eigenvalues(self, m: Untyped | None = None) -> Untyped: ... + def __init__(self, /, n: Untyped, dtype: Untyped = ...) -> None: ... + def eigenvalues(self, /, m: Untyped | None = None) -> Untyped: ... diff --git a/scipy-stubs/sparse/linalg/eigen.pyi b/scipy-stubs/sparse/linalg/eigen.pyi index 3b00b5b8..a759e4e5 100644 --- a/scipy-stubs/sparse/linalg/eigen.pyi +++ b/scipy-stubs/sparse/linalg/eigen.pyi @@ -8,11 +8,11 @@ test: ModuleType @deprecated("will be removed in SciPy v2.0.0") class ArpackError: - def __init__(self, info: object, infodict: object = ...) -> None: ... + def __init__(self, /, info: object, infodict: object = ...) -> None: ... @deprecated("will be removed in SciPy v2.0.0") class ArpackNoConvergence: - def __init__(self, msg: object, eigenvalues: object, eigenvectors: object) -> None: ... + def __init__(self, /, msg: object, eigenvalues: object, eigenvectors: object) -> None: ... @deprecated("will be removed in SciPy v2.0.0") def eigs( diff --git a/scipy-stubs/sparse/linalg/interface.pyi b/scipy-stubs/sparse/linalg/interface.pyi index 1d46aec6..017caab1 100644 --- a/scipy-stubs/sparse/linalg/interface.pyi +++ b/scipy-stubs/sparse/linalg/interface.pyi @@ -28,8 +28,8 @@ class LinearOperator: other: object, /, ) -> object: ... - def __rmul__(self, x: object) -> object: ... - def __pow__(self, p: object) -> object: ... + def __rmul__(self, /, x: object) -> object: ... + def __pow__(self, /, p: object) -> object: ... def __add__(self, x: object, /) -> object: ... def __neg__(self, /) -> object: ... def __sub__(self, x: object, /) -> object: ... @@ -38,7 +38,7 @@ class LinearOperator: def H(self, /) -> object: ... def transpose(self, /) -> object: ... @property - def T(self) -> object: ... + def T(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def aslinearoperator(A: object) -> object: ... diff --git a/scipy-stubs/sparse/linalg/matfuncs.pyi b/scipy-stubs/sparse/linalg/matfuncs.pyi index ca42447e..c8b8e38c 100644 --- a/scipy-stubs/sparse/linalg/matfuncs.pyi +++ b/scipy-stubs/sparse/linalg/matfuncs.pyi @@ -28,8 +28,8 @@ class LinearOperator: other: object, /, ) -> object: ... - def __rmul__(self, x: object) -> object: ... - def __pow__(self, p: object) -> object: ... + def __rmul__(self, /, x: object) -> object: ... + def __pow__(self, /, p: object) -> object: ... def __add__(self, x: object, /) -> object: ... def __neg__(self, /) -> object: ... def __sub__(self, x: object, /) -> object: ... @@ -38,7 +38,7 @@ class LinearOperator: def H(self, /) -> object: ... def transpose(self, /) -> object: ... @property - def T(self) -> object: ... + def T(self, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") def spsolve(A: object, b: object, permc_spec: object = ..., use_umfpack: object = ...) -> object: ... diff --git a/scipy-stubs/spatial/_ckdtree.pyi b/scipy-stubs/spatial/_ckdtree.pyi index f8a25c53..43141768 100644 --- a/scipy-stubs/spatial/_ckdtree.pyi +++ b/scipy-stubs/spatial/_ckdtree.pyi @@ -16,51 +16,51 @@ class _CythonMixin: class cKDTreeNode(_CythonMixin): @property - def data_points(self) -> onp.ArrayND[np.float64]: ... + def data_points(self, /) -> onp.ArrayND[np.float64]: ... @property - def indices(self) -> onp.ArrayND[np.intp]: ... + def indices(self, /) -> onp.ArrayND[np.intp]: ... # These are read-only attributes in cython, which behave like properties @property - def level(self) -> int: ... + def level(self, /) -> int: ... @property - def split_dim(self) -> int: ... + def split_dim(self, /) -> int: ... @property - def children(self) -> int: ... + def children(self, /) -> int: ... @property - def start_idx(self) -> int: ... + def start_idx(self, /) -> int: ... @property - def end_idx(self) -> int: ... + def end_idx(self, /) -> int: ... @property - def split(self) -> float: ... + def split(self, /) -> float: ... @property - def lesser(self) -> cKDTreeNode | None: ... + def lesser(self, /) -> cKDTreeNode | None: ... @property - def greater(self) -> cKDTreeNode | None: ... + def greater(self, /) -> cKDTreeNode | None: ... class cKDTree(_CythonMixin): @property - def n(self) -> int: ... + def n(self, /) -> int: ... @property - def m(self) -> int: ... + def m(self, /) -> int: ... @property - def leafsize(self) -> int: ... + def leafsize(self, /) -> int: ... @property - def size(self) -> int: ... + def size(self, /) -> int: ... @property - def tree(self) -> cKDTreeNode: ... + def tree(self, /) -> cKDTreeNode: ... # These are read-only attributes in cython, which behave like properties @property - def data(self) -> onp.ArrayND[np.float64]: ... + def data(self, /) -> onp.ArrayND[np.float64]: ... @property - def maxes(self) -> onp.ArrayND[np.float64]: ... + def maxes(self, /) -> onp.ArrayND[np.float64]: ... @property - def mins(self) -> onp.ArrayND[np.float64]: ... + def mins(self, /) -> onp.ArrayND[np.float64]: ... @property - def indices(self) -> onp.ArrayND[np.float64]: ... + def indices(self, /) -> onp.ArrayND[np.float64]: ... @property - def boxsize(self) -> onp.ArrayND[np.float64] | None: ... + def boxsize(self, /) -> onp.ArrayND[np.float64] | None: ... # def __init__( diff --git a/scipy-stubs/spatial/transform/_rotation.pyi b/scipy-stubs/spatial/transform/_rotation.pyi index bf8fe3f4..bc84f75a 100644 --- a/scipy-stubs/spatial/transform/_rotation.pyi +++ b/scipy-stubs/spatial/transform/_rotation.pyi @@ -7,27 +7,30 @@ from scipy._typing import Seed class Rotation: @property - def single(self) -> bool: ... - def __init__(self, quat: npt.ArrayLike, normalize: bool = ..., copy: bool = ...) -> None: ... + def single(self, /) -> bool: ... + def __init__(self, /, quat: npt.ArrayLike, normalize: bool = ..., copy: bool = ...) -> None: ... def __setstate_cython__(self, pyx_state: object, /) -> None: ... def __reduce_cython__(self, /) -> None: ... - def __len__(self) -> int: ... - def __getitem__(self, indexer: int | slice | npt.ArrayLike) -> Rotation: ... - def __mul__(self, other: Rotation) -> Rotation: ... - def __pow__(self, n: float, modulus: int | None) -> Rotation: ... - def as_quat(self, canonical: bool = ..., *, scalar_first: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_matrix(self) -> onp.ArrayND[np.float64]: ... - def as_rotvec(self, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_euler(self, seq: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_davenport(self, axes: npt.ArrayLike, order: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_mrp(self) -> onp.ArrayND[np.float64]: ... - def apply(self, vectors: npt.ArrayLike, inverse: bool = ...) -> onp.ArrayND[np.float64]: ... - def inv(self) -> Rotation: ... - def magnitude(self) -> onp.ArrayND[np.float64] | float: ... - def approx_equal(self, other: Rotation, atol: float | None = None, degrees: bool = ...) -> onp.ArrayND[np.bool_] | bool: ... - def mean(self, weights: npt.ArrayLike | None = ...) -> Rotation: ... + def __len__(self, /) -> int: ... + def __getitem__(self, /, indexer: int | slice | npt.ArrayLike) -> Rotation: ... + def __mul__(self, /, other: Rotation) -> Rotation: ... + def __pow__(self, /, n: float, modulus: int | None) -> Rotation: ... + def as_quat(self, /, canonical: bool = ..., *, scalar_first: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_matrix(self, /) -> onp.ArrayND[np.float64]: ... + def as_rotvec(self, /, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_euler(self, /, seq: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_davenport(self, /, axes: npt.ArrayLike, order: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_mrp(self, /) -> onp.ArrayND[np.float64]: ... + def apply(self, /, vectors: npt.ArrayLike, inverse: bool = ...) -> onp.ArrayND[np.float64]: ... + def inv(self, /) -> Rotation: ... + def magnitude(self, /) -> onp.ArrayND[np.float64] | float: ... + def approx_equal( + self, /, other: Rotation, atol: float | None = None, degrees: bool = ... + ) -> onp.ArrayND[np.bool_] | bool: ... + def mean(self, /, weights: npt.ArrayLike | None = ...) -> Rotation: ... def reduce( self, + /, left: Rotation | None = ..., right: Rotation | None = ..., return_indices: bool = ..., @@ -66,5 +69,5 @@ class Slerp: timedelta: onp.ArrayND rotations: Rotation rotvecs: onp.ArrayND[np.float64] - def __init__(self, times: npt.ArrayLike, rotations: Rotation) -> None: ... - def __call__(self, times: npt.ArrayLike) -> Rotation: ... + def __init__(self, /, times: npt.ArrayLike, rotations: Rotation) -> None: ... + def __call__(self, /, times: npt.ArrayLike) -> Rotation: ... diff --git a/scipy-stubs/spatial/transform/_rotation_spline.pyi b/scipy-stubs/spatial/transform/_rotation_spline.pyi index d6ccd10a..f6a68b3f 100644 --- a/scipy-stubs/spatial/transform/_rotation_spline.pyi +++ b/scipy-stubs/spatial/transform/_rotation_spline.pyi @@ -10,5 +10,5 @@ class RotationSpline: times: onp.ArrayND[np.float64] rotations: Rotation interpolator: PPoly - def __init__(self, times: npt.ArrayLike, rotations: Rotation) -> None: ... - def __call__(self, times: npt.ArrayLike, order: int = ...) -> Rotation | onp.ArrayND[np.float64]: ... + def __init__(self, /, times: npt.ArrayLike, rotations: Rotation) -> None: ... + def __call__(self, /, times: npt.ArrayLike, order: int = ...) -> Rotation | onp.ArrayND[np.float64]: ... diff --git a/scipy-stubs/spatial/transform/rotation.pyi b/scipy-stubs/spatial/transform/rotation.pyi index 2b0db2f8..9bab8f55 100644 --- a/scipy-stubs/spatial/transform/rotation.pyi +++ b/scipy-stubs/spatial/transform/rotation.pyi @@ -12,10 +12,10 @@ _IntegerType: TypeAlias = int | np.integer[Any] @deprecated("will be removed in SciPy v2.0.0") class Rotation: - def __init__(self, quat: npt.ArrayLike, normalize: bool = ..., copy: bool = ...) -> None: ... + def __init__(self, /, quat: npt.ArrayLike, normalize: bool = ..., copy: bool = ...) -> None: ... @property - def single(self) -> bool: ... - def __len__(self) -> int: ... + def single(self, /) -> bool: ... + def __len__(self, /) -> int: ... @classmethod def from_quat(cls, quat: npt.ArrayLike, *, scalar_first: bool = ...) -> Rotation: ... @classmethod @@ -28,30 +28,31 @@ class Rotation: def from_davenport(cls, axes: npt.ArrayLike, order: str, angles: float | npt.ArrayLike, degrees: bool = ...) -> Rotation: ... @classmethod def from_mrp(cls, mrp: npt.ArrayLike) -> Rotation: ... - def as_quat(self, canonical: bool = ..., *, scalar_first: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_matrix(self) -> onp.ArrayND[np.float64]: ... - def as_rotvec(self, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_euler(self, seq: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_davenport(self, axes: npt.ArrayLike, order: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... - def as_mrp(self) -> onp.ArrayND[np.float64]: ... + def as_quat(self, /, canonical: bool = ..., *, scalar_first: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_matrix(self, /) -> onp.ArrayND[np.float64]: ... + def as_rotvec(self, /, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_euler(self, /, seq: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_davenport(self, /, axes: npt.ArrayLike, order: str, degrees: bool = ...) -> onp.ArrayND[np.float64]: ... + def as_mrp(self, /) -> onp.ArrayND[np.float64]: ... @classmethod def concatenate(cls, rotations: Sequence[Rotation]) -> Rotation: ... - def apply(self, vectors: npt.ArrayLike, inverse: bool = ...) -> onp.ArrayND[np.float64]: ... - def __mul__(self, other: Rotation) -> Rotation: ... - def __pow__(self, n: float, modulus: int | None) -> Rotation: ... - def inv(self) -> Rotation: ... - def magnitude(self) -> onp.ArrayND[np.float64] | float: ... - def approx_equal(self, other: Rotation, atol: float | None = ..., degrees: bool = ...) -> onp.ArrayND[np.bool_] | bool: ... - def mean(self, weights: npt.ArrayLike | None = ...) -> Rotation: ... + def apply(self, /, vectors: npt.ArrayLike, inverse: bool = ...) -> onp.ArrayND[np.float64]: ... + def __mul__(self, /, other: Rotation) -> Rotation: ... + def __pow__(self, /, n: float, modulus: int | None) -> Rotation: ... + def inv(self, /) -> Rotation: ... + def magnitude(self, /) -> onp.ArrayND[np.float64] | float: ... + def approx_equal(self, /, other: Rotation, atol: float | None = ..., degrees: bool = ...) -> onp.ArrayND[np.bool_] | bool: ... + def mean(self, /, weights: npt.ArrayLike | None = ...) -> Rotation: ... def reduce( self, + /, left: Rotation | None = ..., right: Rotation | None = ..., return_indices: bool = ..., ) -> Rotation | tuple[Rotation, onp.ArrayND[np.float64], onp.ArrayND[np.float64]]: ... @classmethod def create_group(cls, group: str, axis: str = ...) -> Rotation: ... - def __getitem__(self, indexer: int | slice | npt.ArrayLike) -> Rotation: ... + def __getitem__(self, /, indexer: int | slice | npt.ArrayLike) -> Rotation: ... @classmethod def identity(cls, num: int | None = ...) -> Rotation: ... @classmethod @@ -68,10 +69,10 @@ class Rotation: weights: npt.ArrayLike | None = ..., return_sensitivity: bool = ..., ) -> tuple[Rotation, float] | tuple[Rotation, float, onp.ArrayND[np.float64]]: ... - def __reduce_cython__(self) -> object: ... + def __reduce_cython__(self, /) -> object: ... def __setstate_cython__(self, __pyx_state: object, /) -> object: ... @deprecated("will be removed in SciPy v2.0.0") class Slerp: - def __init__(self, times: npt.ArrayLike, rotations: Rotation) -> None: ... - def __call__(self, times: npt.ArrayLike) -> Rotation: ... + def __init__(self, /, times: npt.ArrayLike, rotations: Rotation) -> None: ... + def __call__(self, /, times: npt.ArrayLike) -> Rotation: ... diff --git a/scipy-stubs/special/_orthogonal.pyi b/scipy-stubs/special/_orthogonal.pyi index 2a8f221e..52d23578 100644 --- a/scipy-stubs/special/_orthogonal.pyi +++ b/scipy-stubs/special/_orthogonal.pyi @@ -78,14 +78,15 @@ class orthopoly1d(np.poly1d): eval_func: np.ufunc | None = None, ) -> None: ... @overload # type: ignore[override] - def __call__(self, v: np.poly1d) -> np.poly1d: ... + def __call__(self, /, v: np.poly1d) -> np.poly1d: ... @overload - def __call__(self, v: onp.ToFloat) -> np.floating[Any]: ... + def __call__(self, /, v: onp.ToFloat) -> np.floating[Any]: ... @overload - def __call__(self, v: onp.ToComplex) -> np.inexact[Any]: ... + def __call__(self, /, v: onp.ToComplex) -> np.inexact[Any]: ... @overload def __call__( # pyright: ignore[reportIncompatibleMethodOverride] self, + /, v: onp.CanArray[_ShapeT, np.dtype[np.floating[Any] | np.integer[Any] | np.bool_]] | Sequence[npt.ArrayLike], ) -> onp.Array[_ShapeT, np.floating[Any]]: ... diff --git a/scipy-stubs/special/_ufuncs.pyi b/scipy-stubs/special/_ufuncs.pyi index 0a44a34b..4ad96447 100644 --- a/scipy-stubs/special/_ufuncs.pyi +++ b/scipy-stubs/special/_ufuncs.pyi @@ -296,18 +296,18 @@ class _KwBase(TypedDict, total=False): class _UFunc(np.ufunc, Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] @property @override - def __class__(self) -> type[np.ufunc]: ... + def __class__(self, /) -> type[np.ufunc]: ... @__class__.setter def __class__(self, t: type[np.ufunc], /) -> None: ... @property @override - def __name__(self) -> _NameT_co: ... + def __name__(self, /) -> _NameT_co: ... @property @override - def identity(self) -> _IdentityT_co: ... + def identity(self, /) -> _IdentityT_co: ... @property @override - def signature(self) -> None: ... + def signature(self, /) -> None: ... @type_check_only class _WithoutAt: @@ -325,49 +325,49 @@ class _WithoutBinOps: class _UFunc11(_WithoutBinOps, _UFunc[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def nin(self) -> L[1]: ... + def nin(self, /) -> L[1]: ... @property @override - def nout(self) -> L[1]: ... + def nout(self, /) -> L[1]: ... @property @override - def nargs(self) -> L[2]: ... + def nargs(self, /) -> L[2]: ... @type_check_only class _UFunc21(_UFunc[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def nin(self) -> L[2]: ... + def nin(self, /) -> L[2]: ... @property @override - def nout(self) -> L[1]: ... + def nout(self, /) -> L[1]: ... @property @override - def nargs(self) -> L[3]: ... + def nargs(self, /) -> L[3]: ... @type_check_only class _UFunc31(_WithoutAt, _WithoutBinOps, _UFunc[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def nin(self) -> L[3]: ... + def nin(self, /) -> L[3]: ... @property @override - def nout(self) -> L[1]: ... + def nout(self, /) -> L[1]: ... @property @override - def nargs(self) -> L[4]: ... + def nargs(self, /) -> L[4]: ... @type_check_only class _UFunc41(_WithoutAt, _WithoutBinOps, _UFunc[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def nin(self) -> L[4]: ... + def nin(self, /) -> L[4]: ... @property @override - def nout(self) -> L[1]: ... + def nout(self, /) -> L[1]: ... @property @override - def nargs(self) -> L[5]: ... + def nargs(self, /) -> L[5]: ... _ToSignature1_fd: TypeAlias = _Tuple2[_ToDType_f] | _Tuple2[_ToDType_d] _ToSignature1_fdg: TypeAlias = _ToSignature1_fd | _Tuple2[_ToDType_g] @@ -439,10 +439,10 @@ class _Kw41f(_KwBase, TypedDict, total=False): class _UFunc11f(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[2]: ... + def ntypes(self, /) -> L[2]: ... @property @override - def types(self) -> list[L["f->f", "d->d"]]: ... + def types(self, /) -> list[L["f->f", "d->d"]]: ... # @overload def __call__(self, x: _ToSubFloat, /, out: tuple[None] | None = None, **kw: Unpack[_Kw11f]) -> _Float: ... @@ -461,10 +461,10 @@ class _UFunc11f(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identity class _UFunc11g(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[3]: ... + def ntypes(self, /) -> L[3]: ... @property @override - def types(self) -> list[L["f->f", "d->d", "g->g"]]: ... + def types(self, /) -> list[L["f->f", "d->d", "g->g"]]: ... # @overload def __call__(self, x: _ToSubFloat, /, out: tuple[None] | None = None, **kw: Unpack[_Kw11g]) -> _LFloat: ... @@ -483,10 +483,10 @@ class _UFunc11g(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identity class _UFunc11c(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[2]: ... + def ntypes(self, /) -> L[2]: ... @property @override - def types(self) -> list[L["F->F", "D->D"]]: ... + def types(self, /) -> list[L["F->F", "D->D"]]: ... # @overload def __call__(self, x: onp.ToFloat, /, out: tuple[None] | None = None, **kw: Unpack[_Kw11c]) -> _Complex: ... @@ -505,10 +505,10 @@ class _UFunc11c(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identity class _UFunc11fc(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[4]: ... + def ntypes(self, /) -> L[4]: ... @property @override - def types(self) -> list[L["f->f", "d->d", "F->F", "D->D"]]: ... + def types(self, /) -> list[L["f->f", "d->d", "F->F", "D->D"]]: ... # @overload def __call__(self, x: _ToSubFloat, /, out: tuple[None] | None = None, **kw: Unpack[_Kw11fc]) -> _Float: ... @@ -531,10 +531,10 @@ class _UFunc11fc(_UFunc11[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identit class _UFunc21ld(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[1]: ... + def ntypes(self, /) -> L[1]: ... @property @override - def types(self) -> list[L["ld->d"]]: ... + def types(self, /) -> list[L["ld->d"]]: ... # @overload def __call__( @@ -605,10 +605,10 @@ class _UFunc21ld(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identit class _UFunc21f(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[2, 3]: ... + def ntypes(self, /) -> L[2, 3]: ... @property @override - def types(self) -> list[L["ff->f", "dd->d", "ld->d"]]: ... + def types(self, /) -> list[L["ff->f", "dd->d", "ld->d"]]: ... # @overload def __call__( @@ -765,10 +765,10 @@ class _UFunc21f(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identity class _UFunc21fc1(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[4, 5]: ... + def ntypes(self, /) -> L[4, 5]: ... @property @override - def types(self) -> list[L["ff->f", "dd->d", "fF->F", "dD->D", "ld->d"]]: ... + def types(self, /) -> list[L["ff->f", "dd->d", "fF->F", "dD->D", "ld->d"]]: ... # @overload def __call__( @@ -949,10 +949,10 @@ class _UFunc21fc1(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identi class _UFunc21fc2(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[4]: ... + def ntypes(self, /) -> L[4]: ... @property @override - def types(self) -> list[L["ff->f", "dd->d", "FF->F", "DD->D"]]: ... + def types(self, /) -> list[L["ff->f", "dd->d", "FF->F", "DD->D"]]: ... # @overload def __call__( @@ -1209,10 +1209,10 @@ class _UFunc21fc2(_UFunc21[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identi class _UFunc31f(_UFunc31[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[2, 3]: ... + def ntypes(self, /) -> L[2, 3]: ... @property @override - def types(self) -> list[L["fff->f", "ddd->d", "lld->d"]] | list[L["fff->f", "ddd->d", "dld->d"]]: ... + def types(self, /) -> list[L["fff->f", "ddd->d", "lld->d"]] | list[L["fff->f", "ddd->d", "dld->d"]]: ... # @overload def __call__( @@ -1280,10 +1280,10 @@ class _UFunc31f(_UFunc31[_NameT_co, _IdentityT_co], Generic[_NameT_co, _Identity class _UFunc41f(_UFunc41[_NameT_co, _IdentityT_co], Generic[_NameT_co, _IdentityT_co]): # type: ignore[misc] @property @override - def ntypes(self) -> L[2]: ... + def ntypes(self, /) -> L[2]: ... @property @override - def types(self) -> list[L["ffff->f", "dddd->d"]]: ... + def types(self, /) -> list[L["ffff->f", "dddd->d"]]: ... # @overload def __call__( diff --git a/scipy-stubs/stats/_binomtest.pyi b/scipy-stubs/stats/_binomtest.pyi index e79dba49..e465a0d8 100644 --- a/scipy-stubs/stats/_binomtest.pyi +++ b/scipy-stubs/stats/_binomtest.pyi @@ -11,9 +11,10 @@ class BinomTestResult: statistic: float pvalue: float - def __init__(self, k: int, n: int, alternative: _Alternative, statistic: float, pvalue: float) -> None: ... + def __init__(self, /, k: int, n: int, alternative: _Alternative, statistic: float, pvalue: float) -> None: ... def proportion_ci( self, + /, confidence_level: float = 0.95, method: Literal["exact", "wilson", "wilsoncc"] = "exact", ) -> ConfidenceInterval: ... diff --git a/scipy-stubs/stats/_censored_data.pyi b/scipy-stubs/stats/_censored_data.pyi index 741737b5..e947ff5c 100644 --- a/scipy-stubs/stats/_censored_data.pyi +++ b/scipy-stubs/stats/_censored_data.pyi @@ -6,6 +6,7 @@ import optype.numpy as onp class CensoredData: def __init__( self, + /, uncensored: npt.ArrayLike | None = None, *, left: npt.ArrayLike | None = None, @@ -14,8 +15,8 @@ class CensoredData: ) -> None: ... def __sub__(self, other: object, /) -> CensoredData: ... def __truediv__(self, other: object, /) -> CensoredData: ... - def __len__(self) -> int: ... - def num_censored(self) -> int: ... + def __len__(self, /) -> int: ... + def num_censored(self, /) -> int: ... @classmethod def right_censored(cls, x: npt.ArrayLike, censored: onp.AnyBoolArray) -> Self: ... @classmethod diff --git a/scipy-stubs/stats/_continuous_distns.pyi b/scipy-stubs/stats/_continuous_distns.pyi index 0e907e22..1d823196 100644 --- a/scipy-stubs/stats/_continuous_distns.pyi +++ b/scipy-stubs/stats/_continuous_distns.pyi @@ -356,6 +356,7 @@ class argus_gen(rv_continuous): ... class rv_histogram(rv_continuous): def __init__( self, + /, histogram: tuple[onp.ArrayND[np.floating[Any]], onp.ArrayND[np.inexact[Any]]], *args: float | LiteralString | Seed, density: bool | None = None, diff --git a/scipy-stubs/stats/_fit.pyi b/scipy-stubs/stats/_fit.pyi index a9c58ab9..36788432 100644 --- a/scipy-stubs/stats/_fit.pyi +++ b/scipy-stubs/stats/_fit.pyi @@ -41,8 +41,8 @@ class FitResult(Generic[Unpack[_Ts]]): discrete: bool, res: OptimizeResult, ) -> None: ... - def nllf(self, params: tuple[onp.ToFloat, ...] | None = None, data: onp.ToFloatND | None = None) -> np.float64: ... - def plot(self, ax: _MPL_Axes | None = None, *, plot_type: Literal["hist", "qq", "pp", "cdf"] = "hist") -> _MPL_Axes: ... + def nllf(self, /, params: tuple[onp.ToFloat, ...] | None = None, data: onp.ToFloatND | None = None) -> np.float64: ... + def plot(self, /, ax: _MPL_Axes | None = None, *, plot_type: Literal["hist", "qq", "pp", "cdf"] = "hist") -> _MPL_Axes: ... class GoodnessOfFitResult(NamedTuple): fit_result: FitResult diff --git a/scipy-stubs/stats/_hypotests.pyi b/scipy-stubs/stats/_hypotests.pyi index c8fcbe0f..47f6efbd 100644 --- a/scipy-stubs/stats/_hypotests.pyi +++ b/scipy-stubs/stats/_hypotests.pyi @@ -44,7 +44,7 @@ class TukeyHSDResult: _ntreatments: int, _stand_err: float, ) -> None: ... - def confidence_interval(self, confidence_level: float = 0.95) -> ConfidenceInterval: ... + def confidence_interval(self, /, confidence_level: float = 0.95) -> ConfidenceInterval: ... @dataclass class SomersDResult: diff --git a/scipy-stubs/stats/_kde.pyi b/scipy-stubs/stats/_kde.pyi index e8130c65..ce1d624f 100644 --- a/scipy-stubs/stats/_kde.pyi +++ b/scipy-stubs/stats/_kde.pyi @@ -22,11 +22,11 @@ class gaussian_kde: n: int @property - def weights(self) -> onp.ArrayND[np.float64 | np.float32]: ... + def weights(self, /) -> onp.ArrayND[np.float64 | np.float32]: ... @property - def inv_cov(self) -> _Float2D: ... + def inv_cov(self, /) -> _Float2D: ... @property - def neff(self) -> int: ... + def neff(self, /) -> int: ... def __init__( self, /, diff --git a/scipy-stubs/stats/_levy_stable/levyst.pyi b/scipy-stubs/stats/_levy_stable/levyst.pyi index 5b0cf81f..97a61082 100644 --- a/scipy-stubs/stats/_levy_stable/levyst.pyi +++ b/scipy-stubs/stats/_levy_stable/levyst.pyi @@ -1,6 +1,6 @@ class Nolan: def __init__(self, /, alpha: float, beta: float, x0: float) -> None: ... - def g(self, theta: float) -> float: ... + def g(self, /, theta: float) -> float: ... @property def zeta(self, /) -> float: ... @property diff --git a/scipy-stubs/stats/_morestats.pyi b/scipy-stubs/stats/_morestats.pyi index fb80e321..03e69f83 100644 --- a/scipy-stubs/stats/_morestats.pyi +++ b/scipy-stubs/stats/_morestats.pyi @@ -185,13 +185,13 @@ class Std_dev(_ConfidenceInterval): ... class AndersonResult(BaseBunch[np.float64, _VectorF8, _VectorF8]): @property - def statistic(self) -> np.float64: ... + def statistic(self, /) -> np.float64: ... @property - def critical_values(self) -> _VectorF8: ... + def critical_values(self, /) -> _VectorF8: ... @property - def significance_level(self) -> _VectorF8: ... + def significance_level(self, /) -> _VectorF8: ... @property - def fit_result(self) -> FitResult[np.float64, np.float64]: ... + def fit_result(self, /) -> FitResult[np.float64, np.float64]: ... def __new__( _cls, statistic: np.float64, @@ -212,31 +212,31 @@ class AndersonResult(BaseBunch[np.float64, _VectorF8, _VectorF8]): class Anderson_ksampResult(BaseBunch[np.float64, _VectorF8, np.float64]): @property - def statistic(self) -> np.float64: ... + def statistic(self, /) -> np.float64: ... @property - def critical_values(self) -> _VectorF8: ... + def critical_values(self, /) -> _VectorF8: ... @property - def pvalue(self) -> np.float64: ... + def pvalue(self, /) -> np.float64: ... def __new__(_cls, statistic: np.float64, critical_values: _VectorF8, pvalue: np.float64) -> Self: ... def __init__(self, /, statistic: np.float64, critical_values: _VectorF8, pvalue: np.float64) -> None: ... class WilcoxonResult(BaseBunch[_NDT_co, _NDT_co], Generic[_NDT_co]): # pyright: ignore[reportInvalidTypeArguments] @property - def statistic(self) -> _NDT_co: ... + def statistic(self, /) -> _NDT_co: ... @property - def pvalue(self) -> _NDT_co: ... + def pvalue(self, /) -> _NDT_co: ... def __new__(_cls, statistic: _NDT_co, pvalue: _NDT_co) -> Self: ... def __init__(self, /, statistic: _NDT_co, pvalue: _NDT_co) -> None: ... class MedianTestResult(BaseBunch[np.float64, np.float64, np.float64, onp.Array2D[np.float64]]): @property - def statistic(self) -> np.float64: ... + def statistic(self, /) -> np.float64: ... @property - def pvalue(self) -> np.float64: ... + def pvalue(self, /) -> np.float64: ... @property - def median(self) -> np.float64: ... + def median(self, /) -> np.float64: ... @property - def table(self) -> onp.Array2D[np.float64]: ... + def table(self, /) -> onp.Array2D[np.float64]: ... def __new__(_cls, statistic: np.float64, pvalue: np.float64, median: np.float64, table: onp.Array2D[np.float64]) -> Self: ... def __init__( self, diff --git a/scipy-stubs/stats/_multivariate.pyi b/scipy-stubs/stats/_multivariate.pyi index 53d0984c..52645b0d 100644 --- a/scipy-stubs/stats/_multivariate.pyi +++ b/scipy-stubs/stats/_multivariate.pyi @@ -307,7 +307,7 @@ class wishart_frozen(multi_rv_frozen[wishart_gen]): C: Final[onp.Array2D[np.float64]] log_det_scale: Final[float] - def __init__(self, df: onp.ToFloat, scale: _ToFloatMax2D, seed: spt.Seed | None = None) -> None: ... + def __init__(self, /, df: onp.ToFloat, scale: _ToFloatMax2D, seed: spt.Seed | None = None) -> None: ... def logpdf(self, /, x: onp.ToFloatND) -> _ScalarOrArray_f8: ... def pdf(self, /, x: onp.ToFloatND) -> _ScalarOrArray_f8: ... def mean(self, /) -> np.float64 | onp.Array2D[np.float64]: ... diff --git a/scipy-stubs/stats/_odds_ratio.pyi b/scipy-stubs/stats/_odds_ratio.pyi index 323008b7..d2e48947 100644 --- a/scipy-stubs/stats/_odds_ratio.pyi +++ b/scipy-stubs/stats/_odds_ratio.pyi @@ -8,7 +8,7 @@ _Kind: TypeAlias = Literal["conditional", "sample"] class OddsRatioResult: statistic: float - def __init__(self, _table: onp.Array2D[np.integer[Any]], _kind: _Kind, statistic: float) -> None: ... - def confidence_interval(self, confidence_level: float = 0.95, alternative: str = "two-sided") -> ConfidenceInterval: ... + def __init__(self, /, _table: onp.Array2D[np.integer[Any]], _kind: _Kind, statistic: float) -> None: ... + def confidence_interval(self, /, confidence_level: float = 0.95, alternative: str = "two-sided") -> ConfidenceInterval: ... def odds_ratio(table: onp.ToInt2D, *, kind: _Kind = "conditional") -> OddsRatioResult: ... diff --git a/scipy-stubs/stats/_sensitivity_analysis.pyi b/scipy-stubs/stats/_sensitivity_analysis.pyi index f3b86de3..3d6f467e 100644 --- a/scipy-stubs/stats/_sensitivity_analysis.pyi +++ b/scipy-stubs/stats/_sensitivity_analysis.pyi @@ -21,7 +21,7 @@ _SobolMethod: TypeAlias = Callable[ # this protocol exists at runtime (but it has an incorrect reutrn type, which is corrected here) class PPFDist(Protocol): @property - def ppf(self) -> Callable[..., np.float64]: ... + def ppf(self, /) -> Callable[..., np.float64]: ... @dataclass class BootstrapSobolResult: @@ -41,7 +41,7 @@ class SobolResult: _AB: onp.ArrayND[np.float64] | None = None _bootstrap_result: BootstrapResult | None = None - def bootstrap(self, confidence_level: onp.ToFloat = 0.95, n_resamples: onp.ToInt = 999) -> BootstrapSobolResult: ... + def bootstrap(self, /, confidence_level: onp.ToFloat = 0.95, n_resamples: onp.ToInt = 999) -> BootstrapSobolResult: ... # def f_ishigami(x: npt.ArrayLike) -> onp.ArrayND[np.floating[Any]]: ... diff --git a/scipy-stubs/stats/_stats_py.pyi b/scipy-stubs/stats/_stats_py.pyi index 12ccc443..7b3bdd90 100644 --- a/scipy-stubs/stats/_stats_py.pyi +++ b/scipy-stubs/stats/_stats_py.pyi @@ -208,7 +208,7 @@ class QuantileTestResult: _alternative: list[str] _x: onp.ArrayND[_Real0D] _p: float - def confidence_interval(self, confidence_level: float = 0.95) -> float: ... + def confidence_interval(self, /, confidence_level: float = 0.95) -> float: ... @type_check_only class _TestResultBunch(BaseBunch[_NDT_float_co, _NDT_float_co], Generic[_NDT_float_co]): # pyright: ignore[reportInvalidTypeArguments] diff --git a/scipy-stubs/stats/_unuran/unuran_wrapper.pyi b/scipy-stubs/stats/_unuran/unuran_wrapper.pyi index 522f8a41..2e0ed95a 100644 --- a/scipy-stubs/stats/_unuran/unuran_wrapper.pyi +++ b/scipy-stubs/stats/_unuran/unuran_wrapper.pyi @@ -12,39 +12,39 @@ __all__ = ["DiscreteAliasUrn", "NumericalInversePolynomial", "TransformedDensity @type_check_only class _HasSupport(Protocol): @property - def support(self) -> tuple[float, float]: ... + def support(self, /) -> tuple[float, float]: ... @type_check_only class _HasPMF(_HasSupport, Protocol): @property - def pmf(self) -> Callable[..., float]: ... + def pmf(self, /) -> Callable[..., float]: ... @type_check_only class _HasPDF(_HasSupport, Protocol): @property - def pdf(self) -> Callable[..., float]: ... + def pdf(self, /) -> Callable[..., float]: ... @type_check_only class _HasCDF(_HasPDF, Protocol): @property - def cdf(self) -> Callable[..., float]: ... + def cdf(self, /) -> Callable[..., float]: ... @type_check_only class _TDRDist(_HasPDF, Protocol): @property - def dpdf(self) -> Callable[..., float]: ... + def dpdf(self, /) -> Callable[..., float]: ... @type_check_only class _PINVDist(_HasCDF, Protocol): @property - def logpdf(self) -> Callable[..., float]: ... + def logpdf(self, /) -> Callable[..., float]: ... @type_check_only class _PPFMethodMixin: @overload - def ppf(self, u: onp.ToFloat) -> float: ... + def ppf(self, /, u: onp.ToFloat) -> float: ... @overload - def ppf(self, u: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... + def ppf(self, /, u: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... class UNURANError(RuntimeError): ... @@ -54,14 +54,15 @@ class UError(NamedTuple): class Method: @overload - def rvs(self, size: None = None, random_state: Seed | None = None) -> float | int: ... + def rvs(self, /, size: None = None, random_state: Seed | None = None) -> float | int: ... @overload - def rvs(self, size: int | tuple[int, ...]) -> onp.ArrayND[np.float64 | np.int_]: ... - def set_random_state(self, random_state: Seed | None = None) -> None: ... + def rvs(self, /, size: int | tuple[int, ...]) -> onp.ArrayND[np.float64 | np.int_]: ... + def set_random_state(self, /, random_state: Seed | None = None) -> None: ... class TransformedDensityRejection(Method): def __init__( self, + /, dist: _TDRDist, *, mode: float | None = ..., @@ -74,19 +75,20 @@ class TransformedDensityRejection(Method): random_state: Seed | None = ..., ) -> None: ... @property - def hat_area(self) -> float: ... + def hat_area(self, /) -> float: ... @property - def squeeze_hat_ratio(self) -> float: ... + def squeeze_hat_ratio(self, /) -> float: ... @property - def squeeze_area(self) -> float: ... + def squeeze_area(self, /) -> float: ... @overload - def ppf_hat(self, u: onp.ToFloat) -> float: ... + def ppf_hat(self, /, u: onp.ToFloat) -> float: ... @overload - def ppf_hat(self, u: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... + def ppf_hat(self, /, u: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... class SimpleRatioUniforms(Method): def __init__( self, + /, dist: _HasPDF, *, mode: float | None = ..., @@ -99,6 +101,7 @@ class SimpleRatioUniforms(Method): class NumericalInversePolynomial(_PPFMethodMixin, Method): def __init__( self, + /, dist: _PINVDist, *, mode: float | None = ..., @@ -109,14 +112,15 @@ class NumericalInversePolynomial(_PPFMethodMixin, Method): random_state: Seed | None = ..., ) -> None: ... @property - def intervals(self) -> int: ... + def intervals(self, /) -> int: ... @overload - def cdf(self, x: onp.ToFloat) -> float: ... + def cdf(self, /, x: onp.ToFloat) -> float: ... @overload - def cdf(self, x: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... - def u_error(self, sample_size: int = ...) -> UError: ... + def cdf(self, /, x: npt.ArrayLike) -> float | onp.ArrayND[np.float64]: ... + def u_error(self, /, sample_size: int = ...) -> UError: ... def qrvs( self, + /, size: int | tuple[int, ...] | None = ..., d: int | None = ..., qmc_engine: stats.qmc.QMCEngine | None = ..., @@ -125,6 +129,7 @@ class NumericalInversePolynomial(_PPFMethodMixin, Method): class NumericalInverseHermite(_PPFMethodMixin, Method): def __init__( self, + /, dist: _HasCDF, *, domain: tuple[float, float] | None = ..., @@ -135,12 +140,13 @@ class NumericalInverseHermite(_PPFMethodMixin, Method): random_state: Seed | None = ..., ) -> None: ... @property - def intervals(self) -> int: ... + def intervals(self, /) -> int: ... @property - def midpoint_error(self) -> float: ... - def u_error(self, sample_size: int = ...) -> UError: ... + def midpoint_error(self, /) -> float: ... + def u_error(self, /, sample_size: int = ...) -> UError: ... def qrvs( self, + /, size: int | tuple[int, ...] | None = ..., d: int | None = ..., qmc_engine: stats.qmc.QMCEngine | None = ..., @@ -149,6 +155,7 @@ class NumericalInverseHermite(_PPFMethodMixin, Method): class DiscreteAliasUrn(Method): def __init__( self, + /, dist: npt.ArrayLike | _HasPMF, *, domain: tuple[float, float] | None = ..., @@ -159,6 +166,7 @@ class DiscreteAliasUrn(Method): class DiscreteGuideTable(_PPFMethodMixin, Method): def __init__( self, + /, dist: npt.ArrayLike | _HasPMF, *, domain: tuple[float, float] | None = ...,