mne.io._digitization

  • MNE version: 1.6.1

Hi, I had previously pickled microstate classes (using pycrostates) as json files. Since I updated to mne1.6.1 I now get an error when I try to use pickle.load() to read them back in:

ModK = pickle.load(Ks)

ModuleNotFoundError: No module named 'mne.io._digitization'

This does not happen when I go back to mne1.4.2.
I am not sure if mne.io._digitization was replaced and there is another way to read these types of files in now or if there are other ways around this. Please advise.
I am also not certain if turning them into josn files originally was the best choice, so if there is a better way to save that type of data I would be interested to hear what people recommend.

Best,
Matt

Hello,

pickling is a bad idea for long-term storage, as you just experienced.

I believe the pycrostate clustering classes all offer a .save() method, which is what you should use to store the results to disk.

Best wishes,
Richard

2 Likes

Any reason why you did not use the save method?

https://pycrostates.readthedocs.io/en/latest/api/generated/pycrostates.cluster.ModKMeans.html#pycrostates.cluster.ModKMeans.save

Mathieu

2 Likes

Thanks @richard and @mscheltienne, I see that now. I was simply unaware that there was a .save() method built in. I will read the docs a little closer next time. I will go use that now.

Thanks,
Matt

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.