Skip to content

Commit

Permalink
Merge pull request #220 from h-mayorquin/deprecate_numpy
Browse files Browse the repository at this point in the history
`np.in1d` to `np.isin` as the former will be deprecated
  • Loading branch information
alejoe91 authored Sep 22, 2023
2 parents 8bc5b71 + f72d306 commit 06035a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/probeinterface/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,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 positions")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 06035a5

Please sign in to comment.