diff --git a/scipy-stubs/integrate/__init__.pyi b/scipy-stubs/integrate/__init__.pyi index 37940ee2..b02a7773 100644 --- a/scipy-stubs/integrate/__init__.pyi +++ b/scipy-stubs/integrate/__init__.pyi @@ -1,4 +1,4 @@ -from . import _ode, _odepack_py, _quadpack_py, _quadrature, dop, lsoda, odepack, quadpack, vode +from . import dop, lsoda, odepack, quadpack, vode # deprecated namespaces from ._bvp import solve_bvp from ._ivp import ( BDF, @@ -18,22 +18,42 @@ from ._quad_vec import quad_vec from ._quadpack_py import * from ._quadrature import * -__all__ = ["dop", "lsoda", "odepack", "quadpack", "vode"] -__all__ += [ +__all__ = [ "BDF", "DOP853", "LSODA", "RK23", "RK45", + "AccuracyWarning", "DenseOutput", + "IntegrationWarning", + "ODEintWarning", "OdeSolution", "OdeSolver", "Radau", + "complex_ode", + "cumulative_simpson", + "cumulative_trapezoid", + "dblquad", + "dop", + "fixed_quad", + "lsoda", + "newton_cotes", + "nquad", + "ode", + "odeint", + "odepack", + "qmc_quad", + "quad", "quad_vec", + "quadpack", + "quadrature", + "romb", + "romberg", + "simpson", "solve_bvp", "solve_ivp", + "tplquad", + "trapezoid", + "vode", ] -__all__ += _ode.__all__ -__all__ += _odepack_py.__all__ -__all__ += _quadpack_py.__all__ -__all__ += _quadrature.__all__ diff --git a/scipy-stubs/integrate/_ivp/__init__.pyi b/scipy-stubs/integrate/_ivp/__init__.pyi index cc129d5f..84f2f09c 100644 --- a/scipy-stubs/integrate/_ivp/__init__.pyi +++ b/scipy-stubs/integrate/_ivp/__init__.pyi @@ -1,10 +1,9 @@ -from .base import DenseOutput, OdeSolver -from .bdf import BDF -from .common import OdeSolution -from .ivp import solve_ivp -from .lsoda import LSODA -from .radau import Radau -from .rk import DOP853, RK23, RK45 +from .base import DenseOutput as DenseOutput, OdeSolver as OdeSolver +from .bdf import BDF as BDF +from .common import OdeSolution as OdeSolution +from .ivp import solve_ivp as solve_ivp +from .lsoda import LSODA as LSODA +from .radau import Radau as Radau +from .rk import DOP853 as DOP853, RK23 as RK23, RK45 as RK45 -# NOTE: this __all__ does not exist at runtime -__all__ = ["BDF", "DOP853", "LSODA", "RK23", "RK45", "DenseOutput", "OdeSolution", "OdeSolver", "Radau", "solve_ivp"] +# NOTE: There is no `__all__` at runtime diff --git a/scipy-stubs/integrate/_quadrature.pyi b/scipy-stubs/integrate/_quadrature.pyi index fff7ba2e..46871597 100644 --- a/scipy-stubs/integrate/_quadrature.pyi +++ b/scipy-stubs/integrate/_quadrature.pyi @@ -154,9 +154,29 @@ def qmc_quad( log: bool = False, ) -> QMCQuadResult: ... @deprecated("deprecated as of SciPy 1.12.0 and will be removed in SciPy 1.15.0") -def quadrature(*args: object, **kwargs: object) -> tuple[float, float]: ... +def quadrature( + func: object, + a: object, + b: object, + args: tuple[object, ...] = (), + tol: float = ..., + rtol: float = ..., + maxiter: int = ..., + vec_func: bool = ..., + miniter: int = ..., +) -> tuple[float, float]: ... @deprecated("deprecated as of SciPy 1.12.0 and will be removed in SciPy 1.15.0") -def romberg(*args: object, **kwargs: object) -> float: ... +def romberg( + function: object, + a: object, + b: object, + args: tuple[object, ...] = (), + tol: float = ..., + rtol: float = ..., + show: bool = ..., + divmax: int = ..., + vec_func: bool = ..., +) -> float: ... # low-level def newton_cotes(rn: int, equal: int = 0) -> tuple[onpt.Array[tuple[int], np.float64], float]: ... diff --git a/scipy-stubs/integrate/lsoda.pyi b/scipy-stubs/integrate/lsoda.pyi index e7d246f9..2fab303e 100644 --- a/scipy-stubs/integrate/lsoda.pyi +++ b/scipy-stubs/integrate/lsoda.pyi @@ -1,9 +1,4 @@ # This file is not meant for public use and will be removed in SciPy v2.0.0. -from typing_extensions import Never, deprecated +__all__ = ["lsoda"] -__all__: list[Never] = [] - -@deprecated("will be removed in SciPy 2.0.0.") -def __dir__() -> list[Never]: ... -@deprecated("will be removed in SciPy 2.0.0.") -def __getattr__(name: str) -> Never: ... # pyright: ignore[reportIncompleteStub] +lsoda: object diff --git a/scipy-stubs/integrate/odepack.pyi b/scipy-stubs/integrate/odepack.pyi index e7d246f9..9b520763 100644 --- a/scipy-stubs/integrate/odepack.pyi +++ b/scipy-stubs/integrate/odepack.pyi @@ -1,9 +1,9 @@ # This file is not meant for public use and will be removed in SciPy v2.0.0. -from typing_extensions import Never, deprecated +from typing_extensions import deprecated -__all__: list[Never] = [] +from ._odepack_py import odeint + +__all__ = ["ODEintWarning", "odeint"] @deprecated("will be removed in SciPy 2.0.0.") -def __dir__() -> list[Never]: ... -@deprecated("will be removed in SciPy 2.0.0.") -def __getattr__(name: str) -> Never: ... # pyright: ignore[reportIncompleteStub] +class ODEintWarning(Warning): ... diff --git a/scipy-stubs/integrate/quadpack.pyi b/scipy-stubs/integrate/quadpack.pyi index e7d246f9..16f71996 100644 --- a/scipy-stubs/integrate/quadpack.pyi +++ b/scipy-stubs/integrate/quadpack.pyi @@ -1,9 +1,9 @@ # This file is not meant for public use and will be removed in SciPy v2.0.0. -from typing_extensions import Never, deprecated +from typing_extensions import deprecated -__all__: list[Never] = [] +from ._quadpack_py import dblquad, nquad, quad, tplquad -@deprecated("will be removed in SciPy 2.0.0.") -def __dir__() -> list[Never]: ... -@deprecated("will be removed in SciPy 2.0.0.") -def __getattr__(name: str) -> Never: ... # pyright: ignore[reportIncompleteStub] +__all__ = ["IntegrationWarning", "dblquad", "nquad", "quad", "tplquad"] + +@deprecated("will be removed in SciPy v2.0.0") +class IntegrationWarning(UserWarning): ... diff --git a/tests/stubtest/allowlist.txt b/tests/stubtest/allowlist.txt index 566569ae..fe305dab 100644 --- a/tests/stubtest/allowlist.txt +++ b/tests/stubtest/allowlist.txt @@ -80,13 +80,6 @@ scipy.stats._unuran.unuran_wrapper # deprecated public api (will be removed in scipy 2.0.0) scipy.constants.codata scipy.constants.constants -scipy.integrate.lsoda.* -scipy.integrate.odepack.* -scipy.integrate.quadpack.* -scipy.integrate.quadrature -scipy.integrate.romberg -scipy.integrate._quadrature.quadrature -scipy.integrate._quadrature.romberg scipy.linalg.basic.* scipy.linalg.decomp.* scipy.linalg.matfuncs.* @@ -108,7 +101,6 @@ scipy.interpolate._interpnd_info # deprecated submodules are removed from these `__all__` scipy.constants.__all__ -scipy.integrate.__all__ scipy.linalg.__all__ scipy.stats.__all__ @@ -116,11 +108,7 @@ scipy.stats.__all__ scipy._lib._ccallback.__all__ scipy._lib.array_api_compat.__all__ scipy._lib.array_api_compat.common.__all__ -scipy.integrate._ivp.__all__ scipy.signal._signaltools.__all__ -scipy.spatial.ckdtree.__all__ -scipy.spatial.kdtree.__all__ -scipy.spatial.qhull.__all__ scipy.sparse._matrix.__all__ scipy.sparse.csgraph.__all__ scipy.sparse.csgraph._flow.__all__ @@ -133,6 +121,9 @@ scipy.sparse.csgraph._tools.__all__ scipy.sparse.csgraph._traversal.__all__ scipy.sparse.linalg._dsolve.__all__ scipy.sparse.linalg._dsolve._superlu.__all__ +scipy.spatial.ckdtree.__all__ +scipy.spatial.kdtree.__all__ +scipy.spatial.qhull.__all__ scipy.spatial.transform._rotation.__all__ scipy.spatial.transform._rotation_spline.__all__ scipy.stats._binomtest.__all__