Skip to content

Commit b4b45b3

Browse files
committed
add tests
1 parent f05b92f commit b4b45b3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

neo/rawio/spikeglxrawio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def extract_stream_info(meta_file, meta):
524524
# NIDQ case
525525
has_sync_trace = False
526526

527+
# This is the original name that the file had. It might not match the current name if the user changed it
527528
bin_file_path = meta["fileName"]
528529
fname = Path(bin_file_path).stem
529530

neo/test/rawiotest/test_spikeglxrawio.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ class TestSpikeGLXRawIO(BaseTestRawIO, unittest.TestCase):
4343
"spikeglx/multi_trigger_multi_gate/CatGT/Supercat-A",
4444
]
4545

46+
def test_loading_only_one_probe_in_multi_probe_scenario(self):
47+
from pathlib import Path
48+
local_path_multi_probe_path = Path(self.get_local_path("spikeglx/multi_trigger_multi_gate/SpikeGLX/5-19-2022-CI0"))
49+
gate_folder_path = local_path_multi_probe_path / "5-19-2022-CI0_g0"
50+
probe_folder_path = gate_folder_path / "5-19-2022-CI0_g0_imec1"
51+
52+
rawio = SpikeGLXRawIO(probe_folder_path)
53+
rawio.parse_header()
54+
55+
expected_stream_names = ["imec1.ap", "imec1.lf"]
56+
actual_stream_names = rawio.header["signal_streams"]["name"].tolist()
57+
assert actual_stream_names == expected_stream_names, f"Expected {expected_stream_names}, but got {actual_stream_names}"
58+
4659
def test_with_location(self):
4760
rawio = SpikeGLXRawIO(self.get_local_path("spikeglx/Noise4Sam_g0"), load_channel_location=True)
4861
rawio.parse_header()

0 commit comments

Comments
 (0)