-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Fix: nk.data import of eeg sample data #1072
base: dev
Are you sure you want to change the base?
Fix: nk.data import of eeg sample data #1072
Conversation
- Mne 1.9 changes how cropping works to include file checks - Sample data is stored in pickle so does not come from disk - Change removes previous existing filenames from eeg sample data
f674ee1
to
2db1331
Compare
The documentation workflow works on my machine. I realise now that the documentation workflow does its check based on the dev branch so the update is not reflected here (perhaps this should be changed too?). I will look more into why the other checks seem to be failing at a later time. |
I've updated the dataset on dev import pickle
import mne
raw = mne.io.read_raw_fif(
mne.datasets.sample.data_path() / "MEG/sample/sample_audvis_raw.fif",
preload=True,
verbose=False,
)
raw = raw.pick(["eeg", "eog", "stim"], verbose=False)
raw = raw.crop(0, 60)
raw = raw.resample(200)
# raw.ch_names
# raw.info["sfreq"]
# Store data (serialize)
with open("eeg_1min_200hz.pickle", "wb") as handle:
pickle.dump(raw, handle, protocol=pickle.HIGHEST_PROTOCOL) and thought that would do the trick (rather than fixing in in the data function) but apparently not -_- |
And I can't reproduce the error in the eeg_microstates notebook locally |
The issue I think is that the It works on your machine, because the filenames are in fact correct to your setup. It's because of this I know that your username on your PC is "domma" ;-) |
oooooh right I see, good catch! I'll try to replace |
60c3734
to
ef4d7f0
Compare
TL;DR
Description
This PR fixes the documentation issue as one of the files uses the sample eeg data. The problem stems from the most recent version of mne which has a function which removes the filenames (and checks for their existence on disk!!) when trying to crop the data. The motivation here seems to be that it can remove the filenames if the crop range is out of scope of a file.
This caused issues, since the current version of the eeg sample data is imported via a pickle rather than eeg data itself. This included metadata that was relevant for the uploader, but of course the file name does not exist in this case.
Due to this, it was not possible to use the sample data and therefore the documentation pipeline could not work.
Proposed Changes
The current proposal is to check for the version number and if it is greater than or equal to 1.9, then it removes the filenames from the eeg data. The change makes sense as there is in fact no filename connected to the in-memory file that came from the pickle, however, I am also not too sure if it looks too "hacky".
Checklist
Here are some things to check before creating the PR. If you encounter any issues, do let us know :)