Skip to content

Commit 66797fa

Browse files
committed
Fix variable naming
1 parent 235194b commit 66797fa

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

neo/rawio/maxwellrawio.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,23 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,
194194
if np.array(channel_indexes).size > 1 and np.any(np.diff(channel_indexes) < 0):
195195
# get around h5py constraint that it does not allow datasets
196196
# to be indexed out of order
197-
channel_indexes = np.sort(channel_indexes)
197+
sorted_channel_indexes = np.sort(channel_indexes)
198198
resorted_indexes = np.array(
199-
[list(channel_indexes).index(ch) for ch in channel_indexes])
199+
[list(channel_indexes).index(ch) for ch in sorted_channel_indexes])
200200

201201
try:
202-
if self._old_format:
203-
sigs = sigs[self._channel_slice, i_start:i_stop]
204-
sigs = sigs[channel_indexes]
202+
if resorted_indexes is None:
203+
if self._old_format:
204+
sigs = sigs[self._channel_slice, i_start:i_stop]
205+
sigs = sigs[channel_indexes]
206+
else:
207+
sigs = sigs[channel_indexes, i_start:i_stop]
205208
else:
206-
sigs = sigs[channel_indexes, i_start:i_stop]
207-
if resorted_indexes is not None:
209+
if self._old_format:
210+
sigs = sigs[self._channel_slice, i_start:i_stop]
211+
sigs = sigs[sorted_channel_indexes]
212+
else:
213+
sigs = sigs[sorted_channel_indexes, i_start:i_stop]
208214
sigs = sigs[resorted_indexes]
209215
except OSError as e:
210216
print('*' * 10)

0 commit comments

Comments
 (0)