Skip to content

Commit

Permalink
🗑️ interpolate: @deprecate the dfitpack functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Dec 22, 2024
1 parent 3c01df6 commit 65e7120
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 26 deletions.
69 changes: 43 additions & 26 deletions scipy-stubs/interpolate/dfitpack.pyi
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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] = ...
Empty file added tests/interpolate/_dfitpack.pyi
Empty file.
6 changes: 6 additions & 0 deletions tests/interpolate/dfitpack.pyi
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit 65e7120

Please sign in to comment.