Repository navigation
ENH: Support binary file-like objects in BaseRaw.save - #14516
Merged
Merged
Conversation
bruAristimunha
requested review from
agramfort,
drammock,
larsoner and
mscheltienne
as code owners
November 10, 2026 20:21
bruAristimunha
force-pushed
the
enh/bytesio-raw
branch
from
November 10, 2026 21:52
e3a9005 to
0ab10a1
Compare
bruAristimunha
force-pushed
the
enh/bytesio-raw
branch
from
November 10, 2026 22:04
0ab10a1 to
15b9614
Compare
larsoner
approved these changes
Nov 11, 2026
larsoner
left a comment
Member
There was a problem hiding this comment.
Looks simple enough based on the changes and I think we can trust the tests to make sure nothing broke, thanks @bruAristimunha !
Contributor
Author
|
thank you so much @larsoner 🙏🏽 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue (if any)
Related to #14514.
What does this implement/fix?
mne.io.read_raw_fifandmne._fiff.write.start_filealready accept binary file-like streams (such asio.BytesIO), whereasBaseRaw.saveonly accepted filesystem paths.start_and_end_file/end_file.BaseRaw.saveto write directly to writable binary file-like objects (e.g.,io.BytesIO()), returning[]and raisingValueErrorif output would require multi-file splitting.Additional information
AI disclosure: I used Gemini in Antigravity IDE to help trace the FIFF writer call path and draft the minimal implementation and test, which I reviewed and tested locally.