Skip to content

Commit 92cf6f2

Browse files
Backport PR #12909 on branch maint/1.8 (Fix GDF NumPy >= 2) (#12915)
Co-authored-by: Clemens Brunner <clemens.brunner@gmail.com>
1 parent ac2c4c0 commit 92cf6f2

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
@@ -1442,7 +1442,7 @@ def _read_gdf_header(fname, exclude, include=None):
14421442
ne = np.fromfile(fid, UINT8, 3)
14431443
n_events = ne[0]
14441444
for i in range(1, len(ne)):
1445-
n_events = n_events + ne[i] * 2 ** (i * 8)
1445+
n_events = n_events + int(ne[i]) * 2 ** (i * 8)
14461446
event_sr = np.fromfile(fid, FLOAT32, 1)[0]
14471447

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

0 commit comments

Comments
 (0)