Skip to content

Commit

Permalink
Fix GDF NumPy >= 2 (#12909)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrnr authored Oct 22, 2024
1 parent 18c0d44 commit 97f5b9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changes/devel/12909.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in :func:`mne.io.read_raw_gdf` when NumPy >= 2 is used, by `Clemens Brunner`_.
2 changes: 1 addition & 1 deletion mne/io/edf/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ def _read_gdf_header(fname, exclude, include=None):
ne = np.fromfile(fid, UINT8, 3)
n_events = ne[0]
for i in range(1, len(ne)):
n_events = n_events + ne[i] * 2 ** (i * 8)
n_events = n_events + int(ne[i]) * 2 ** (i * 8)
event_sr = np.fromfile(fid, FLOAT32, 1)[0]

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

0 comments on commit 97f5b9c

Please sign in to comment.