Repository navigation
Add WRCC2023 and MIMED2024 motor imagery datasets - #1196
Merged
bruAristimunha merged 19 commits intoOct 4, 2026
Merged
Conversation
…>87.0%) Per-file coverage unchanged: wirawan2024 83%, wrcc2023_mi_a 87%, wrcc2023_mi_b 89%, wrcc2023_mi_c 89%. - Reduce the invalid-label matrix to one case per branch of the shared check (trial-count mismatch, bad class code); [1,2,3] and [1,2.5] duplicated them. - Drop the per-run filter self-comparison (run independence is already guarded by n_times == 4000 and the exact get_data() equality).
- WRCC2023_MI_A/B/C: one module (wrcc2023.py) with a shared _WRCC2023 loader; three copies of data_path/_get_single_subject_data/_mat_to_raw collapsed. Trials are built as runs directly (no concat-then-split); dead branches (list paths, ndim==2 reshape, duplicate channel-count check) removed. - Drop hand-written 'Dataset summary' tables (the metaclass renders them from summary_imagery.csv, so they appeared twice); shorten docstring prose. - Wirawan2024: compact channel list, drop unused constant, shorter docstrings. - Tests: shared fake-file helper; stored-window test on MI-A (fs) + MI-B (no fs); invalid-source table incl. fs check; URL asserts the per-class file id. Behaviour: loader fingerprint (fake .mat, per-run data hash, annotations, events, montage) and METADATA/summary/DOI fingerprint identical.
- 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
- download_and_extract_zip (Wirawan2024) -> develop's download_and_extract_subject_zip behind the usual extracted-folder check (keeps redownload_corrupted=True; the extension-less Mendeley download is renamed to .zip by the develop function) - colin27_* montage names spelled directly (mne>=1.13) - tests: Mock instead of monkeypatched lambdas
…ords (paper audit) Subject counts 9/9/8 confirmed from the Dataverse file lists (subjectN.mat); the record description's 'two individuals' are the stroke patients. Add the record creator as investigators for MI-A/MI-C (as MI-B already had). Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-wrcc/WRCC2023_MI_A/report.md
…r audit) Add gender (16 M / 14 F) and the acquisition institution (Universitas Pendidikan Ganesha) from the Data in Brief article; docstring records the 24-trial design vs the 12 windows exposed by the loader. Evidence: /Users/bruaristimunha/Projects/moabb/.paper-audit/reports/mi-wrcc/Wirawan2024/report.md
The authors present MIMED as the dataset's name: the primary paper is titled "Acquisition and processing of Motor Imagery and Motor Execution Dataset (MIMED) for six movement activities" (I Made Agus Wirawan et al., Data in Brief 2024, 10.1016/j.dib.2024.110833) and the Mendeley Data record 10.17632/zs25xxjkm9.3 is titled "MIMED" (2024). Rule 1 gives the official name with the primary-paper year: MIMED2024. 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:35
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.
Scope
Adds four registered loaders: WRCC2023_MI_A, WRCC2023_MI_B, WRCC2023_MI_C, and MIMED2024 (was Wirawan2024). Includes metadata, summary rows, API entries, cached DOIs and synthetic regression tests. Based on develop
18e7d4c03.Draft: not scientifically or NEMAR merge-ready. No real dataset downloads or experiments were run for this port.
Reconciliation, not a blind branch copy
Compared
codex/mi58-corrected-20260801(f7fe4b041a25bf24ad5d76e0dcdeaf1f1f6f12f0) with the freshly checked fork expansion head4e7771cd99a4335e29eb6c8975bb546c01d00e2f.Explicit deferred candidate
InMID2024 is not included. The expansion version synthesizes repeated 5-second cues at onset+3 seconds using the different MIMED study; the corrected branch instead labels segment onset, including potential baseline. Both mix motor execution and motor imagery as sessions under paradigm=imagery. Neither resolves InMID-specific cue provenance, and neither is safe to present as validated MI trials. Source DOI: https://doi.org/10.17632/rjx76wd5v6.2. Requires an imagery-only contract plus its own protocol/onset evidence before porting.
Public metadata evidence and remaining scientific gates
Local verification
Isolated worktree venv; confirmed moabb.file points here.
_MNE_FAKE_HOME_DIRand existingMNE_DATAisolated;MOABB_DOWNLOAD_PROVIDER=auto.test_epochs, licencetest_dataset_accept, and the global NEMAR-ID gate (measured separately below). No real-data coverage claim.NEMAR merge blockers — deliberately not hidden
Separate NEMAR-ID selection yields four expected failures, one for each added class. No genuine public NEMAR ID/version was established. No invented IDs, no exemptions, no pending-ID registry entries without actual assigned IDs. No rehosting/publication performed. Required: real assigned IDs, verified version and anonymously retrievable source files, followed by Voyager source-vs-loader validation. Full suite/CI must not be described as green while these gates remain.
Simplification (2026-09-29, head
3076755f2)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
718a678d7)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 (Motor Imagery/) its ten develop callers use.redownload_corrupted=True).file_downloadedwith no suffix, so the develop function renames the download to.zipbefore extracting.MNE-wirawan2024-data/, not next to the cached archive.colin27_1005/colin27_1020directly.lambdawithMock. The Wirawan2024 transport test now also checks the extracted file underMNE-wirawan2024-data/.moabb/datasets/*.py608 → 612 (the explicit extraction check);moabb/tests/*.py(net) 129 → 135..matfiles through the real readers) is identical.test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 2540 passed and 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
9da3a4025)_extract_rootis replaced bydownload_and_extract_zip(..., redownload_corrupted=True). Corrupted-zip recovery was re-probed offline.resolve_montage_name.NEMAR_ID_EXEMPT(# no public NEMAR mirror yet; tracked in #1196):WRCC2023_MI_A,WRCC2023_MI_B,WRCC2023_MI_C,Wirawan2024. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py626 → 608 (-3%);moabb/tests/*.py(net) 125 → 129 (+3%; includes the NEMAR-exempt lines).test_loader_utils.py): wirawan2024 82→87, wrcc2023 97→97. 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): 15 → 11. Coverage of touched dataset files (pass-1 before → now, offline suite): wirawan2024 83→82; wrcc2023_mi_a/b/c 87/89/89 → wrcc2023 97 (one module).
Pass 2 — loaders and tests
data_path/_get_single_subject_data/_mat_to_raw→ onewrcc2023.pywith a shared_WRCC2023loader; trials built as runs directly (no concat-then-split); dead branches (list path, ndim==2 reshape, duplicate channel-count check) removedfs) and MI-B (nofs); invalid-source table incl. thefs != 1000check; transport test asserts the per-class file idpytest <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_trial_labels_fail: label cases[[1],[1,4],[1,2,3],[1,2.5]]→[[1],[1,4]](one per branch of the validation condition); per-class parametrisation kept because_mat_to_rawis a separate copy in A/B/C. Removed the 3-line filter self-comparison inside the stored-windows test (n_times+ exactget_data()equality already prove run independence)._mat_to_rawis triplicated with drift across A/B/C — a shared helper would let one test cover all three. 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).