Skip to content

Commit a0efaa1

Browse files
committed
Alessio's suggestion
1 parent 0ceaa65 commit a0efaa1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

neo/rawio/biocamrawio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,13 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop, strea
140140
# some careful checks around slicing of None in the case we need to iterate through
141141
# channels. First check if None. Then check if slice and only if slice check that it is slice(None)
142142
else:
143-
if (channel_indexes is None) or (isinstance(channel_indexes, slice) and channel_indexes == slice(None)):
143+
if channel_indexes is None:
144144
channel_indexes = [ch for ch in range(self._num_channels)]
145+
elif isinstance(channel_indexes, slice):
146+
start = channel_indexes.start or 0
147+
stop = channel_indexes.stop or self._num_channels
148+
step = channel_indexes.step or 1
149+
channel_indexes = [ch for ch in range(start, stop, step)]
145150

146151
sig_chunk = np.zeros((i_stop - i_start, len(channel_indexes)))
147152
# iterate through channels to prevent loading all channels into memory which can cause

0 commit comments

Comments
 (0)