-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MRG: Add argument overwrite to export for raws and epochs to match save. #9975
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: Add argument overwrite to export for raws and epochs to match save. #9975
Conversation
|
Agreed we should have it. However, the |
|
(i.e., just have |
agramfort
left a comment
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.
good idea !
|
Quick question while the CI is running, if you intend to backport this to 0.24 and to avoid the deprecation cycle, do you want to have |
|
|
|
Ok, one more question: when I look at the documentation for the added export module, I see: Why is Also, I will add |
It allows for extra arguments not usually needed or used by the other exporters. See #9406 (comment) and other points of discussion in that PR if interested |
|
You can ignore pip-pre for now as it should be fixed by #9973 |
|
Ok, it makes sense. Personally, I would have been in favor of passing I will add |
|
@larsoner Well adding How do you feel about the idea of deleting the file prior to calling |
I would open an issue upstream and for now delete at our end until they release a version that supports |
|
@larsoner Alright, so let's leave this PR as it is. It doesn't yet include any change to the evoked export. I will open one upstream with the feature request + a second one on MNE with the change to include to export of evoked objects when the upstream change is merged and released. |
Sorry, I meant for now delete the file at our end (not the code for |
|
Oh alright, I will add that 'hack' a bit later this evening as I open the PR upstream. |
|
Solved, I am not familiar with |
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
FYI if you go to the "Files changed" pane, you can "add suggestion to batch" to commit all suggestions at once rather than going one-by-one (you can't do it from the main PR page) |
|
@larsoner Yes I just noticed by hovering my mouse on the |
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
I'm adding one more quick fix to when pathlib.Path instances are passed as |
To me this suggests Lines 149 to 157 in a8522d2
|
|
My bad.. wrong venv.. |
|
@larsoner This one should be good to go. |
|
Thanks @mscheltienne ! |
…ve. (mne-tools#9975) * Add argument overwrite to export for Raws. * Add argument overwrite to export for epochs. * Add tests. * Add entry to changelog. * Move entry to changelog to Bugs and fix spelling typo. * fix indentation for ..versionadded * typo fix. * fix tests. * Change versionadded from 1.0 to 0.24.1 [skip azp] [skip actions] * Add overwrite for evoked instances (mffpy related). * FIX: replace else statement with finally. * Use shutil.rmtree instead of os.remove since mffpy creates a directory. * Remove finally. * Update changelog. * improve comment preceding folder deletion. * Update mne/epochs.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_egimff.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_egimff.py Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Fix behavior when pathlib.Path are passed instead of strings. * Fix import and style. * add test for epochs as well. * Remove str(fname) as it's not needed. * fix positional/keyword arguments. Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* Backport #9972 * Fix defaults * MRG: Add argument overwrite to export for raws and epochs to match save. (#9975) * Add argument overwrite to export for Raws. * Add argument overwrite to export for epochs. * Add tests. * Add entry to changelog. * Move entry to changelog to Bugs and fix spelling typo. * fix indentation for ..versionadded * typo fix. * fix tests. * Change versionadded from 1.0 to 0.24.1 [skip azp] [skip actions] * Add overwrite for evoked instances (mffpy related). * FIX: replace else statement with finally. * Use shutil.rmtree instead of os.remove since mffpy creates a directory. * Remove finally. * Update changelog. * improve comment preceding folder deletion. * Update mne/epochs.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_egimff.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_export.py [skip ci] Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Update mne/export/_egimff.py Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * Fix behavior when pathlib.Path are passed instead of strings. * Fix import and style. * add test for epochs as well. * Remove str(fname) as it's not needed. * fix positional/keyword arguments. Co-authored-by: Eric Larson <larson.eric.d@gmail.com> * remove dead link (no suitable alternative) [skip actions][skip azp] (#9979) * FIX: Backport fix * import fix for scipy 1.8 pre (#9973) * import fix for scipy 1.8 pre * fix arg oversight * FIX: A couple more * FIX: Found another * FIX: More [skip azp] [skip circle] * FIX: Correct [skip circle] [skip azp] * FIX: One more Co-authored-by: Eric Larson <larson.eric.d@gmail.com> Co-authored-by: Mathieu Scheltienne <73893616+mscheltienne@users.noreply.github.com> Co-authored-by: Eric Larson <larson.eric.d@gmail.com> Co-authored-by: Daniel McCloy <dan@mccloy.info>

I have to do a couple of I/O roundtrips to EEGLAB, and I could use an
overwriteargument, set to False by default, for the export methods as ininst.saveto prevent unintentional exports.For
inst.save, when overwrite was added, it was first initialized to True for one version and then changed to False.If you agree with the addition of this argument, do you want to follow the same path?