Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

np.in1d to np.isin as the former will be deprecated #220

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/probeinterface/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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