diff --git a/README.md b/README.md index a0eb4b31..f5bb35c1 100644 --- a/README.md +++ b/README.md @@ -87,12 +87,13 @@ pyright), the "type completeness score" is **42.6%**. | `scipy.__init__` | 3: ready | | `scipy._lib` | 2: partial | | `scipy.cluster` | 1: skeleton | -| `scipy.constants` | 3: ready | +| `scipy.constants` | **4: done** | | `scipy.datasets` | 2: partial | | `scipy.fft` | 2: partial | | `scipy.fft._pocketfft` | 2: partial | | `scipy.fftpack` | 2: partial | -| `scipy.integrate` | 3: ready | +| `scipy.integrate` | **4: done** | +| `scipy.integrate._bvp` | 2: partial | | `scipy.integrate._ivp` | 2: partial | | `scipy.interpolate` | 2: partial | | `scipy.io` | 2: partial | @@ -115,11 +116,11 @@ pyright), the "type completeness score" is **42.6%**. | `scipy.special.cython_special` | 2: partial | | `scipy.stats` | 2: partial | | `scipy.stats.contingency` | 1: skeleton | -| `scipy.stats.distributions` | 4: done | +| `scipy.stats.distributions` | **4: done** | | `scipy.stats.mstats` | 1: skeleton | | `scipy.stats.qmc` | 2: partial | | `scipy.stats.sampling` | 1: skeleton | -| `scipy.version` | 4: done | +| `scipy.version` | **4: done** | Status labels: diff --git a/scipy-stubs/integrate/_bvp.pyi b/scipy-stubs/integrate/_bvp.pyi index b8803843..a041c17f 100644 --- a/scipy-stubs/integrate/_bvp.pyi +++ b/scipy-stubs/integrate/_bvp.pyi @@ -1,5 +1,3 @@ -# TODO: Annotate the private functions as well - from collections.abc import Callable, Sequence from typing import Any, Final, Generic, Literal, TypeAlias, overload from typing_extensions import TypeVar @@ -7,6 +5,7 @@ from typing_extensions import TypeVar import numpy as np import numpy.typing as npt import optype.numpy as onpt +from scipy._typing import UntypedCallable from scipy.interpolate import PPoly _SCT = TypeVar("_SCT", bound=np.generic) @@ -40,13 +39,34 @@ _FunBCR_p: TypeAlias = Callable[ ] _FunBCR_jac: TypeAlias = Callable[ [_Array_1d[_SCT_fc], _Array_1d[_SCT_fc]], - tuple[npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc]] + tuple[npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc]], ] _FunBCR_jac_p: TypeAlias = Callable[ [_Array_1d[_SCT_fc], _Array_1d[_SCT_fc], _Array_1d[np.float64]], - tuple[npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc]] + tuple[npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc], npt.NDArray[_SCT_fc]], ] +EPS: Final[float] +TERMINATION_MESSAGES: Final[dict[int, str]] + +# private functions +# TODO: Annotate these +estimate_fun_jac: UntypedCallable +estimate_bc_jac: UntypedCallable +compute_jac_indices: UntypedCallable +stacked_matmul: UntypedCallable +construct_global_jac: UntypedCallable +collocation_fun: UntypedCallable +prepare_sys: UntypedCallable +solve_newton: UntypedCallable +print_iteration_progress: Callable[..., None] +estimate_rms_residuals: UntypedCallable +create_spline: UntypedCallable +modify_mesh: UntypedCallable +wrap_functions: UntypedCallable + +def print_iteration_header() -> None: ... + # NOTE: this inherits from `scipy.optimize.OptimizeResult` at runtime. # But because `BVPResult` doesn't share all members (and optional attributes # still aren't a thing), it was omitted as a base class here. @@ -59,10 +79,9 @@ class BVPResult(Generic[_SCT_fc]): status: Final[Literal[0, 1, 2]] message: Final[str] success: Final[bool] - @property - def y(self, /) -> onpt.Array[tuple[int, int], _SCT_fc]: ... - @property - def yp(self) -> onpt.Array[tuple[int, int], _SCT_fc]: ... + + y: onpt.Array[tuple[int, int], _SCT_fc] + yp: onpt.Array[tuple[int, int], _SCT_fc] # public @overload diff --git a/scipy-stubs/integrate/_ivp/base.pyi b/scipy-stubs/integrate/_ivp/base.pyi index 950f3bf4..1a1dc9f3 100644 --- a/scipy-stubs/integrate/_ivp/base.pyi +++ b/scipy-stubs/integrate/_ivp/base.pyi @@ -1,10 +1,10 @@ from collections.abc import Callable, Sequence -from typing import Any, ClassVar, Final, Generic, Literal, TypeAlias, TypeVar +from typing import Any, ClassVar, Final, Generic, Literal, TypeAlias, TypeVar, overload import numpy as np import numpy.typing as npt import optype.numpy as onpt -from scipy._typing import Untyped +import scipy._typing as spt _VT = TypeVar("_VT", bound=npt.NDArray[np.inexact[Any]], default=npt.NDArray[np.inexact[Any]]) @@ -54,9 +54,12 @@ class DenseOutput: t: Final[float] t_min: Final[float] t_max: Final[float] - def __init__(self, t_old: float, t: float, /) -> None: ... - def __call__(self, /, t: _ArrayLikeReal) -> Untyped: ... + def __init__(self, /, t_old: float, t: float) -> None: ... + @overload + def __call__(self, /, t: spt.AnyReal) -> onpt.Array[tuple[int], np.inexact[Any]]: ... + @overload + def __call__(self, /, t: _ArrayLikeReal) -> npt.NDArray[np.inexact[Any]]: ... class ConstantDenseOutput(DenseOutput, Generic[_VT]): - value: Untyped - def __init__(self, t_old: float, t: float, /, value: _VT) -> None: ... + value: _VT + def __init__(self, /, t_old: float, t: float, value: _VT) -> None: ... diff --git a/scipy-stubs/integrate/_ivp/bdf.pyi b/scipy-stubs/integrate/_ivp/bdf.pyi index bab61df6..008fee8b 100644 --- a/scipy-stubs/integrate/_ivp/bdf.pyi +++ b/scipy-stubs/integrate/_ivp/bdf.pyi @@ -43,6 +43,7 @@ class BDF(OdeSolver): LU: Untyped def __init__( self, + /, fun: UntypedCallable, t0: Untyped, y0: Untyped, @@ -62,4 +63,4 @@ class BdfDenseOutput(DenseOutput): t_shift: Untyped denom: Untyped D: Untyped - def __init__(self, t_old: float, t: float, /, h: Untyped, order: Untyped, D: Untyped) -> None: ... + def __init__(self, /, t_old: float, t: float, h: Untyped, order: Untyped, D: Untyped) -> None: ... diff --git a/scipy-stubs/integrate/_ivp/ivp.pyi b/scipy-stubs/integrate/_ivp/ivp.pyi index 507857a8..1cab5216 100644 --- a/scipy-stubs/integrate/_ivp/ivp.pyi +++ b/scipy-stubs/integrate/_ivp/ivp.pyi @@ -31,7 +31,7 @@ class OdeResult(Generic[_SCT_cf]): message: str success: bool -def prepare_events(events: UntypedCallable | Sequence[UntypedCallable], t0: Untyped) -> tuple[Untyped, Untyped, Untyped]: ... +def prepare_events(events: UntypedCallable | Sequence[UntypedCallable]) -> tuple[Untyped, Untyped, Untyped]: ... def solve_event_equation(event: Untyped, sol: Untyped, t_old: Untyped, t: Untyped) -> Untyped: ... def handle_events( sol: DenseOutput, diff --git a/scipy-stubs/integrate/_ivp/lsoda.pyi b/scipy-stubs/integrate/_ivp/lsoda.pyi index 0bf1e613..ca90cc0d 100644 --- a/scipy-stubs/integrate/_ivp/lsoda.pyi +++ b/scipy-stubs/integrate/_ivp/lsoda.pyi @@ -6,6 +6,7 @@ from .base import DenseOutput, OdeSolver class LSODA(OdeSolver): def __init__( self, + /, fun: UntypedCallable, t0: Untyped, y0: Untyped, @@ -26,4 +27,4 @@ class LsodaDenseOutput(DenseOutput): h: Untyped yh: Untyped p: Untyped - def __init__(self, t_old: float, t: float, /, h: Untyped, order: Untyped, yh: Untyped) -> None: ... + def __init__(self, /, t_old: float, t: float, h: Untyped, order: Untyped, yh: Untyped) -> None: ... diff --git a/scipy-stubs/integrate/_ivp/radau.pyi b/scipy-stubs/integrate/_ivp/radau.pyi index fbe55165..57e44d22 100644 --- a/scipy-stubs/integrate/_ivp/radau.pyi +++ b/scipy-stubs/integrate/_ivp/radau.pyi @@ -50,6 +50,7 @@ class Radau(OdeSolver): Z: Untyped def __init__( self, + /, fun: UntypedCallable, t0: Untyped, y0: Untyped, @@ -69,4 +70,4 @@ class RadauDenseOutput(DenseOutput): Q: Untyped order: Untyped y_old: Untyped - def __init__(self, t_old: float, t: float, /, y_old: Untyped, Q: Untyped) -> None: ... + def __init__(self, /, t_old: float, t: float, y_old: Untyped, Q: Untyped) -> None: ... diff --git a/scipy-stubs/integrate/_ivp/rk.pyi b/scipy-stubs/integrate/_ivp/rk.pyi index 2c25458f..7ead1e8d 100644 --- a/scipy-stubs/integrate/_ivp/rk.pyi +++ b/scipy-stubs/integrate/_ivp/rk.pyi @@ -37,6 +37,7 @@ class RungeKutta(OdeSolver): h_previous: Untyped def __init__( self, + /, fun: UntypedCallable, t0: Untyped, y0: Untyped, @@ -63,6 +64,7 @@ class DOP853(RungeKutta): K: Untyped def __init__( self, + /, fun: UntypedCallable, t0: Untyped, y0: Untyped, @@ -80,10 +82,10 @@ class RkDenseOutput(DenseOutput): Q: Untyped order: Untyped y_old: Untyped - def __init__(self, t_old: float, t: float, /, y_old: Untyped, Q: Untyped) -> None: ... + def __init__(self, /, t_old: float, t: float, y_old: Untyped, Q: Untyped) -> None: ... class Dop853DenseOutput(DenseOutput): h: Untyped F: Untyped y_old: Untyped - def __init__(self, t_old: float, t: float, /, y_old: Untyped, F: Untyped) -> None: ... + def __init__(self, /, t_old: float, t: float, y_old: Untyped, F: Untyped) -> None: ... diff --git a/scipy-stubs/integrate/_ode.pyi b/scipy-stubs/integrate/_ode.pyi index 43ac09f4..c044b16d 100644 --- a/scipy-stubs/integrate/_ode.pyi +++ b/scipy-stubs/integrate/_ode.pyi @@ -1,65 +1,122 @@ -from scipy._typing import Untyped +from collections.abc import Callable, Sequence +from typing import Any, ClassVar, Final, Generic, Literal, Protocol, TypeAlias, type_check_only +from typing_extensions import Self, TypeVarTuple, Unpack, override + +import numpy as np +import numpy.typing as npt +import optype.numpy as onpt +from scipy._typing import Untyped, UntypedCallable, UntypedTuple __all__ = ["complex_ode", "ode"] -class ode: +_Ts = TypeVarTuple("_Ts", default=Unpack[tuple[()]]) + +@type_check_only +class _ODEFuncF(Protocol[Unpack[_Ts]]): + def __call__( + self, + t: float, + y: float | npt.NDArray[np.float64], + /, + *args: Unpack[_Ts], + ) -> float | npt.NDArray[np.floating[Any]]: ... + +@type_check_only +class _ODEFuncC(Protocol[Unpack[_Ts]]): + def __call__( + self, + t: float, + y: complex | npt.NDArray[np.complex128], + /, + *args: Unpack[_Ts], + ) -> complex | npt.NDArray[np.complexfloating[Any, Any]]: ... + +_SolOutFunc: TypeAlias = Callable[[float, onpt.Array[tuple[int], np.inexact[Any]]], Literal[0, -1]] + +class ode(Generic[Unpack[_Ts]]): stiff: int - f: Untyped - jac: Untyped - f_params: Untyped - jac_params: Untyped - t: Untyped - def __init__(self, f, jac: Untyped | None = None) -> None: ... + f: _ODEFuncF[Unpack[_Ts]] + jac: _ODEFuncF[Unpack[_Ts]] | None + f_params: tuple[()] | tuple[Unpack[_Ts]] + jac_params: tuple[()] | tuple[Unpack[_Ts]] + t: float + def __init__(self, /, f: _ODEFuncF[Unpack[_Ts]], jac: _ODEFuncF[Unpack[_Ts]] | None = None) -> None: ... @property - def y(self) -> Untyped: ... - def set_initial_value(self, y, t: float = 0.0) -> Untyped: ... - def set_integrator(self, name, **integrator_params) -> Untyped: ... - def integrate(self, t, step: bool = False, relax: bool = False) -> Untyped: ... - def successful(self) -> Untyped: ... - def get_return_code(self) -> Untyped: ... - def set_f_params(self, *args) -> Untyped: ... - def set_jac_params(self, *args) -> Untyped: ... - def set_solout(self, solout): ... - -class complex_ode(ode): - cf: Untyped - cjac: Untyped - def __init__(self, f, jac: Untyped | None = None): ... + def y(self, /) -> float: ... + def integrate(self, /, t: float, step: bool = False, relax: bool = False) -> float: ... + def set_initial_value(self, /, y: onpt.AnyInexactArray | Sequence[Sequence[complex]] | complex, t: float = 0.0) -> Self: ... + def set_integrator(self, /, name: str, **integrator_params: Untyped) -> Self: ... + def set_f_params(self, /, *args: Unpack[_Ts]) -> Self: ... + def set_jac_params(self, /, *args: Unpack[_Ts]) -> Self: ... + def set_solout(self, /, solout: _SolOutFunc) -> None: ... + def get_return_code(self, /) -> Literal[-7, -6, -5, -4, -3, -2, -1, 1, 2]: ... + def successful(self, /) -> bool: ... + +class complex_ode(ode[Unpack[_Ts]], Generic[Unpack[_Ts]]): + cf: _ODEFuncC[Unpack[_Ts]] + cjac: _ODEFuncC[Unpack[_Ts]] | None + tmp: onpt.Array[tuple[int], np.float64] + def __init__(self, /, f: _ODEFuncC[Unpack[_Ts]], jac: _ODEFuncC[Unpack[_Ts]] | None = None) -> None: ... @property - def y(self) -> Untyped: ... - def set_integrator(self, name, **integrator_params) -> Untyped: ... - tmp: Untyped - def set_initial_value(self, y, t: float = 0.0) -> Untyped: ... - def integrate(self, t, step: bool = False, relax: bool = False) -> Untyped: ... - def set_solout(self, solout): ... + @override + def y(self, /) -> complex: ... # type: ignore[override] + @override + def integrate(self, /, t: float, step: bool = False, relax: bool = False) -> complex: ... # type: ignore[override] -def find_integrator(name) -> Untyped: ... +def find_integrator(name: str) -> type[IntegratorBase] | None: ... class IntegratorConcurrencyError(RuntimeError): - def __init__(self, name) -> None: ... + def __init__(self, /, name: str) -> None: ... class IntegratorBase: - runner: Untyped - success: Untyped - istate: Untyped - supports_run_relax: Untyped - supports_step: Untyped - supports_solout: bool - integrator_classes: Untyped - scalar = float - handle: Untyped - def acquire_new_handle(self): ... - def check_handle(self): ... - def reset(self, n, has_jac): ... - def run(self, f, jac, y0, t0, t1, f_params, jac_params): ... - def step(self, f, jac, y0, t0, t1, f_params, jac_params): ... - def run_relax(self, f, jac, y0, t0, t1, f_params, jac_params): ... + runner: ClassVar[Callable[..., object] | None] # fortran function or unavailable + supports_run_relax: ClassVar[Literal[0, 1, None]] = None + supports_step: ClassVar[Literal[0, 1, None]] = None + supports_solout: ClassVar[bool] + scalar: ClassVar[type] = ... + handle: ClassVar[int] + success: Literal[0, 1] | None = None + integrator_classes: list[type[IntegratorBase]] + istate: int | None = None + def acquire_new_handle(self, /) -> None: ... + def check_handle(self, /) -> None: ... + def reset(self, /, n: int, has_jac: bool) -> None: ... + def run( + self, + /, + f: UntypedCallable, + jac: UntypedCallable, + y0: complex, + t0: float, + t1: float, + f_params: UntypedTuple, + jac_params: UntypedTuple, + ) -> tuple[Untyped, float]: ... + def step( + self, + /, + f: UntypedCallable, + jac: UntypedCallable, + y0: complex, + t0: float, + t1: float, + f_params: UntypedTuple, + jac_params: UntypedTuple, + ) -> tuple[Untyped, float]: ... + def run_relax( + self, + /, + f: UntypedCallable, + jac: UntypedCallable, + y0: complex, + t0: float, + t1: float, + f_params: UntypedTuple, + jac_params: UntypedTuple, + ) -> tuple[Untyped, float]: ... class vode(IntegratorBase): - runner: Untyped - messages: Untyped - supports_run_relax: int - supports_step: int + messages: ClassVar[dict[int, str]] active_global_handle: int meth: int with_jacobian: Untyped @@ -72,10 +129,13 @@ class vode(IntegratorBase): max_step: Untyped min_step: Untyped first_step: Untyped - success: int initialized: bool + rwork: Untyped + iwork: Untyped + call_args: Untyped def __init__( self, + /, method: str = "adams", with_jacobian: bool = False, rtol: float = 1e-06, @@ -87,49 +147,40 @@ class vode(IntegratorBase): max_step: float = 0.0, min_step: float = 0.0, first_step: float = 0.0, - ): ... - rwork: Untyped - iwork: Untyped - call_args: Untyped - def reset(self, n, has_jac): ... - istate: Untyped - def run(self, f, jac, y0, t0, t1, f_params, jac_params) -> Untyped: ... - def step(self, *args) -> Untyped: ... - def run_relax(self, *args) -> Untyped: ... + ) -> None: ... # pyright: reportUnnecessaryTypeIgnoreComment=false class zvode(vode): - runner: Untyped - supports_run_relax: int - supports_step: int - scalar: complex # type: ignore[assignment] active_global_handle: int zwork: Untyped rwork: Untyped iwork: Untyped call_args: Untyped - success: int initialized: bool - def reset(self, n, has_jac): ... class dopri5(IntegratorBase): - runner: Untyped - name: str - supports_solout: bool - messages: Untyped - rtol: Untyped - atol: Untyped - nsteps: Untyped - max_step: Untyped - first_step: Untyped - safety: Untyped - ifactor: Untyped - dfactor: Untyped - beta: Untyped - verbosity: Untyped - success: int + name: ClassVar = "dopri5" + messages: ClassVar[dict[int, str]] + + rtol: Final[float] + atol: Final[float] + nsteps: Final[int] + max_step: Final[float] + first_step: Final[float] + safety: Final[float] + ifactor: Final[float] + dfactor: Final[float] + beta: Final[float] + verbosity: Final[int] + solout: Callable[[float, onpt.Array[tuple[int], np.inexact[Any]]], Literal[0, -1]] | None + solout_cmplx: bool + iout: int + work: onpt.Array[tuple[int], np.float64] + iwork: onpt.Array[tuple[int], np.int32] + call_args: Untyped def __init__( self, + /, rtol: float = 1e-06, atol: float = 1e-12, nsteps: int = 500, @@ -141,21 +192,11 @@ class dopri5(IntegratorBase): beta: float = 0.0, method: Untyped | None = None, verbosity: int = -1, - ): ... - solout: Untyped - solout_cmplx: Untyped - iout: int - def set_solout(self, solout, complex: bool = False): ... - work: Untyped - iwork: Untyped - call_args: Untyped - def reset(self, n, has_jac): ... - istate: Untyped - def run(self, f, jac, y0, t0, t1, f_params, jac_params) -> Untyped: ... + ) -> None: ... + def set_solout(self, solout: _SolOutFunc | None, complex: bool = False) -> None: ... class dop853(dopri5): - runner: Untyped - name: str + name: ClassVar = "dop853" def __init__( self, rtol: float = 1e-06, @@ -169,39 +210,38 @@ class dop853(dopri5): beta: float = 0.0, method: Untyped | None = None, verbosity: int = -1, - ): ... - work: Untyped - iwork: Untyped + ) -> None: ... call_args: Untyped - success: int - def reset(self, n, has_jac): ... class lsoda(IntegratorBase): - runner: Untyped - active_global_handle: int - messages: Untyped - with_jacobian: Untyped - rtol: Untyped - atol: Untyped - mu: Untyped - ml: Untyped - max_order_ns: Untyped - max_order_s: Untyped - nsteps: Untyped - max_step: Untyped - min_step: Untyped - first_step: Untyped - ixpr: Untyped - max_hnil: Untyped - success: int - initialized: bool + active_global_handle: ClassVar[int] = 0 + messages: ClassVar[dict[int, str]] + + with_jacobian: Final[bool] + rtol: Final[float] + atol: Final[float] + mu: Final[float | None] + ml: Final[float | None] + max_order_ns: Final[int] + max_order_s: Final[int] + nsteps: Final[int] + max_step: Final[float] + min_step: Final[float] + first_step: Final[float] + ixpr: Final[int] + max_hnil: Final[int] + initialized: Final[bool] + rwork: onpt.Array[tuple[int], np.float64] + iwork: onpt.Array[tuple[int], np.int32] + call_args: list[float | onpt.Array[tuple[int], np.float64] | onpt.Array[tuple[int], np.int32]] def __init__( self, + /, with_jacobian: bool = False, rtol: float = 1e-06, atol: float = 1e-12, - lband: Untyped | None = None, - uband: Untyped | None = None, + lband: float | None = None, + uband: float | None = None, nsteps: int = 500, max_step: float = 0.0, min_step: float = 0.0, @@ -211,12 +251,4 @@ class lsoda(IntegratorBase): max_order_ns: int = 12, max_order_s: int = 5, method: Untyped | None = None, - ): ... - rwork: Untyped - iwork: Untyped - call_args: Untyped - def reset(self, n, has_jac): ... - istate: Untyped - def run(self, f, jac, y0, t0, t1, f_params, jac_params) -> Untyped: ... - def step(self, *args) -> Untyped: ... - def run_relax(self, *args) -> Untyped: ... + ) -> None: ... diff --git a/scipy-stubs/integrate/_odepack_py.pyi b/scipy-stubs/integrate/_odepack_py.pyi index 254a174a..92580b7a 100644 --- a/scipy-stubs/integrate/_odepack_py.pyi +++ b/scipy-stubs/integrate/_odepack_py.pyi @@ -22,6 +22,112 @@ class _ODEFuncInv(Protocol[_YT, Unpack[_Ts]]): class ODEintWarning(Warning): ... +# unspecified args +@overload +def odeint( + func: _ODEFunc[_YT], + y0: _YT, + t: npt.NDArray[np.integer[Any]] | Sequence[int], + args: tuple[()] = (), + Dfun: _ODEFunc[_YT] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, + full_output: Literal[False, 0, None] = 0, + ml: int | None = None, + mu: int | None = None, + rtol: float | None = None, + atol: float | None = None, + tcrit: npt.NDArray[np.integer[Any] | np.floating[Any]] | None = None, + h0: float = 0.0, + hmax: float = 0.0, + hmin: float = 0.0, + ixpr: Literal[False, 0, True, 1] = 0, + mxstep: int = 0, + mxhnil: int = 0, + mxordn: int = 12, + mxords: int = 5, + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[False, 0, None] = False, +) -> onpt.Array[tuple[int, int], np.floating[Any]]: ... +@overload +def odeint( + func: _ODEFunc[_YT], + y0: _YT, + t: npt.NDArray[np.integer[Any]] | Sequence[int], + args: tuple[()] = (), + Dfun: _ODEFunc[_YT] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, + full_output: Literal[False, 0, None] = 0, + ml: int | None = None, + mu: int | None = None, + rtol: float | None = None, + atol: float | None = None, + tcrit: npt.NDArray[np.integer[Any] | np.floating[Any]] | None = None, + h0: float = 0.0, + hmax: float = 0.0, + hmin: float = 0.0, + ixpr: Literal[False, 0, True, 1] = 0, + mxstep: int = 0, + mxhnil: int = 0, + mxordn: int = 12, + mxords: int = 5, + printmessg: Literal[False, 0, True, 1] = 0, + *, + tfirst: Literal[True, 1], +) -> onpt.Array[tuple[int, int], np.floating[Any]]: ... +@overload +def odeint( + func: _ODEFunc[_YT], + y0: _YT, + t: npt.NDArray[np.integer[Any]] | Sequence[int], + args: tuple[()] = (), + Dfun: _ODEFunc[_YT] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, + *, + full_output: Literal[True, 1], + ml: int | None = None, + mu: int | None = None, + rtol: float | None = None, + atol: float | None = None, + tcrit: npt.NDArray[np.integer[Any] | np.floating[Any]] | None = None, + h0: float = 0.0, + hmax: float = 0.0, + hmin: float = 0.0, + ixpr: Literal[False, 0, True, 1] = 0, + mxstep: int = 0, + mxhnil: int = 0, + mxordn: int = 12, + mxords: int = 5, + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[False, 0, None] = False, +) -> tuple[onpt.Array[tuple[int, int], np.floating[Any]], ODEInfoDict]: ... +@overload +def odeint( + func: _ODEFunc[_YT], + y0: _YT, + t: npt.NDArray[np.integer[Any]] | Sequence[int], + args: tuple[()] = (), + Dfun: _ODEFunc[_YT] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, + *, + full_output: Literal[True, 1], + ml: int | None = None, + mu: int | None = None, + rtol: float | None = None, + atol: float | None = None, + tcrit: npt.NDArray[np.integer[Any] | np.floating[Any]] | None = None, + h0: float = 0.0, + hmax: float = 0.0, + hmin: float = 0.0, + ixpr: Literal[False, 0, True, 1] = 0, + mxstep: int = 0, + mxhnil: int = 0, + mxordn: int = 12, + mxords: int = 5, + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[True, 1], +) -> tuple[onpt.Array[tuple[int, int], np.floating[Any]], ODEInfoDict]: ... + +# specified args @overload def odeint( func: _ODEFunc[_YT, Unpack[_Ts]], @@ -29,10 +135,8 @@ def odeint( t: npt.NDArray[np.integer[Any]] | Sequence[int], args: tuple[Unpack[_Ts]] = ..., Dfun: _ODEFunc[_YT, Unpack[_Ts]] | None = None, - *, - tfirst: Literal[False, 0, None] = ..., - full_output: Literal[False, 0, None] = ..., - col_deriv: bool = ..., + col_deriv: Literal[False, 0, True, 1] = 0, + full_output: Literal[False, 0, None] = 0, ml: int | None = None, mu: int | None = None, rtol: float | None = None, @@ -41,12 +145,13 @@ def odeint( h0: float = 0.0, hmax: float = 0.0, hmin: float = 0.0, - ixpr: bool = ..., + ixpr: Literal[False, 0, True, 1] = 0, mxstep: int = 0, mxhnil: int = 0, mxordn: int = 12, mxords: int = 5, - printmessg: bool = ..., + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[False, 0, None] = False, ) -> onpt.Array[tuple[int, int], np.floating[Any]]: ... @overload def odeint( @@ -55,10 +160,8 @@ def odeint( t: npt.NDArray[np.integer[Any]] | Sequence[int], args: tuple[Unpack[_Ts]] = ..., Dfun: _ODEFuncInv[_YT, Unpack[_Ts]] | None = None, - *, - tfirst: Literal[True, 1], - full_output: Literal[False, 0, None] = ..., - col_deriv: bool = ..., + col_deriv: Literal[False, 0, True, 1] = 0, + full_output: Literal[False, 0, None] = 0, ml: int | None = None, mu: int | None = None, rtol: float | None = None, @@ -67,12 +170,14 @@ def odeint( h0: float = 0.0, hmax: float = 0.0, hmin: float = 0.0, - ixpr: bool = ..., + ixpr: Literal[False, 0, True, 1] = 0, mxstep: int = 0, mxhnil: int = 0, mxordn: int = 12, mxords: int = 5, - printmessg: bool = ..., + printmessg: Literal[False, 0, True, 1] = 0, + *, + tfirst: Literal[True, 1], ) -> onpt.Array[tuple[int, int], np.floating[Any]]: ... @overload def odeint( @@ -81,10 +186,9 @@ def odeint( t: npt.NDArray[np.integer[Any]] | Sequence[int], args: tuple[Unpack[_Ts]] = ..., Dfun: _ODEFunc[_YT, Unpack[_Ts]] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, *, - tfirst: Literal[False, 0, None] = ..., full_output: Literal[True, 1], - col_deriv: bool = ..., ml: int | None = None, mu: int | None = None, rtol: float | None = None, @@ -93,12 +197,13 @@ def odeint( h0: float = 0.0, hmax: float = 0.0, hmin: float = 0.0, - ixpr: bool = ..., + ixpr: Literal[False, 0, True, 1] = 0, mxstep: int = 0, mxhnil: int = 0, mxordn: int = 12, mxords: int = 5, - printmessg: bool = ..., + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[False, 0, None] = False, ) -> tuple[onpt.Array[tuple[int, int], np.floating[Any]], ODEInfoDict]: ... @overload def odeint( @@ -107,10 +212,9 @@ def odeint( t: npt.NDArray[np.integer[Any]] | Sequence[int], args: tuple[Unpack[_Ts]] = ..., Dfun: _ODEFuncInv[_YT, Unpack[_Ts]] | None = None, + col_deriv: Literal[False, 0, True, 1] = 0, *, - tfirst: Literal[True, 1], full_output: Literal[True, 1], - col_deriv: bool = ..., ml: int | None = None, mu: int | None = None, rtol: float | None = None, @@ -119,10 +223,11 @@ def odeint( h0: float = 0.0, hmax: float = 0.0, hmin: float = 0.0, - ixpr: bool = ..., + ixpr: Literal[False, 0, True, 1] = 0, mxstep: int = 0, mxhnil: int = 0, mxordn: int = 12, mxords: int = 5, - printmessg: bool = ..., + printmessg: Literal[False, 0, True, 1] = 0, + tfirst: Literal[True, 1], ) -> tuple[onpt.Array[tuple[int, int], np.floating[Any]], ODEInfoDict]: ... diff --git a/scipy-stubs/integrate/_quad_vec.pyi b/scipy-stubs/integrate/_quad_vec.pyi index 790e6472..8d7fbd7b 100644 --- a/scipy-stubs/integrate/_quad_vec.pyi +++ b/scipy-stubs/integrate/_quad_vec.pyi @@ -36,8 +36,8 @@ class _DoesMap(Protocol): @type_check_only class _InfiniteFunc(Protocol[_NDT_f_co]): - def get_t(self, x: float, /) -> float: ... - def __call__(self, t: float, /) -> _NDT_f_co: ... + def get_t(self, /, x: float) -> float: ... + def __call__(self, /, t: float) -> _NDT_f_co: ... class LRUDict(collections.OrderedDict[tuple[float, float], _VT], Generic[_VT]): def __init__(self, /, max_size: int) -> None: ... @@ -45,10 +45,10 @@ class LRUDict(collections.OrderedDict[tuple[float, float], _VT], Generic[_VT]): def update(self, other: Never, /) -> NoReturn: ... # type: ignore[override] class SemiInfiniteFunc(_InfiniteFunc[_NDT_f_co], Generic[_NDT_f_co]): - def __init__(self, func: Callable[[float], _NDT_f_co], /, start: float, infty: bool) -> None: ... + def __init__(self, /, func: Callable[[float], _NDT_f_co], start: float, infty: bool) -> None: ... class DoubleInfiniteFunc(_InfiniteFunc, Generic[_NDT_f_co]): - def __init__(self, func: Callable[[float], _NDT_f_co], /) -> None: ... + def __init__(self, /, func: Callable[[float], _NDT_f_co]) -> None: ... # NOTE: This is only used as "info dict" for `quad_vec(..., full_output=True)`, # even though, confusingly, it is not even even a mapping. @@ -73,39 +73,53 @@ class _Bunch(Generic[_SCT_f_co]): message: Final[str] intervals: Final[onpt.Array[tuple[int, Literal[2]], np.float64]] errors: Final[onpt.Array[tuple[int], np.float64]] - @property - def integrals(self, /) -> onpt.Array[tuple[int, Literal[2]], _SCT_f_co]: ... + integrals: onpt.Array[tuple[int, Literal[2]], _SCT_f_co] +@overload +def quad_vec( + f: _QuadVecFunc[_NDT_f], + a: float, + b: float, + epsabs: float = 1e-200, + epsrel: float = 1e-08, + norm: Literal["max", "2"] = "2", + cache_size: float = 100_000_000, + limit: float = 10_000, + workers: int | _DoesMap = 1, + points: op.CanIter[op.CanNext[float]] | None = None, + quadrature: Literal["gk21", "gk15", "trapezoid"] | None = None, + full_output: Literal[False, 0, None] = False, + *, + args: tuple[()] = ..., +) -> tuple[_NDT_f, float]: ... @overload def quad_vec( f: _QuadVecFunc[_NDT_f, Unpack[_Ts]], - /, a: float, b: float, epsabs: float = 1e-200, epsrel: float = 1e-08, norm: Literal["max", "2"] = "2", - cache_size: int = 100_000_000, + cache_size: float = 100_000_000, limit: float = 10_000, workers: int | _DoesMap = 1, points: op.CanIter[op.CanNext[float]] | None = None, quadrature: Literal["gk21", "gk15", "trapezoid"] | None = None, full_output: Literal[False, 0, None] = False, *, - args: tuple[Unpack[_Ts]] = ..., + args: tuple[Unpack[_Ts]], ) -> tuple[_NDT_f, float]: ... # false positive (basedmypy==1.6.0 / mypy==1.11.1) # pyright: reportUnnecessaryTypeIgnoreComment=false @overload def quad_vec( # type: ignore[overload-overlap] f: _QuadVecFunc[float | np.float64, Unpack[_Ts]], - /, a: float, b: float, epsabs: float = 1e-200, epsrel: float = 1e-08, norm: Literal["max", "2"] = "2", - cache_size: int = 100_000_000, + cache_size: float = 100_000_000, limit: float = 10_000, workers: int | _DoesMap = 1, points: op.CanIter[op.CanNext[float]] | None = None, @@ -117,13 +131,12 @@ def quad_vec( # type: ignore[overload-overlap] @overload def quad_vec( f: _QuadVecFunc[np.floating[_NBT], Unpack[_Ts]], - /, a: float, b: float, epsabs: float = 1e-200, epsrel: float = 1e-08, norm: Literal["max", "2"] = "2", - cache_size: int = 100_000_000, + cache_size: float = 100_000_000, limit: float = 10_000, workers: int | _DoesMap = 1, points: op.CanIter[op.CanNext[float]] | None = None, @@ -135,13 +148,12 @@ def quad_vec( @overload def quad_vec( f: _QuadVecFunc[onpt.Array[_ShapeT, np.floating[_NBT]], Unpack[_Ts]], - /, a: float, b: float, epsabs: float = 1e-200, epsrel: float = 1e-08, norm: Literal["max", "2"] = "2", - cache_size: int = 100_000_000, + cache_size: float = 100_000_000, limit: float = 10_000, workers: int | _DoesMap = 1, points: op.CanIter[op.CanNext[float]] | None = None, diff --git a/scipy-stubs/integrate/_quadpack_py.pyi b/scipy-stubs/integrate/_quadpack_py.pyi index 35bd5b84..1b20f59a 100644 --- a/scipy-stubs/integrate/_quadpack_py.pyi +++ b/scipy-stubs/integrate/_quadpack_py.pyi @@ -2,10 +2,12 @@ from collections.abc import Callable from typing import Final, Generic, Literal, Protocol, TypeAlias, TypedDict, overload, type_check_only from typing_extensions import TypeVar, TypeVarTuple, Unpack +import numpy as np +import numpy.typing as npt import optype as op import scipy._typing as spt from scipy._lib._ccallback import LowLevelCallable -from ._typing import QuadInfoDict, QuadOpts +from ._typing import QuadInfoDict, QuadOpts, QuadWeights __all__ = ["IntegrationWarning", "dblquad", "nquad", "quad", "tplquad"] @@ -81,29 +83,118 @@ class _OptCallable(Protocol[_T_f_contra, _OptT_co]): # 1-dimensional quadrature @overload def quad( - func: _QuadFunc1[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, + func: _QuadFunc1[spt.AnyReal] | LowLevelCallable, a: float, b: float, - args: tuple[Unpack[_Ts]] = ..., - *, + args: tuple[()] = (), full_output: Literal[False, 0, None] = 0, - complex_func: Literal[False, 0, None] = False, + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, maxp1: int = 50, limlst: int = 50, - **kwds: Unpack[QuadOpts], + complex_func: Literal[False, 0, None] = False, ) -> tuple[float, float]: ... @overload def quad( - func: _QuadFunc1[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, + func: _QuadFunc1[spt.AnyReal] | LowLevelCallable, a: float, b: float, - args: tuple[Unpack[_Ts]] = ..., + args: tuple[()] = (), *, full_output: Literal[True, 1], + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, + maxp1: int = 50, + limlst: int = 50, complex_func: Literal[False, 0] = False, +) -> ( + tuple[float, float, QuadInfoDict] + | tuple[float, float, QuadInfoDict, str] + | tuple[float, float, QuadInfoDict, str, _QuadExplain] +): ... +@overload +def quad( + func: _QuadFunc1[spt.AnyComplex] | LowLevelCallable, + a: float, + b: float, + args: tuple[()] = (), + full_output: Literal[False, 0, None] = 0, + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, + maxp1: int = 50, + limlst: int = 50, + *, + complex_func: Literal[True, 1], +) -> tuple[complex, complex]: ... +@overload +def quad( + func: _QuadFunc1[spt.AnyComplex] | LowLevelCallable, + a: float, + b: float, + args: tuple[()] = (), + *, + full_output: Literal[True, 1], + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, + maxp1: int = 50, + limlst: int = 50, + complex_func: Literal[True, 1], +) -> tuple[complex, complex, _QuadComplexFullOutput]: ... +@overload +def quad( + func: _QuadFunc1[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, + a: float, + b: float, + args: tuple[Unpack[_Ts]], + full_output: Literal[False, 0, None] = 0, + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, + maxp1: int = 50, + limlst: int = 50, + complex_func: Literal[False, 0, None] = False, +) -> tuple[float, float]: ... +@overload +def quad( + func: _QuadFunc1[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, + a: float, + b: float, + args: tuple[Unpack[_Ts]], + full_output: Literal[True, 1], + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, maxp1: int = 50, limlst: int = 50, - **kwds: Unpack[QuadOpts], + complex_func: Literal[False, 0] = False, ) -> ( tuple[float, float, QuadInfoDict] | tuple[float, float, QuadInfoDict, str] @@ -114,42 +205,79 @@ def quad( func: _QuadFunc1[spt.AnyComplex, Unpack[_Ts]] | LowLevelCallable, a: float, b: float, - args: tuple[Unpack[_Ts]] = ..., - *, + args: tuple[Unpack[_Ts]], full_output: Literal[False, 0, None] = 0, - complex_func: Literal[True, 1], + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, maxp1: int = 50, limlst: int = 50, - **kwds: Unpack[QuadOpts], + *, + complex_func: Literal[True, 1], ) -> tuple[complex, complex]: ... @overload def quad( func: _QuadFunc1[spt.AnyComplex, Unpack[_Ts]] | LowLevelCallable, a: float, b: float, - args: tuple[Unpack[_Ts]] = ..., - *, + args: tuple[Unpack[_Ts]], full_output: Literal[True, 1], - complex_func: Literal[True, 1], + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, + limit: int = 50, + points: op.CanGetitem[int, spt.AnyReal] | None = None, + weight: QuadWeights | None = None, + wvar: float | tuple[float, float] | None = None, + wopts: tuple[int, npt.NDArray[np.float32 | np.float64]] | None = None, maxp1: int = 50, limlst: int = 50, - **kwds: Unpack[QuadOpts], + *, + complex_func: Literal[True, 1], ) -> tuple[complex, complex, _QuadComplexFullOutput]: ... # 2-dimensional quadrature +@overload +def dblquad( + func: _QuadFunc2R[spt.AnyReal] | LowLevelCallable, + a: float, + b: float, + gfun: float | Callable[[float], float], + hfun: float | Callable[[float], float], + args: tuple[()] = (), + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, +) -> tuple[float, float]: ... +@overload def dblquad( func: _QuadFunc2R[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, a: float, b: float, gfun: float | Callable[[float], float], hfun: float | Callable[[float], float], - args: tuple[Unpack[_Ts]] = ..., - *, + args: tuple[Unpack[_Ts]], epsabs: float = 1.49e-08, epsrel: float = 1.49e-08, ) -> tuple[float, float]: ... # 3-dimensional quadrature +@overload +def tplquad( + func: _QuadFunc3R[spt.AnyReal] | LowLevelCallable, + a: float, + b: float, + gfun: float | Callable[[float], float], + hfun: float | Callable[[float], float], + qfun: float | Callable[[float, float], float], + rfun: float | Callable[[float, float], float], + args: tuple[()] = (), + epsabs: float = 1.49e-08, + epsrel: float = 1.49e-08, +) -> tuple[float, float]: ... +@overload def tplquad( func: _QuadFunc3R[spt.AnyReal, Unpack[_Ts]] | LowLevelCallable, a: float, @@ -158,8 +286,7 @@ def tplquad( hfun: float | Callable[[float], float], qfun: float | Callable[[float, float], float], rfun: float | Callable[[float, float], float], - args: tuple[Unpack[_Ts]] = ..., - *, + args: tuple[Unpack[_Ts]], epsabs: float = 1.49e-08, epsrel: float = 1.49e-08, ) -> tuple[float, float]: ... @@ -171,10 +298,17 @@ def nquad( ranges: _SizedIterable[_QuadRange | _RangeCallable[_T_f]], args: op.CanIter[op.CanNext[_T_f]] | None = None, opts: QuadOpts | _OptCallable[_T_f] | op.CanIter[op.CanNext[QuadOpts | _OptCallable[_T_f]]] | None = None, - *, full_output: Literal[False, 0, None] = False, ) -> tuple[float, float]: ... @overload +def nquad( + func: _QuadFuncNR[_T_f], + ranges: _SizedIterable[_QuadRange | _RangeCallable[_T_f]], + args: op.CanIter[op.CanNext[_T_f]] | None, + opts: QuadOpts | _OptCallable[_T_f] | op.CanIter[op.CanNext[QuadOpts | _OptCallable[_T_f]]] | None, + full_output: Literal[True, 1], +) -> tuple[float, float, _QuadOutputNC]: ... +@overload def nquad( func: _QuadFuncNR[_T_f], ranges: _SizedIterable[_QuadRange | _RangeCallable[_T_f]], @@ -185,14 +319,12 @@ def nquad( ) -> tuple[float, float, _QuadOutputNC]: ... class _RangeFunc(_RangeCallable[_T_f_contra, _RangeT], Generic[_T_f_contra, _RangeT]): - @property - def range_(self, /) -> _RangeT: ... - def __init__(self, range_: _RangeT, /) -> None: ... + range_: _RangeT + def __init__(self, /, range_: _RangeT) -> None: ... class _OptFunc(_OptCallable[_T_f_contra, _OptT], Generic[_T_f_contra, _OptT]): - @property - def opt(self, /) -> _OptT: ... - def __init__(self, opt: _OptT, /) -> None: ... + opt: _OptT + def __init__(self, /, opt: _OptT) -> None: ... _BT_co = TypeVar("_BT_co", bound=bool, covariant=True, default=bool) @@ -200,21 +332,17 @@ class _NQuad(Generic[_T_f, _BT_co]): abserr: Final[float] maxdepth: Final[int] out_dict: Final[_QuadOutputNC] - @property - def func(self, /) -> _QuadFuncNR[_T_f]: ... - @property - def ranges(self, /) -> list[_RangeFunc[_T_f]]: ... - @property - def opts(self, /) -> list[_OptFunc[_T_f]]: ... - @property - def full_output(self, /) -> bool: ... + func: _QuadFuncNR[_T_f] + ranges: list[_RangeFunc[_T_f]] + opts: list[_OptFunc[_T_f]] + full_output: _BT_co def __init__( self, + /, func: _QuadFuncNR[_T_f], ranges: list[_RangeFunc[_T_f]], opts: list[_OptFunc[_T_f]], full_output: _BT_co, - /, ) -> None: ... @overload def integrate(self: _NQuad[_T_f, Literal[False]], /, *args: _T_f) -> tuple[float, float]: ... diff --git a/scipy-stubs/integrate/_quadrature.pyi b/scipy-stubs/integrate/_quadrature.pyi index c2973bbe..c061542d 100644 --- a/scipy-stubs/integrate/_quadrature.pyi +++ b/scipy-stubs/integrate/_quadrature.pyi @@ -126,11 +126,20 @@ def cumulative_simpson( ) -> npt.NDArray[np.inexact[Any]]: ... # function-based +@overload +def fixed_quad( + func: _VectorizedQuadFunc[_NDT_f], + a: spt.AnyReal, + b: spt.AnyReal, + args: tuple[()] = (), + n: op.CanIndex = 5, +) -> _NDT_f: ... +@overload def fixed_quad( func: _VectorizedQuadFunc[_NDT_f, Unpack[_Ts]], a: spt.AnyReal, b: spt.AnyReal, - args: tuple[Unpack[_Ts]] = ..., + args: tuple[Unpack[_Ts]], n: op.CanIndex = 5, ) -> _NDT_f: ... diff --git a/scipy-stubs/integrate/_tanhsinh.pyi b/scipy-stubs/integrate/_tanhsinh.pyi index 3430648e..980bc447 100644 --- a/scipy-stubs/integrate/_tanhsinh.pyi +++ b/scipy-stubs/integrate/_tanhsinh.pyi @@ -1,3 +1,13 @@ -from scipy._typing import Untyped +from scipy._typing import Untyped, UntypedCallable, UntypedTuple -def nsum(f, a, b, *, step: int = 1, args=(), log: bool = False, maxterms=..., tolerances: Untyped | None = None) -> Untyped: ... +def _nsum( + f: UntypedCallable, + a: Untyped, + b: Untyped, + step: int = 1, + args: UntypedTuple = (), + log: bool = False, + maxterms: int = ..., + atol: float | None = None, + rtol: float | None = None, +) -> Untyped: ...