Repository navigation
feat(datasets): add Pan cross-session and Polo lower-limb MI datasets - #1197
Merged
bruAristimunha merged 20 commits intoOct 4, 2026
Merged
Conversation
…>68.8%) Replace the MNE-behaviour filter round-trip in test_stored_windows with a direct assertion that the EDGE boundary annotation sits at the stored-trial join (also subsumes the bare description-presence check). No test removed; 6 LOC fewer. Per-file coverage unchanged: pan2023 82%, pan2025 83%, polohortiguela2025 70%, preprocessing 40%.
Pass-2 review: kept the fail-closed/recovery path (corrupted-zip re-download or explicit extraction error) unchanged.
- 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 (fname=, redownload_corrupted=True) behind the usual extracted-folder check - edge_boundary_annotations -> mne.Annotations(onsets, 0.0, "EDGE boundary") - colin27_1005 montage name spelled directly (mne>=1.13)
Deposit description (DataCite): 14 subjects, five females, two left-handed, 0.01-200 Hz band-pass, Neuroscan SynAmps2, 120 trials/session with no per-class breakdown; affiliation School of Precision Instruments and Optoelectronics Engineering, Tianjin University; IsSupplementTo 10.1088/1741-2552/ad0a01 (closed access). Evidence: ~/Projects/moabb/.paper-audit/reports/mi-zenodo/Pan2023/report.md
Deposit description: Neuroscan SynAmps2, 1000 Hz original / 250 Hz released, 0.01-200 Hz band-pass + 50 Hz notch, 10 subjects (3 F, 2 left-handed, 22-25 y), ~180 trials/session with counts varying across sessions and subjects, session 2 = 30 training + online-feedback test trials; record References 10.1088/1741-2552/ad0a01 (related_paper_dois). Evidence: ~/Projects/moabb/.paper-audit/reports/mi-zenodo/Pan2025/report.md
…(paper audit) Zenodo description: single recording session per participant (static/motion exoskeleton models exposed as MOABB sessions), dominant-foot dorsi/plantar flexion imagery, open-loop auditory-cued protocol, 28 EEG + 4 EOG + 3 inertial rows at 250 Hz, 11 repetitions per model, funding list; DataCite affiliation Universitat de Miguel Hernandez d'Elx (fixes 'Universitas' spelling). Evidence: ~/Projects/moabb/.paper-audit/reports/mi-zenodo/PoloHortiguela2025/report.md
Full paper now available (J. Neural Eng. 20, 066011): nose reference and forehead ground, 50 Hz notch, 4 blocks x 30 trials (15 left/15 right) per session confirming 60/60 per class, 7 s trial (1 s Ready + 0.25 s beep, 4 s rowing-game animation task, 2 s rest), 1000 Hz acquisition released at 250 Hz, full author list, funding and ethics approval (TJUE-2021-062). The authors' NeuroDeckit loader (interval [3, 7] of the 0-7 s stored trial) confirms the 3 s task-onset offset; loader behaviour unchanged. runs_per_session stays 1 (release has no block markers; documented).
bruAristimunha
marked this pull request as ready for review
October 4, 2026 17:37
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
Adds three existing source loaders ported onto current develop: Pan2023, Pan2025 and PoloHortiguela2025. Registers metadata, API docs, summary rows and cached DOI citations.
Reconciliation and exclusions
Compared corrected source f7fe4b0 and expansion 4e7771c file by file; these three are identical across them.
Deferred Lomele2026: source explicitly describes overt reach/grasp/lift but assigns imagery; not legitimate to port that classification into this MI batch.
Deferred Lu2026: source concatenates EEGdata without physical scaling/calibration evidence and ignores configuration_channel masks; real-file units/bad-channel interpretation must be established before a scientifically defensible port.
Validation
Isolated MNE home/data directories, explicit worktree import. Offline suite: 2084 passed, 485 skipped, 467 deselected; 7 focused synthetic tests included. Touched-file pre-commit passes. Explicit exclusions: network-marked tests, real-data test_epochs, test_dataset_accept, selected-session inherited prefetch, and the separately measured NEMAR policy gate. No real downloads or Voyager jobs.
Draft blockers — do not merge
NEMAR gate currently has 3 expected failures (one per added class). Read-only discovery enumerated 787 actual nemarDatasets repositories and their descriptions; no matching mirror was confirmed. The superficially relevant nm000152 was checked against dataset_description.json and is Zhang2017 (version 1.0.3), not one of these datasets. Search-provider failure limits additional discovery. No fabricated IDs/versions, exemptions, pending entries or rehosting. Real-data counts, source-unit calibration, exceptional sessions and channel flags still require authorized server-side validation. Full CI is not asserted green.
Simplification (2026-09-29, head
dfc92e892)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
849053677)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. It keepsfname=because every Zenodo/contentURL would otherwise share one cache name, and it keeps the one warned re-download of a corrupted archive (redownload_corrupted=True). Archives now extract intoMNE-polohortiguela2025-data/, not next to the cached archive._trials_to_raw) mark stored-trial joins withmne.Annotations(joins, 0.0, "EDGE boundary"), which replacesedge_boundary_annotations.colin27_1005directly.moabb/datasets/*.py543 → 543;moabb/tests/*.py(net) 107 → 109 (the transport test now also checks the extracted files).test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 2525 passed, 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
2adfdf5dc)download_and_extract_zip(..., fname=..., redownload_corrupted=True). The corrupted-zip recovery was re-probed offline: warn, forced re-download, extract; a second corruption raises.edge_boundary_annotations.resolve_montage_name. The warning filter that hid the MNE montage-name deprecation is gone.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 #1197):Pan2023,Pan2025,PoloHortiguela2025. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py565 → 543 (-4%);moabb/tests/*.py(net) 104 → 107 (+3%; includes the NEMAR-exempt lines).test_loader_utils.py): pan2023 88→88, pan2025 100→100, polohortiguela2025 75→82. No touched file dropped by more than 2 pp.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): 7 → 7. Coverage of touched dataset files (pass-1 before → now, offline suite): pan2023 82→88, pan2025 83→100, polohortiguela2025 70→75, preprocessing 40→40.
Pass 2 — loaders and tests
_trials_to_raw; Pan2025 reuses Pan2023's URL constant and channel list;h5pyoptional-import fallback removed (core dependency)dl.data_dl(..., fname=)(asschrag2026.pydoes), removing ~60 lines of workaround for every Zenodo/contentfile being cached ascontent; corrupted-zip re-download keptpreprocessing.pyEDGE-boundary change + test, label/imagery-window checks, Polo warning suppression, empty-condition skip.pytest <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_stored_windows[Pan2023|Pan2025]: theraw.filtervscrop().filter()round-trip (which verifies MNE'sskip_by_annotation, not moabb) replaced by a direct assertion that theEDGE boundaryonset equals the stored-trial join. Nothing else matched a junk pattern; file was already lean.data_path(0)guard (only owner, −2.6 pp otherwise), both Pan transport tests (separate manifests), Polo STATIC/MOTION code-bug params, Zenodo/contentzip transport mock, last-trial Epochs shape.pytest <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).