Add generic reader function?
See original GitHub issueAt some point we’ve already discussed if adding a generic reader function (mne.io.read_raw
) would be useful. I can’t find the relevant discussion, but I think that we decided that users should stick to the separate readers.
I’ve written such a wrapper function for MNELAB (https://github.com/cbrnr/mnelab/pull/148), and I think this might still be a good idea to include in MNE. It makes things easier for users - the file extension already determines the file type, so why do they have to explicitly pick the right function if this could be done automatically?
Of course this is not meant to replace the individual readers - it’s just a convenience wrapper that should work for the most common file types.
mne.io.read_raw("test.vhdr")
mne.io.read_raw("test.edf")
mne.io.read_raw("test.bdf")
mne.io.read_raw("test.set")
# ... you get the point
I’m fine if people decide (again) not to include this (“There should be one-- and preferably only one --obvious way to do it”). But in that case, I’d like to ask if anyone has a good idea how to include the true MNE reader function calls in MNELAB’s history without creating too big of a mess. Currently, I stick to just using mnelab.io.read_raw
for history entries because it keeps the code so much simpler. Suggestions are very much appreciated (either here or at https://github.com/cbrnr/mnelab/pull/148)!
Issue Analytics
- State:
- Created 3 years ago
- Comments:35 (35 by maintainers)
Top GitHub Comments
would you expose at least the verbose and preload option to read_raw without kwargs? these are supported by all readers.
Probably a new
mne/io/_read_raw.py
– it will need to import all other readers at the top, so a separate module will help avoid circular imports