Skip to content

Commit 1539b1f

Browse files
committed
more np type avoidance for doctest
1 parent ff2a553 commit 1539b1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mne_bids/read.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,11 @@ def events_file_to_annotation_kwargs(events_fname: str | Path) -> dict:
678678
culled_vals = culled_vals.astype(int)
679679
except ValueError: # numeric, but has some non-integer values
680680
pass
681+
# purge any np.str_, np.int_, or np.float_ types
682+
culled_vals = np.asarray(culled_vals).tolist()
681683
event_id = dict(zip(culled[trial_type_col_name], culled_vals))
682684
else:
683-
event_id = dict(zip(trial_types, np.arange(len(trial_types))))
685+
event_id = dict(zip(trial_types, list(range(len(trial_types)))))
684686
descrs = np.asarray(trial_types, dtype=str)
685687

686688
# convert onsets & durations to floats ("n/a" onsets were already dropped)

0 commit comments

Comments
 (0)