Skip to content

Commit 31b92c4

Browse files
committed
zach feedback
1 parent 28fdcec commit 31b92c4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

neo/rawio/intanrawio.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,13 @@ def read_rhs(filename, file_format: str):
747747

748748
# Build a dictionary with channel count
749749
special_cases_for_counting = [
750-
"DC Amplifier channel", # Same as RHS2000 amplifier channel
751-
"Stim channel", # Same as RHS2000 amplifier channel
750+
"DC Amplifier channel",
751+
"Stim channel",
752752
]
753753
names_to_count = [name for name in stream_names if name not in special_cases_for_counting]
754754
channel_number_dict = {name: len(stream_name_to_channel_info_list[name]) for name in names_to_count}
755+
756+
# Both DC Amplifier and Stim streams have the same number of channels as the amplifier stream
755757
channel_number_dict["DC Amplifier channel"] = channel_number_dict["RHS2000 amplifier channel"]
756758
channel_number_dict["Stim channel"] = channel_number_dict["RHS2000 amplifier channel"]
757759

@@ -1264,6 +1266,8 @@ def create_one_file_per_channel_dict_rhd(dirname):
12641266
raw_files_paths_dict: dict
12651267
A dict of all the file paths
12661268
"""
1269+
# Developer note, at the moment, the channels require to be n in order
1270+
# See https://github.com/NeuralEnsemble/python-neo/issues/1599 fo
12671271

12681272
file_names = dirname.glob("**/*.dat")
12691273
files = [file for file in file_names if file.is_file()]
@@ -1316,9 +1320,7 @@ def create_one_file_per_channel_dict_rhs(
13161320
sorted_stream_files = sorted(stream_files, key=file_path_to_channel_name)
13171321
raw_file_paths_dict[stream_name] = sorted_stream_files
13181322

1319-
# we need time to be the last value
13201323
raw_file_paths_dict["timestamp"] = [Path(dirname / "time.dat")]
1321-
# 10 and 11 are hardcoded in the rhs reader so hardcoded here
13221324
raw_file_paths_dict["DC Amplifier channel"] = [file for file in files if "dc-" in file.name]
13231325
# we can find the files, but I can see how to read them out of header
13241326
# so for now we don't expose the stim files in one-file-per-channel

neo/test/rawiotest/test_intanrawio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def test_annotations(self):
6969

7070

7171
def test_correct_reading_one_file_per_channel(self):
72+
"Issue: https://github.com/NeuralEnsemble/python-neo/issues/1599"
7273
# Test reading of one-file-per-channel format file. The channels should match the raw files
7374
file_path = Path(self.get_local_path("intan/intan_fpc_test_231117_052630/info.rhd"))
7475
intan_reader = IntanRawIO(filename=file_path)

0 commit comments

Comments
 (0)