Skip to content

Fix EEGLAB import - #8874

Merged
hoechenberger merged 6 commits into
mne-tools:mainfrom
cbrnr:fix-eeglab-import
Feb 17, 2021
Merged

hoechenberger merged 6 commits into
mne-tools:mainfrom
cbrnr:fix-eeglab-import

Conversation

@cbrnr

@cbrnr cbrnr commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

EEGLAB files may contain all fields in the root of the file instead of within an EEG struct. This PR adds support for this format. Fixes #8864.

@cbrnr cbrnr added backport-candidate on-merge: backport to maint/1.13 ENH labels Feb 16, 2021
Comment thread doc/changes/latest.inc Resolved
@hoechenberger

Copy link
Copy Markdown
Member

@cbrnr Do you think you could add a test?

@cbrnr

cbrnr commented Feb 16, 2021

Copy link
Copy Markdown
Contributor Author

Do we have a small test file or can we use/modify an existing one?

@hoechenberger

Copy link
Copy Markdown
Member

Do we have a small test file or can we use/modify an existing one?

Could you maybe modify a file "on the fly" during a test such that it doesn't have the EEG struct (i.e., copy the contents of the EEG struct to the "root" of the HDF5 file), and simply try to read the metadata / info (i.e., do not perform a preload)? Would this work?

@cbrnr

cbrnr commented Feb 16, 2021 •

Copy link
Copy Markdown
Contributor Author

Yes, but given that this will be the new default format we should probably have a real file that we can use. Maybe someone with access to EEGLAB can save one of our existing files (e.g. test_raw.set) in the new format? Ideally, this file could also heavily crop the original (e.g. 10s and 8 channels of data).

@hoechenberger

Copy link
Copy Markdown
Member

@cbrnr btw if you pull in / rebase onto main, CI should now pass thanks to #8875

@cbrnr

cbrnr commented Feb 16, 2021

Copy link
Copy Markdown
Contributor Author

@hoechenberger I've created a small test file based on test_raw.set - if this gets merged I can add a test.

@cbrnr

cbrnr commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

Preloading doesn't work as expected with the new format (that's why I can't test it). Previously, we supported preload=False only for the combined .set/.fdt format (I think). Now that fields are not contained inside EEG, it might be possible to load everything but data though with the new one-file format. It looks like pymatreader does support a variable_names argument, so we could implement preload=False if we knew which variables are required/mandatory (there is no option to load all variables except data unfortunately). I'd say this is something for another PR.

@hoechenberger

Copy link
Copy Markdown
Member

@cbrnr flake is still complaining; other than that, LGTM

@hoechenberger
hoechenberger merged commit dfc0594 into mne-tools:main Feb 17, 2021
@hoechenberger

Copy link
Copy Markdown
Member

Thanks @cbrnr!

Can you backport this?

@cbrnr
cbrnr deleted the fix-eeglab-import branch February 17, 2021 09:31
@cbrnr

cbrnr commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

Yes, will do!

cbrnr added a commit that referenced this pull request Feb 17, 2021
@cbrnr

cbrnr commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

@hoechenberger done! For some reason, I had to make a separate commit for the changelog entry. Can you please check if everything is OK (and if so add a "backported" label here)?

@hoechenberger

Copy link
Copy Markdown
Member

It seems CI failed on maint/0.22, I just restarted Circle

@cbrnr

cbrnr commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

The only thing that looks like it could be an error is that I forgot to update the hash of misc. @hoechenberger are you looking into this?

@hoechenberger

Copy link
Copy Markdown
Member

The only thing that looks like it could be an error is that I forgot to update the hash of misc. @hoechenberger are you looking into this?

Nope I'm currently busy with something else, and yes it appears to be something related to the hash! :)

@cbrnr

cbrnr commented Feb 17, 2021

Copy link
Copy Markdown
Contributor Author

Alright, I'll fix it then!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: Could not find EEG array in the .set file.

2 participants