-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MRG, ENH: Add mne.export #9427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MRG, ENH: Add mne.export #9427
Conversation
|
|
||
|
|
||
| @verbose | ||
| def export_raw(fname, raw, fmt='auto', verbose=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have both BaseRaw.export and Epochs.export? it seems quite redundant here no?
so maybe?
| def export_raw(fname, raw, fmt='auto', verbose=None): | |
| def _export_raw(fname, raw, fmt='auto', verbose=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea is to expose a uniform interface mne.export.export_* to people for all exporting functions (raw, epochs, and evoked), as it's nice to expose all exporting methods there. It is redundant with mne.Epochs.export(...), but so are mne.Epochs.plot / mne.viz.plot_epochs, mne.Covariance.save / mne.write_cov, etc. -- I think of this as a similar method-to-function mapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I can live without it though if you're not convinced)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drammock you decide :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't object to the function/method redundancy.
Question about Evokeds: the class method on Evoked would pass [self] to the mne.export.export_evokeds right? So the function can handle multiple instances, but the class method only one instance? That's how I would expect it to work anyway.
I don't see the class-method versions in this changeset? Is that in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the class-method versions in this changeset? Is that in a separate PR?
You mean Epochs.export(...) and Raw.export(...)? Those are already in main. Evoked.export will be part of #9406
the class method on Evoked would pass [self] to the mne.export.export_evokeds right...
Yep, that's the plan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the class-method versions in this changeset? Is that in a separate PR?
You mean
Epochs.export(...)andRaw.export(...)? Those are already inmain.
Never mind, I just wasn't reading the diff carefully enough. I see now the nested from .export import export_epochs
|
let's go this way with public export_xxx functions then
… |
* upstream/main: [MRG] change utils.logger.warning -> utils.warn (mne-tools#9434) FIX : rank computation from info now uses SSS proc history if only grad or mag are present (mne-tools#9435) MRG: Enable interpolation for all fNIRS types (mne-tools#9431) FIX: brain save_movie (mne-tools#9426) ENH: Add mne.export (mne-tools#9427) ENH: Test more on pre [skip circle] (mne-tools#9423) MRG, ENH: Speed up brain test (mne-tools#9422) MAINT: Update URL [ci skip] MNT: Reduce number of calls to _update (mne-tools#9407) MRG: Tutorial improvements (mne-tools#9416)
Implements the first part of #9406 (comment)
Having implemented it, it seems like a really nice separation of functionality actually.
mne/epochs.pyandmne/io/base.pyare cleaner, tests are inmne/export/tests, andmne/export/_eeglab.pycan have un-nested imports for its implementation, which is nice.