Skip to content

Commit 6f08db3

Browse files
author
sprenger
committed
[edf] fix efficient array handling
1 parent 45f8399 commit 6f08db3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

neo/rawio/edfrawio.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop,
197197
self.edf_reader.read_digital_signal(channel_idx, i_start, n, buffer)
198198
data.append(buffer)
199199

200+
# downgrade to int16 as this is what is used in the edf file format
201+
# use fortran (column major) order to be more efficient after transposal
202+
data = np.asarray(data, dtype=np.int16, order='F')
203+
200204
# use dimensions (time, channel)
201205
data = data.T
202206

203-
# downgrade to int16 as this is what is used in the edf file format
204-
data = np.asarray(data, dtype=np.int16)
205-
206207
return data
207208

208209
def _spike_count(self, block_index, seg_index, spike_channel_index):

0 commit comments

Comments
 (0)