Skip to content

Commit 97f5b9c

Browse files
authored
Fix GDF NumPy >= 2 (#12909)
1 parent 18c0d44 commit 97f5b9c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/changes/devel/12909.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug in :func:`mne.io.read_raw_gdf` when NumPy >= 2 is used, by `Clemens Brunner`_.

mne/io/edf/edf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ def _read_gdf_header(fname, exclude, include=None):
14431443
ne = np.fromfile(fid, UINT8, 3)
14441444
n_events = ne[0]
14451445
for i in range(1, len(ne)):
1446-
n_events = n_events + ne[i] * 2 ** (i * 8)
1446+
n_events = n_events + int(ne[i]) * 2 ** (i * 8)
14471447
event_sr = np.fromfile(fid, FLOAT32, 1)[0]
14481448

14491449
pos = np.fromfile(fid, UINT32, n_events) - 1 # 1-based inds

0 commit comments

Comments
 (0)