the-siesta-group / edfio

Read and write EDF/EDF+ files.
Apache License 2.0
25 stars 5 forks source link

Lazy load raw data #47

Closed marcoross closed 2 months ago

marcoross commented 3 months ago

In some applications, it might be required to analyze data from EDF headers for many files without immediate access to all raw signals. Therefore, it might be advantageous to lazy load raw data on the first access.

hofaflo commented 3 months ago

Good idea! To avoid issues when working with remote files, I think it would make sense to make this optional, with a parameter in read_edf (e.g. preload, like in mne.io.read_raw_edf). I'm not sure which behavior should be the default though, what do you think?

cbrnr commented 3 months ago

If the behavior is transparent, then lazy loading would be a good default. That is, the data should automatically be loaded when needed without having to explicitly call a method like load_data() (which is how it's done in MNE). If this is not feasible, I'd default to loading the data.