Skip to content

WIP: Pickle Evoked - #2564

Closed
christianbrodbeck wants to merge 3 commits into
mne-tools:masterfrom
christianbrodbeck:pickle
Closed

christianbrodbeck wants to merge 3 commits into
mne-tools:masterfrom
christianbrodbeck:pickle

Conversation

@christianbrodbeck

Copy link
Copy Markdown
Member

This should make pickled Evoked objects compatible between mne versions by using a FIFF byte string as suggested a while ago by @mluessi. I noticed that file-like objects were already supported and very little has to be changed.

Comment thread mne/evoked.py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a small bug with Evoked constructor using condition=None.

@christianbrodbeck christianbrodbeck changed the title Pickle Evoked WIP: Pickle Evoked Oct 27, 2015
@christianbrodbeck

Copy link
Copy Markdown
Member Author

Hm, seems like there are some unanticipated consequences for copying, and the operation does not always produce the same string...

(Pdb) p len( pickle.dumps(ave)), len(pickle.dumps(ave_2))
(11946040, 11946035)
(Pdb) p len( pickle.dumps(ave)), len(pickle.dumps(ave_2))
(11946038, 11946038)
(Pdb) p len( pickle.dumps(ave)), len(pickle.dumps(ave_2))
(11946032, 11946038)
(Pdb) p len( pickle.dumps(ave)), len(pickle.dumps(ave_2))
(11946041, 11946038)

@larsoner

Copy link
Copy Markdown
Member

That's really bizarre. I don't know why the size would change. Maybe some strangeness about numpy arrays under the hood...?

@christianbrodbeck

Copy link
Copy Markdown
Member Author

Does the FIFF format maybe include the date on which the file was saved?

@larsoner

Copy link
Copy Markdown
Member

Ahh, yeah it does something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants