Skip to content

Commit 26a7d33

Browse files
authored
Merge pull request #308 from iurillilab/fix-disabled-probe
Fix OpenEphys interface issue with multiple probes of which some are disabled
2 parents 1fc2d35 + 705c0d1 commit 26a7d33

File tree

4 files changed

+1230
-3
lines changed

4 files changed

+1230
-3
lines changed

src/probeinterface/io.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,15 @@ def read_openephys(
17001700
raise Exception("NP_PROBE field not found in settings")
17011701
return None
17021702

1703+
# In neuropixel plugin 0.7.0, the option for enabling/disabling probes was added.
1704+
# Make sure we only keep enabled probes.
1705+
if neuropix_pxi_version >= parse("0.7.0") and neuropix_pxi_version < parse("1.0.0dev0"):
1706+
np_probes = [probe for probe in np_probes if probe.attrib["isEnabled"] == "1"]
1707+
if len(np_probes) == 0:
1708+
if raise_error:
1709+
raise Exception("No enabled probes found in settings")
1710+
return None
1711+
17031712
# read probes info
17041713
# If STREAMs are not available, probes are sequentially named based on the node id
17051714
if not has_streams:
@@ -1861,23 +1870,23 @@ def read_openephys(
18611870
if available_probe_name not in stream_name:
18621871
if raise_error:
18631872
raise Exception(
1864-
f"Inconsistency betweem provided stream {stream_name} and available probe "
1873+
f"Inconsistency between provided stream {stream_name} and available probe "
18651874
f"{available_probe_name}"
18661875
)
18671876
return None
18681877
if probe_name:
18691878
if probe_name != available_probe_name:
18701879
if raise_error:
18711880
raise Exception(
1872-
f"Inconsistency betweem provided probe name {probe_name} and available probe "
1881+
f"Inconsistency between provided probe name {probe_name} and available probe "
18731882
f"{available_probe_name}"
18741883
)
18751884
return None
18761885
if serial_number:
18771886
if str(serial_number) != available_serial_number:
18781887
if raise_error:
18791888
raise Exception(
1880-
f"Inconsistency betweem provided serial number {serial_number} and available serial numbers "
1889+
f"Inconsistency between provided serial number {serial_number} and available serial numbers "
18811890
f"{available_serial_number}"
18821891
)
18831892
return None

0 commit comments

Comments
 (0)