From f72d3064a2e99516390df927c02a4f14205b0d06 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Fri, 15 Sep 2023 14:25:13 +0200 Subject: [PATCH] deprecate np.in1d --- src/probeinterface/probe.py | 2 +- tests/test_io/test_io.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/probeinterface/probe.py b/src/probeinterface/probe.py index eccc7e0..22bcd18 100644 --- a/src/probeinterface/probe.py +++ b/src/probeinterface/probe.py @@ -199,7 +199,7 @@ def set_contacts(self, positions, shapes="circle", shape_params={"radius": 10}, if isinstance(shapes, str): shapes = [shapes] * n shapes = np.array(shapes) - if not np.all(np.in1d(shapes, _possible_contact_shapes)): + if not np.all(np.isin(shapes, _possible_contact_shapes)): raise ValueError(f"contacts shape must be in {_possible_contact_shapes}") if shapes.shape[0] != n: raise ValueError("contacts shape must have same length as posistions") diff --git a/tests/test_io/test_io.py b/tests/test_io/test_io.py index a1b9ee4..662a341 100644 --- a/tests/test_io/test_io.py +++ b/tests/test_io/test_io.py @@ -99,7 +99,7 @@ def test_BIDS_format(tmp_path): assert probe_orig.annotations.items() <= probe_read.annotations.items() # check if the same attribute lists are present (independent of order) assert len(probe_orig.contact_ids) == len(probe_read.contact_ids) - assert all(np.in1d(probe_orig.contact_ids, probe_read.contact_ids)) + assert all(np.isin(probe_orig.contact_ids, probe_read.contact_ids)) # the transformation of contact order between the two probes t = np.array(