Repository navigation
feat(datasets): add MartinezPeon2025 hand-grip and MILimbEEG imagery datasets - #1198
Merged
bruAristimunha merged 20 commits intoOct 4, 2026
Merged
Conversation
…>68.7%) Replace the MNE-behaviour filter round-trip in test_milimb_si_and_last_window with a direct assertion that the EDGE boundary annotation sits at the stored-trial join (subsumes the bare description-presence check), and make test_milimb_transport_flags assert the resolved subject folder instead of a bare list length. No test removed; 6 LOC fewer. Per-file coverage unchanged: kmi_handgrip2025 78%, milimbeeg 88%, preprocessing 40%.
- resolve_montage_name (moabb.datasets._montage, re-exported by utils): MNE 1.13 renamed standard_1005/1020 (and the other standard_* templates) to colin27_*, warns on the old names and 1.14 removes them. Returns the spelling the installed MNE knows; electrode files are byte-identical (dig positions checked equal on MNE 1.10.2, 1.12.1 and 1.13.2). Every make_standard_montage/set_montage call in moabb now goes through it; METADATA montage labels are descriptive and unchanged. - download_and_extract_zip: download once, extract unless a marker exists, optional warn + forced re-download of a corrupted archive. - read_raw_brainvision_repaired: repair stale DataFile/MarkerFile references in a temporary header (strict mode raises on missing entries/siblings). - rename_stimulus_codes, edge_boundary_annotations; SetRawAnnotations keeps 'EDGE boundary' markers. - moabb.datasets._openneuro_mirror moved here verbatim (byte-identical copies in NeuroTechX#1186 and NeuroTechX#1189), with dataset-agnostic tests.
# Conflicts: # docs/source/whats_new.rst # moabb/datasets/preprocessing.py
…tage names Merges NeuroTechX#1200 (datasets/shared-loader-helpers): local zip/BrainVision/EDGE-boundary code replaced by moabb.datasets.utils helpers, montage calls spelled with the MNE 1.13 colin27_* names via resolve_montage_name, new classes without a public NEMAR mirror listed in NEMAR_ID_EXEMPT. Behaviour fingerprints unchanged.
MNE 1.13 renamed the standard_* templates to colin27_* (identical .elc files). With the floor at 1.13 the resolve_montage_name shim and the _montage module are not needed: every call site spells the new name.
- download_and_extract_zip -> extend download_and_extract_subject_zip with keyword-only fname and redownload_corrupted (defaults keep the 10 develop callers unchanged) - read_raw_brainvision_repaired -> mne.io.read_raw_brainvision(overrides=) at the call sites (MNE >= 1.13) - edge_boundary_annotations -> mne.Annotations(onsets, 0.0, 'EDGE boundary') - drop_native_stim / relabel_annotations / write_dataset_description -> drop_channels / annotations.rename / mne_bids.make_dataset_description - tests: no nested functions, Mock data_dl
# Conflicts: # docs/source/whats_new.rst
…tions - download_and_extract_zip -> develop's download_and_extract_subject_zip behind the usual extracted-folder check (MNE-milimbeeg-data/MILimbEEG) - edge_boundary_annotations -> mne.Annotations(onsets, 0.0, "EDGE boundary") - colin27_1020 montage name spelled directly (mne>=1.13) - MILimbEEG header sniff: generator instead of Series.map(lambda)
The Mendeley record 10.17632/msgzn862ns.1 ('EEG signals of KMI levels of the
right and left hands', creators Martinez Peon, Dulce Citlalli; Perez Espinoza,
Marcos; issued 2025-12-12) gives the dataset no official name and links no
paper, so rule 2 applies: first-author compound surname + record year.
Also aligns metadata with the record description: reference unset (A2 is one
of the 20 recorded columns; the record states no reference), sampling rate
marked as inferred, all-right-handed cohort, protocol wording, level-list
discrepancy documented.
Evidence: ~/Projects/moabb/.paper-audit/reports/mi-clinical/KMIHandGrip2025/report.md
…audit) Paper: cohort of 60 Ecuadorian adults recruited among ESPOL colleagues and neurosurgery patients of the Hospital Luis Vernaza; two amputees, one hydrocephalus after ventricular infarct, 18 post-COVID-19 -> health_status 'mixed' (was 'healthy'); 52%/48% female/male (31/29 in Test_Subject_Annotations.csv), three left-handed, average age 36; monopolar against a neutral ear-lobe electrode; only one subject performed up to four repetitions; tasks presented randomly up to 5 times per run. Evidence: ~/Projects/moabb/.paper-audit/reports/mi-clinical/MILimbEEG/report.md
The published Mendeley v2 export (10.17632/x8psbz3f6x.2) prefixes every
per-trial CSV with a header row whose first cell is empty and whose
remaining cells are the integer column indices 0..15, followed by 500
data rows. pandas' type inference coerces those integer column names to
floats, so the previous header check ('any string in iloc[0]') never
triggered: _read_trial kept 501 rows and raised 'Expected a complete
four-second stored trial' for every real file.
The fix peeks at the raw first line and tries to parse every comma-
separated field as a float; a failure (empty leading cell or a textual
header) switches to header=0. Short trials (<500 samples) are still
rejected explicitly, with no zero-padding. Adds a regression test that
feeds the exact ',0,1,...,15' Mendeley v2 header and asserts the loader
yields (16, 500) in volts.
bruAristimunha
marked this pull request as ready for review
October 4, 2026 17:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port two existing loaders onto current develop: MartinezPeon2025 (was KMIHandGrip2025) and MILimbEEG, including registry, current metadata API, DOI cache, summary and docs.
Reconciliation and scientific deferrals
Compared corrected f7fe4b0 with expansion 4e7771c. MILimbEEG identical; KMI differs only by the necessary block-confound warning, retained here.
Deferred Rehab2025OpenBCI: corrected uses S6/4s whereas expansion uses S4/3s justified by ERD rather than an authoritative code-to-task map; expansion also documents three railed channels but loader does not mark them bad. Neither conflicting mapping is certified.
Deferred Medvedeva2026: expansion corrects imagery to execution, consistent with description of actual intact/paretic hand movements. Not an MI candidate.
Deferred Russo2024: source explicitly says ExG-to-anatomical mapping is inferred, not an author wiring table, and scaling is assumed microvolts. Do not silently impose a speculative montage/calibration.
Validation
Isolated MNE home/data and explicit worktree imports. Offline suite: 2075 passed, 478 skipped, 464 deselected, including 6 focused synthetic SI/window/transport/filtering tests. Touched pre-commit passes. Excluded network-marked cases, real-data test_epochs, test_dataset_accept, inherited-prefetch selected-session test, and separately measured NEMAR policy gate. No real downloads, Voyager jobs or paper reruns.
Draft blockers — do not merge
NEMAR policy: two expected failures, no confirmed IDs. Read-only discovery inspected descriptions of 787 nemarDatasets repositories; no match established; web search provider unavailable. No invented IDs/versions/exemptions/pending entries, publication or rehosting. Full real-data source calibration, actual counts/repetitions and channel flags remain unvalidated. Full CI is not claimed green. The small EDGE annotation preservation fix also occurs in the parallel Pan/Polo draft and should be reconciled when either lands.
Simplification (2026-09-29, head
fce51a442)Depends on #1200. Merge #1200 (
mne>=1.13, shared download/marker helpers, OpenNeuro mirror mixin) first. This branch merges it (git merge --no-ff, no rebase).Pass 4 (ponytail): reuse existing code, no nested functions (head
d9eaeba48)058ae05e6, which now requiresmne>=1.13and drops the pass-3 helpers that re-implemented existing code.download_and_extract_subject_zip, behind the same extracted-folder check its ten develop callers use. The archive now extracts intoMNE-milimbeeg-data/MILimbEEG/, not next to the cached archive. Both subject-folder layouts (archive root or one wrapper folder) are still resolved.mne.Annotations(onsets, 0.0, "EDGE boundary"), which replacesedge_boundary_annotations. Its header-row check is nowany(isinstance(v, str) for v in frame.iloc[0]), with noSeries.map(lambda).colin27_1020directly (KMIHandGrip2025, MILimbEEG).lambda-arg) → 0.moabb/datasets/*.py501 → 492;moabb/tests/*.py(net) 112 → 113.data_path) is identical apart from the recordeddata_dlcalls, which now carry an explicitfname=None.test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 2515 passed, 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
1448857b3)download_and_extract_zipandedge_boundary_annotations.resolve_montage_name.preprocessing.pychange is now owned by refactor(datasets): require mne>=1.13, spell colin27 montages, share loader code #1200.NEMAR_ID_EXEMPT(# no public NEMAR mirror yet; tracked in #1198):KMIHandGrip2025,MILimbEEG. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py500 → 501 (+0%);moabb/tests/*.py(net) 110 → 112 (+2%; includes the NEMAR-exempt lines).test_loader_utils.py): kmi_handgrip2025 85→85, milimbeeg 87→87. No touched file dropped by more than 2 pp.data_dlcall now has positionalpath, force_update, verbose(same values).pytest <PR tests> test_loader_utils.py test_preprocessing.py test_datasets.py test_metadata.py test_doi_validation.py --cov=moabb/datasets(isolated MNE home, emptyMNE_DATA, no downloads;test_dataset_acceptandTestData::test_epochsdeselected): 0 failed. Also ruff 0.15.20 andgit diff --check.moabb/datasets/*.pymoabb/tests/*.py(net)PR tests collected (pass 2): 6 → 6. Coverage of touched dataset files (pass-1 before → now, offline suite): kmi_handgrip2025 78→85, milimbeeg 88→87.
Pass 2 — loaders and tests
pad/gapremoved (loader fingerprint proves no effect),_label_of→ regex, compact channel list_file_mapfolded intodata_path, dead list-type checks removed,_read_runtakes the label directly, shorter docstringspytest <PR tests> test_datasets.py test_metadata.py test_doi_validation.py --cov=moabb/datasets(isolated MNE home, no downloads;test_dataset_accept/TestData::test_epochsdeselected); behaviour fingerprint before/after on fake source data (per-run data hash, channels/types, sfreq, annotations, events, montage) and class fingerprint (subjects, sessions, event_id, interval, code, DOI, METADATA hash, summary-CSV row, docstring DOIs) identical exceptDataset summaryrendered once instead of twice; ruff 0.15.20,git diff --check.Test_Datasets::test_all_datasets_have_valid_nemar_id[<new classes>]fails (nonemar_id, not inNEMAR_ID_PENDING) — NEMAR-ID decision still open.Pass 1 — test audit
test_milimb_si_and_last_window[True|False]: filter round-trip replaced by a directEDGE boundaryonset assertion (500/125).test_milimb_transport_flags: tautologicallen(...) == 1strengthened to the exact extracted subject path (now checks zip extraction + folder resolution) at equal LOC.data_dlmanifest mock.pad = 0/emptygapinmilimbeeg._get_single_subject_data. Proof: offlinepytest <PR tests> moabb/tests/test_datasets.py moabb/tests/test_metadata.py moabb/tests/test_doi_validation.py --cov=moabb/datasets --cov-report=term-missing -p no:cacheprovider(isolated MNE home, no downloads;test_dataset_accept/TestData::test_epochsdeselected). Pre-existing on this branch, untouched:Test_Datasets::test_all_datasets_have_valid_nemar_id[<new classes>]fails (nonemar_id, not inNEMAR_ID_PENDING).