From 7ec87a8d85ed9707c1a860c7d8e8558dad92d679 Mon Sep 17 00:00:00 2001 From: jorenham Date: Sun, 22 Dec 2024 03:42:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AC=20`interpolate`:=20fix=20scipy=20v?= =?UTF-8?q?ersion=20in=20`interpnd`=20deprecation=20warning=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scipy-stubs/interpolate/interpnd.pyi | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scipy-stubs/interpolate/interpnd.pyi b/scipy-stubs/interpolate/interpnd.pyi index 7e94af67..2e1dea66 100644 --- a/scipy-stubs/interpolate/interpnd.pyi +++ b/scipy-stubs/interpolate/interpnd.pyi @@ -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__ = [ @@ -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): ... @@ -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]: ...