Skip to content

Commit 08329f0

Browse files
authored
Merge pull request #1658 from scipy/1.18/spatial.tsearch/deprecate
🗑️ `spatial`: deprecate `tsearch`
2 parents e67c075 + 56a0383 commit 08329f0

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

scipy-stubs/spatial/_qhull.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Never, Protocol, final, overload, type_check_only
2-
from typing_extensions import TypeVar
2+
from typing_extensions import TypeVar, deprecated
33

44
import numpy as np
55
import optype.numpy as onp
@@ -248,14 +248,18 @@ class HalfspaceIntersection(_QhullUser):
248248
) -> None: ...
249249
def add_halfspaces(self, /, halfspaces: onp.ToFloat2D, restart: bool = False) -> None: ...
250250

251-
# same as `tri.find_simplex(xi)`
252251
@overload
252+
@deprecated("`tsearch` is deprecated in favor of `Delaunay.find_simplex` and will be removed in SciPy 1.22.0.")
253253
def tsearch(tri: Delaunay, xi: _ToArrayStrictND) -> onp.ArrayND[np.int32]: ...
254254
@overload
255+
@deprecated("`tsearch` is deprecated in favor of `Delaunay.find_simplex` and will be removed in SciPy 1.22.0.")
255256
def tsearch(tri: Delaunay, xi: onp.ToFloatStrict1D) -> onp.Array0D[np.int32]: ...
256257
@overload
258+
@deprecated("`tsearch` is deprecated in favor of `Delaunay.find_simplex` and will be removed in SciPy 1.22.0.")
257259
def tsearch(tri: Delaunay, xi: onp.ToFloatStrict2D) -> onp.Array1D[np.int32]: ...
258260
@overload
261+
@deprecated("`tsearch` is deprecated in favor of `Delaunay.find_simplex` and will be removed in SciPy 1.22.0.")
259262
def tsearch(tri: Delaunay, xi: onp.ToFloatStrict3D) -> onp.Array2D[np.int32]: ...
260263
@overload
264+
@deprecated("`tsearch` is deprecated in favor of `Delaunay.find_simplex` and will be removed in SciPy 1.22.0.")
261265
def tsearch(tri: Delaunay, xi: onp.ToFloatND) -> onp.ArrayND[np.int32]: ...

tests/spatial/test__qhull.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ assert_type(_hsi.dual_vertices, onp.Array1D[np.int32])
108108
###
109109
# tsearch
110110

111-
assert_type(tsearch(_tri, _f64_1d), onp.Array0D[np.int32])
112-
assert_type(tsearch(_tri, _f64_2d), onp.Array1D[np.int32])
113-
assert_type(tsearch(_tri, _f64_3d), onp.Array2D[np.int32])
114-
assert_type(tsearch(_tri, _f64_nd), onp.ArrayND[np.int32])
111+
assert_type(tsearch(_tri, _f64_1d), onp.Array0D[np.int32]) # pyright: ignore[reportDeprecated] # pyrefly:ignore[deprecated]
112+
assert_type(tsearch(_tri, _f64_2d), onp.Array1D[np.int32]) # pyright: ignore[reportDeprecated] # pyrefly:ignore[deprecated]
113+
assert_type(tsearch(_tri, _f64_3d), onp.Array2D[np.int32]) # pyright: ignore[reportDeprecated] # pyrefly:ignore[deprecated]
114+
assert_type(tsearch(_tri, _f64_nd), onp.ArrayND[np.int32]) # pyright: ignore[reportDeprecated] # pyrefly:ignore[deprecated]

0 commit comments

Comments
 (0)