From 65e7120172516ff310113273b97187e4c2375668 Mon Sep 17 00:00:00 2001 From: jorenham Date: Mon, 23 Dec 2024 00:18:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20`interpolate`:=20`@depr?= =?UTF-8?q?ecate`=20the=20`dfitpack`=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scipy-stubs/interpolate/dfitpack.pyi | 69 +++++++++++++++++----------- tests/interpolate/_dfitpack.pyi | 0 tests/interpolate/dfitpack.pyi | 6 +++ 3 files changed, 49 insertions(+), 26 deletions(-) create mode 100644 tests/interpolate/_dfitpack.pyi create mode 100644 tests/interpolate/dfitpack.pyi diff --git a/scipy-stubs/interpolate/dfitpack.pyi b/scipy-stubs/interpolate/dfitpack.pyi index 6cfb8b09..31236038 100644 --- a/scipy-stubs/interpolate/dfitpack.pyi +++ b/scipy-stubs/interpolate/dfitpack.pyi @@ -1,5 +1,7 @@ # This module is not meant for public use and will be removed in SciPy v2.0.0. -from typing import Final + +from typing import Any, Final, Protocol, type_check_only +from typing_extensions import deprecated __all__ = [ "bispeu", @@ -29,28 +31,43 @@ __all__ = [ "types", ] -bispeu: Final[object] -bispev: Final[object] -curfit: Final[object] -dblint: Final[object] -fpchec: Final[object] -fpcurf0: Final[object] -fpcurf1: Final[object] -fpcurfm1: Final[object] -parcur: Final[object] -parder: Final[object] -pardeu: Final[object] -pardtc: Final[object] -percur: Final[object] -regrid_smth: Final[object] -regrid_smth_spher: Final[object] -spalde: Final[object] -spherfit_lsq: Final[object] -spherfit_smth: Final[object] -splder: Final[object] -splev: Final[object] -splint: Final[object] -sproot: Final[object] -surfit_lsq: Final[object] -surfit_smth: Final[object] -types: Final[object] +### + +@type_check_only +class _DeprecatedFortranFunction(Protocol): + __name__: str + + @deprecated( + "The `scipy.interpolate.dfitpack` namespace is deprecated and will be removed in SciPy 2.0.0. " + "Please use the `scipy.interpolate` namespace instead." + ) + def __call__(self, /, *args: object, **kwds: object) -> Any: ... # noqa: ANN401 + +### + +bispeu: Final[_DeprecatedFortranFunction] = ... +bispev: Final[_DeprecatedFortranFunction] = ... +fpchec: Final[_DeprecatedFortranFunction] = ... +fpcurf0: Final[_DeprecatedFortranFunction] = ... +fpcurf1: Final[_DeprecatedFortranFunction] = ... +fpcurfm1: Final[_DeprecatedFortranFunction] = ... +dblint: Final[_DeprecatedFortranFunction] = ... +parcur: Final[_DeprecatedFortranFunction] = ... +parder: Final[_DeprecatedFortranFunction] = ... +pardeu: Final[_DeprecatedFortranFunction] = ... +pardtc: Final[_DeprecatedFortranFunction] = ... +percur: Final[_DeprecatedFortranFunction] = ... +regrid_smth: Final[_DeprecatedFortranFunction] = ... +regrid_smth_spher: Final[_DeprecatedFortranFunction] = ... +curfit: Final[_DeprecatedFortranFunction] = ... +spherfit_lsq: Final[_DeprecatedFortranFunction] = ... +spherfit_smth: Final[_DeprecatedFortranFunction] = ... +surfit_lsq: Final[_DeprecatedFortranFunction] = ... +surfit_smth: Final[_DeprecatedFortranFunction] = ... +types: Final[_DeprecatedFortranFunction] = ... + +spalde: Final[_DeprecatedFortranFunction] = ... +splder: Final[_DeprecatedFortranFunction] = ... +splev: Final[_DeprecatedFortranFunction] = ... +splint: Final[_DeprecatedFortranFunction] = ... +sproot: Final[_DeprecatedFortranFunction] = ... diff --git a/tests/interpolate/_dfitpack.pyi b/tests/interpolate/_dfitpack.pyi new file mode 100644 index 00000000..e69de29b diff --git a/tests/interpolate/dfitpack.pyi b/tests/interpolate/dfitpack.pyi new file mode 100644 index 00000000..326ebc3f --- /dev/null +++ b/tests/interpolate/dfitpack.pyi @@ -0,0 +1,6 @@ +# test the deprecations of the "fortran functions" of the deprecated `scipy.interpolate.dfitpack` namespace + +from scipy.interpolate import dfitpack + +dfitpack.spalde(1, 1, 1, 1) # pyright: ignore[reportDeprecated] +dfitpack.bispeu(1, 1, 1, 1, 1, 1, 1) # pyright: ignore[reportDeprecated]