Read edf and exclude annotations

Hi all,

I’m reading in a large edf file that contains many annotations (a 24hr clinical recording). Unfortunately parsing the annotations takes a long long time (about 1.5hrs). I’ve tried excluding annotations from being read by using read_raw_edf('my_edf_file.edf',exclude=['EDF Annotations']) but that doesn’t work. This makes it very time-consuming to just open a file. Is there any way I can stop the EDF+ annotations from being parsed? Any help is greatly appreciated.

Noah

so it’s this line

https://github.com/mne-tools/mne-python/blob/main/mne/io/edf/edf.py#L134

that takes ages?

can you try to call

mne.read_annotations on this file? is it also slow?

Alex

I ran that and yes it’s slow. It actually crashed because it was too much memory. Before when I read the edf with read_raw_edf() it omitted 4 annotations possibly due to the size but it still loaded them. But read_annotations() just crashed and didn’t return anything. Any thoughts?

Thanks for the help,

Noah

here the relevant function

https://github.com/mne-tools/mne-python/blob/main/mne/io/edf/edf.py#L1371:5

I fear you’ll have to debug this yourself or share a file with us.

Alex