Skip to content

Commit 1ca0690

Browse files
committed
small refactoring
1 parent b0018b2 commit 1ca0690

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

neo/rawio/openephysbinaryrawio.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _parse_header(self):
129129
# signals zone
130130
# create signals channel map: several channel per stream
131131
signal_channels = []
132-
sync_stream_id_to_buffer = {}
132+
sync_stream_id_to_buffer_id = {}
133133
for stream_index, stream_name in enumerate(sig_stream_names):
134134
# stream_index is the index in vector stream names
135135
stream_id = str(stream_index)
@@ -149,7 +149,7 @@ def _parse_header(self):
149149
if "SYNC" in chan_id and not self.load_sync_channel:
150150
# Every stream sync channel is added as its own stream
151151
stream_id = chan_id
152-
sync_stream_id_to_buffer[stream_id] = buffer_id
152+
sync_stream_id_to_buffer_id[stream_id] = buffer_id
153153

154154
if "ADC" in chan_id:
155155
# These are non-neural channels and their stream should be separated
@@ -182,13 +182,16 @@ def _parse_header(self):
182182

183183
unique_streams_ids = np.unique(signal_channels["stream_id"])
184184

185+
# This is getting too complicated, we probably should just have a table which would be easier to read
186+
# And for users to understand
185187
for stream_id in unique_streams_ids:
186188

187189
# Handle sync channel on a special way
188190
if "SYNC" in stream_id:
189191
# This is a sync channel and should not be added to the signal streams
190-
sync_stream_buffer = sync_stream_id_to_buffer[stream_id]
191-
signal_streams.append((stream_id, stream_id, sync_stream_buffer))
192+
buffer_id = sync_stream_id_to_buffer_id[stream_id]
193+
stream_name = stream_id
194+
signal_streams.append((stream_name, stream_id, buffer_id))
192195
continue
193196

194197
# Neural signal

0 commit comments

Comments
 (0)