Repository navigation
Add archived motor-task datasets: Batista, Farabbi, Han, Kodera and Kueper - #1194
Merged
bruAristimunha merged 23 commits intoOct 4, 2026
Merged
Conversation
…>85.2%) Fold the five-way invalid-subject parametrisation into the existing per-dataset transport tests (each already instantiates the dataset), drop the MNE epoching block from the Kodera channel test (exercised MNE, not moabb), drop the restated Han2026 doi attribute (covered by test_doi_validation), and replace the Kodera transport fixture's re-implementation of the stem-matching rule with a literal manifest that also carries a sibling subject's file. Per-file coverage (before -> after): batista2022 90->90, dfki2023 85->85, farabbi2020 77->77, han2026 96->96, kodera2023 78->78. Test LOC added vs develop: 219 -> 205; PR tests collected: 18 -> 13.
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
…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
…overrides - download_and_extract_zip -> develop's download_and_extract_subject_zip behind the usual extracted-folder check - read_raw_brainvision_repaired -> mne.io.read_raw_brainvision(overrides=) - colin27_* montage names spelled directly (mne>=1.13) - tests: Mock instead of monkeypatched lambdas
…audit) runs_per_session=6 and design trial counts (3 sets x 40 per task, 120 per class) from the paper; docstring notes that 500 Hz is the EEG rate (2000 Hz is the EMG) and that the ground electrode is not stated. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-archive-a/DFKI2023/report.md
…udit) Add age_mean/age_std from the Zenodo record; docstring documents the subject list (17 numbered + 3 pilots = 20) and the missing institution/country. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-archive-a/Batista2022/report.md
…udit) Add per-subject trial counts (20 left + 20 right per run, 4 runs x 3 sessions) from the Zenodo record; docstring notes the Lisbon ethics approval. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-archive-a/Farabbi2020/report.md
…(paper audit) Add gender and age from participants.tsv (20 F / 15 M, 21.5 +/- 1.9 y); docstring flags that reference/ground are not stated in the BIDS metadata. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-archive-a/Han2026/report.md
…93846 (paper audit) The Zenodo record has only a one-line description and no linked paper; docstring says which fields are derived from the archive contents. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-archive-a/Kodera2023/report.md
DFKI is the institute (German Research Centre for Artificial Intelligence), not a dataset name: the Zenodo record 10229480 is titled "EEG dataset of unilateral and bilateral movement executions" (creators Niklas Kueper, Su Kyoung Kim, Elsa Andrea Kirchner; 2023) and the primary paper is Kueper, Kim and Kirchner, "Avoidance of specific calibration sessions in motor intention recognition for exoskeleton-supported rehabilitation through transfer learning on EEG data", Scientific Reports 2024 (10.1038/s41598-024-65910-8). Rule 2 gives FirstAuthorYear of the primary paper: Kueper2024. Renamed class, module, code, registry, api.rst, whats_new, summary CSV, tests and the NEMAR exemption list; no deprecated alias (the name was never released).
bruAristimunha
marked this pull request as ready for review
October 4, 2026 17:32
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 five existing loaders from the MI expansion onto fresh develop: Batista2022, Farabbi2020, Han2026, Kodera2023 and Kueper2024 (was DFKI2023). The five source files are identical between
codex/mi58-corrected-20260801andcodex/mi-dataset-expansion; no conflicting unit fix was silently selected.Offline evidence
Explicit
PYTHONPATHchecked to resolve this worktree (not the shared testing environment's editable checkout), isolated_MNE_FAKE_HOME_DIRand existingMNE_DATA,MOABB_DOWNLOAD_PROVIDER=auto.2143 passed, 454 skipped, 486 deselected, combining
test_archive_a.py, metadata, DOI validation and bounded dataset tests. Eighteen synthetic tests exercise transport flags/extraction, first/last retained trials, volts passthrough, bad flags/modalities, ME exclusion, exact DFKI events, Han duplicate markers, header repair without source modification and missing-session errors. Touched-file pre-commit passes after rechecking formatter changes.Correction verification: 18 synthetic tests passed with socket connections blocked; the transport regression verifies the retained OpenNeuro URL/DOI and absent NEMAR ID. Touched-file pre-commit passed. The explicit NEMAR gate failed on exactly the five loaders listed below, each for an absent ID, confirmed from its JUnit receipt. No new exemptions or pending-ID entries were added. The broad 2143-test result above is the prior baseline, not a claim that it was rerun after this narrow correction.
Exclusions: marked download tests, live DOI resolution, real-data epochs, licence acceptance, the selected-session test with inherited real prefetch, and NEMAR ID coverage (run separately below). No signal downloads or real-data jobs were performed.
Explicit draft blockers — not ready to merge
9f9f541115dfd6cbf05ef66ccadb40a9b3450efe, was verified against its public dataset description and subject-001 metadata inventory. The loader retains that genuine OpenNeuro source and DOI, but declares no NEMAR ID: the NEMAR SDK accepts only nm/on IDs and the publicon007327index returned HTTP 404 in the completed mirror audit. The upstreamds007327ID is not evidence of a NEMAR mirror, and no on ID has been fabricated. Han therefore also remains a missing-mirror draft blocker. The original public S3 URL is not snapshot-pinned; release-byte parity, companion-file completeness and anonymous functional end-to-end transport remain unverified. No duplicate rehost.No merge requested. CI is expected to expose the five missing-ID blockers; offline success is not all-green CI or scientific certification.
Simplification (2026-09-29, head
7d0312e35)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
d73dded1c)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. DFKI2023 keeps its one warned re-download of a corrupted archive (redownload_corrupted=True). Archives now extract intoMNE-<code>-data/, not next to the cached archive.mne.io.read_raw_brainvision(..., overrides={"data_fname": ..., "marker_fname": ...}), which replaces the header-rewritingread_raw_brainvision_repaired. It still usesrename_stimulus_codes.colin27_1005/colin27_1020directly.lambdawithMock.moabb/datasets/*.py1250 → 1264 (the explicit extraction check and theoverridesdict);moabb/tests/*.py(net) 187 → 194.DataFileheader) is identical apart from the recordeddata_dlcalls. There are now fewer calls, because an extracted archive is no longer looked up again, and they carry an explicitfname=None.test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
4a17f831e)_download_and_extractis replaced bydownload_and_extract_zipin Batista2022, DFKI2023, Farabbi2020 and Kodera2023.redownload_corrupted=True, re-probed offline._read_brainvisionand itsS 7rename loop are replaced byread_raw_brainvision_repairedandrename_stimulus_codes. Its repair test moved to refactor(datasets): require mne>=1.13, spell colin27 montages, share loader code #1200.resolve_montage_name.NEMAR_ID_EXEMPT(# no public NEMAR mirror yet; tracked in #1194):Batista2022,DFKI2023,Farabbi2020,Han2026,Kodera2023. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py1290 → 1250 (-3%);moabb/tests/*.py(net) 199 → 187 (-6%; includes the NEMAR-exempt lines).test_loader_utils.py): batista2022 92→95, dfki2023 94→100, farabbi2020 83→84, han2026 98→98, kodera2023 82→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): 13 → 13. Coverage of touched dataset files (pass-1 before → now, offline suite): batista2022 90→92, dfki2023 85→94, farabbi2020 77→83, han2026 96→98, kodera2023 78→82.
Pass 2 — loaders and tests
_download_and_extracthelper (inbatista2022.py) replaces near-identical copies in Farabbi2020/DFKI2023/Kodera2023; DFKI keeps its corrupted-zip re-downloadDFKI2023().eventsattribute removed (event_idunchanged)nemar_id is Noneguard + test, Batista header repair, Han duplicate-marker removal, Kodera/missing-session errors, all 13 tests.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_invalid_subject_does_not_download[×5]folded into a helper called from the existing per-dataset transport tests (coverage of eachraise ValueErrorkept).events_from_annotations+mne.Epochsblock (tested MNE epoching). Han transport test: dropped theds.doirestatement (owned bytest_doi_validation); keptnemar_id is None(guards the unverified-mirror fix). Kodera transport fixture no longer re-implements_matches_subject; it uses a literal manifest with a sibling-subject file, so it now proves subject filtering.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).