-
Notifications
You must be signed in to change notification settings - Fork 7
Add an overwrite argument to the Writer to add the possibility to allow for overwriting existing file. #92
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
Conversation
|
Hi @mscheltienne, your suggestion makes sense to me. Thanks. However, I'm worried that as a result of your implementation some, e.g., Event files wouldn't be overwritten, but just remained astray from the old MFF. I propose to cleanly unlink the whole MFF dir if it already exists. What do you think? |
|
@jusjusjus Glad to hear that you like it. As I expected, I don't know enough about |
|
What do you mean by If |
|
@ephathaway, let's discuss how this API should look like. |
|
@mscheltienne, @jusjusjus, so sorry I am just now responding to this.
This sounds like a good solution. We could add a cleanup step to |
|
Hey, this PR was kind of forgotten. I really don't know much about Could you spend the time to finalize this one? |
ephathaway
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.
Hi @mscheltienne, thanks for your contribution. With the requested changes, it should work as expected.
Co-authored-by: Evan Hathaway <42755980+ephathaway@users.noreply.github.com>
|
@ephathaway Done |
ephathaway
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.
So we need to account for the overwrite .mfz edge case. Currently, attempting to overwrite a .mfz file errors out because the 'mffdir' is removed (filename + .mff), but the zipped MFF is not removed (filename + .mfz). We will need to add some logic to remove both filename.mff and filename.mfz.
|
Done. As there is no writer test to
|
Overwrite .mfz
Add run setup script step to gh workflow
|
@mscheltienne, thanks for your contribution! We will cut a new release with this feature. |
Hi! I would like to propose a small additional feature: the possibility to overwrite an existing file. This would be handy as I am adding the
overwriteargument to MNE export function in this PR: mne-tools/mne-python#9975For now, the PR will delete existing files if
overwriteis set to True, which is not really a clean way of doing it. The possibility to setoverwriteupstream would be appreciated.You can find the minimal changes I think are necessary to add this feature. I am not familiar with
mffpyand I might have overlooked something. Please let me know!