From: Guillaume Gisbert Date: Mon, 8 Dec 2025 08:06:41 +0000 (+0100) Subject: [PATCH 1/2] Remove deleted numpy function in1d X-Git-Tag: archive/raspbian/9.5.2+dfsg4-5+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a5601665ed8ebe18534e4aa648c23ddda2d3eebc;p=vtk9.git [PATCH 1/2] Remove deleted numpy function in1d Gbp-Pq: Name numpy_drop_in1d_MR12693.patch --- diff --git a/Common/Core/Testing/Python/TestNumpyInterface.py b/Common/Core/Testing/Python/TestNumpyInterface.py index b49166bf0..b0f2358a3 100644 --- a/Common/Core/Testing/Python/TestNumpyInterface.py +++ b/Common/Core/Testing/Python/TestNumpyInterface.py @@ -119,7 +119,7 @@ compare(randomVec[dsa.VTKCompositeDataArray([(slice(None, None, None), slice(0,2 compare(algs.cos(randomVec) - numpy.cos(npa), 1E-7) assert algs.cos(randomVec).DataSet is randomVec.DataSet -assert algs.in1d(elev, [0,1]) == [item in [0, 1] for item in elev] +assert algs.isin(elev, [0,1]) == [item in [0, 1] for item in elev] # Various numerical ops implemented in VTK g = algs.gradient(elev) diff --git a/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py b/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py index b4c7e5d3a..56ebc3556 100644 --- a/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py +++ b/Wrapping/Python/vtkmodules/numpy_interface/algorithms.py @@ -981,8 +981,8 @@ def unstructured_from_composite_arrays(points, arrays, controller=None): ugrid.GetPointData().AddArray(da) return ugrid -in1d = _make_ufunc(numpy.in1d) -in1d.__doc__ = "Test whether each element of a 1-D array is also present in a second array." +isin = _make_ufunc(numpy.isin) +isin.__doc__ = "Test whether each element of a 1-D array is also present in a second array." isnan = _make_ufunc(numpy.isnan) isnan.__doc__ = "Returns a bool array, true if values is nan."