Skip to content

Commit 652335f

Browse files
committed
Fix: In openephysbinaryrawio.py, falling and rising indices of events must be arrays of integers, even if empty, otherwise(
it fails when trying to use them to compute durations
1 parent f0a7fb9 commit 652335f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neo/rawio/openephysbinaryrawio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ def _parse_header(self):
292292
rising_indices.extend(rising)
293293
falling_indices.extend(falling)
294294

295-
rising_indices = np.array(rising_indices)
296-
falling_indices = np.array(falling_indices)
295+
rising_indices = np.array(rising_indices, dtype=np.intp)
296+
falling_indices = np.array(falling_indices, dtype=np.intp)
297297

298298
# Sort the indices to maintain chronological order
299299
sorted_order = np.argsort(rising_indices)
300300
rising_indices = rising_indices[sorted_order]
301301
falling_indices = falling_indices[sorted_order]
302302

303-
durations = None
303+
# durations = None
304304
# if len(rising_indices) == len(falling_indices):
305305
durations = timestamps[falling_indices] - timestamps[rising_indices]
306306
if not self._use_direct_evt_timestamps:

0 commit comments

Comments
 (0)