Skip to content

MAINT: Replace defusedxml with mffpy in _get_ep_info and _get_signalfname - #13991

Merged
scott-huberty merged 3 commits into
mne-tools:mainfrom
PragnyaKhandelwal:egi-mff-legacy-cleanup
Jun 30, 2026
Merged

scott-huberty merged 3 commits into
mne-tools:mainfrom
PragnyaKhandelwal:egi-mff-legacy-cleanup

Conversation

@PragnyaKhandelwal

@PragnyaKhandelwal PragnyaKhandelwal commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Reference issue (if any)

Part of #13926.

Follow-up to #13932, #13945, and #13973.

What does this implement/fix?

Replaces the defusedxml-backed implementations of _get_ep_info and _get_signalfname in mne/io/egi/general.py with mffpy.xml_files.XML.from_file().

  • _get_ep_info: now reads epochs.xml via mffpy's Epochs object, accessing ep.beginTime, ep.endTime, ep.firstBlock, and ep.lastBlock directly.

  • _get_signalfname: now reads each infoN.xml via mffpy's DataInfo object, using get_content()['generalInformation']['channel_type'] to distinguish EEG from PNS signal files instead of scanning raw XML tags.

Both functions produce identical output to the legacy implementations, verified against all 7 test MFF files in the testing dataset.

Additional information

All 24 tests in mne/io/egi/tests/test_egi.py pass locally. No changes to callers in egimff.py.

@PragnyaKhandelwal
PragnyaKhandelwal marked this pull request as ready for review June 26, 2026 19:26

@scott-huberty scott-huberty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like your targeted PR approach @PragnyaKhandelwal - it makes reviewing easier and keeps the diffs manageable. Great work!

@scott-huberty
scott-huberty merged commit 1ef16d7 into mne-tools:main Jun 30, 2026
28 checks passed
@PragnyaKhandelwal

Copy link
Copy Markdown
Contributor Author

I like your targeted PR approach @PragnyaKhandelwal - it makes reviewing easier and keeps the diffs manageable. Great work!

All thanks to you and @drammock for the micro PR approach indeed 😀!!

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