Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💬 interpolate: fix scipy version in interpnd deprecation warning messages #366

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions scipy-stubs/interpolate/interpnd.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import Any
from typing_extensions import deprecated

import numpy as np
import optype.numpy as onp
from scipy.spatial._qhull import DelaunayInfo_t
from . import _interpnd

__all__ = [
Expand All @@ -11,18 +13,16 @@ __all__ = [
"estimate_gradients_2d_global",
]

# NOTE: See https://github.com/scipy/scipy/issues/22097 for `GradientEstimationWarning` and `NDInterpolatorBase`

@deprecated(
"`scipy.interpolate.interpnd.GradientEstimationWarning` is deprecated along with the `scipy.interpolate.interpnd` namespace. "
"`scipy.interpolate.interpnd.GradientEstimationWarning` will be removed in SciPy 1.14.0, "
"`scipy.interpolate.interpnd.GradientEstimationWarning` will be removed in SciPy 1.17.0, "
"and the `scipy.interpolate.interpnd` namespace will be removed in SciPy 2.0.0."
)
class GradientEstimationWarning(_interpnd.GradientEstimationWarning): ...

@deprecated(
"`scipy.interpolate.interpnd.NDInterpolatorBase` is deprecated along with the `scipy.interpolate.interpnd` namespace. "
"`scipy.interpolate.interpnd.NDInterpolatorBase` will be removed in SciPy 1.14.0, and the `scipy.interpolate.interpnd` "
"`scipy.interpolate.interpnd.NDInterpolatorBase` will be removed in SciPy 1.17.0, and the `scipy.interpolate.interpnd` "
"namespace will be removed in SciPy 2.0.0."
)
class NDInterpolatorBase(_interpnd.NDInterpolatorBase): ...
Expand All @@ -41,7 +41,12 @@ class LinearNDInterpolator(_interpnd.LinearNDInterpolator): ...

@deprecated(
"`scipy.interpolate.interpnd.estimate_gradients_2d_global` is deprecated along with the `scipy.interpolate.interpnd` "
"namespace. `scipy.interpolate.interpnd.estimate_gradients_2d_global` will be removed in SciPy 1.14.0, and the "
"namespace. `scipy.interpolate.interpnd.estimate_gradients_2d_global` will be removed in SciPy 1.17.0, and the "
"`scipy.interpolate.interpnd` namespace will be removed in SciPy 2.0.0."
)
def estimate_gradients_2d_global(tri: object, y: object, maxiter: int = 400, tol: float = 1e-6) -> Any: ... # noqa: ANN401
def estimate_gradients_2d_global(
tri: DelaunayInfo_t,
y: onp.ToComplex1D | onp.ToComplex2D,
maxiter: int = 400,
tol: float = 1e-6,
) -> onp.Array3D[np.float64] | onp.Array3D[np.complex128]: ...
Loading