Repository navigation
Add Jia2019, MIBMPI2024, Ortiz2023 and Wang2025 motor-imagery datasets - #1190
Merged
bruAristimunha merged 21 commits intoOct 4, 2026
Merged
Conversation
…>77.6%) Drop the tautological post-filter assertion in _check_epochs (all synthetic trials share one amplitude, so a band-pass yields ~0 regardless of EDGE boundaries) and replace the positional/keyword call-arg juggling in test_download_flags with a transport stub that records (path, force_update, verbose); module lookup now uses cls.__module__ instead of a parametrised name + importlib. Per-file coverage unchanged: jia2019 80%, ortiz2023 78%, yilmaz2024 93%, zju_mi2025 97%, preprocessing 40%. Test LOC 155 -> 144. 14 tests collected before/after.
- 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
- download_and_extract_zip (Ortiz2023) -> develop's download_and_extract_subject_zip behind the usual extracted-folder check (keeps redownload_corrupted=True) - edge_boundary_annotations -> mne.Annotations(onsets, 0.0, "EDGE boundary") in Jia2019, Yilmaz2024 and ZjuMI2025 - colin27_* montage names spelled directly (mne>=1.13) - tests: Mock instead of monkeypatched lambdas and the nested data_dl fake
…audit) - The secondary paper describing this release (arXiv:2604.16554, "2019-Stroke: ... 15 stroke patients ... 63 channels under the international 10-10 system at 512 Hz", 80 trials = 40 per class) is by Xiangkai Wang, not "Wang, K."; fix the citation and track its DOI in related_paper_dois. - doi_cache.json: add 10.48550/arXiv.2604.16554 and 10.21203/rs.3.rs-4268007/v1 (Yilmaz2024 open-access preprint, next commit), resolved through test_dois_resolve. Evidence: ~/Projects/moabb/.paper-audit/reports/mi-figshare/Jia2019/report.md, ~/Projects/moabb/.paper-audit/Jia2019/paper-10_48550_arxiv_2604_16554.txt
…r audit) Sources: Crossref record (published-online 2024-12-24, print 2025 vol. 37 pp. 4679-4696), the open-access Research Square preprint 10.21203/rs.3.rs-4268007/v1 (also the DOI registered on Zenodo record 13626922) and the Zenodo record description. - investigators: "Beyda H. Yilmaz" -> "Bahar Hatipoglu Yilmaz" (Crossref). - reference: the headset CMS/DRL sit at P9/P10 and "DC offset was removed by subtracting the average of the channels from each channel"; filters from the preprint (0.2-45 Hz bandwidth, 5th-order Sinc, 50/60 Hz notch, 0.16 Hz high-pass). - participants: ages 25-35, two female, one left-handed (preprint). - docstring: D01 recorded with 13 positions, D02-D08 with four extra sensors (FC1, CP1, FC2, CP2); the loader reads the same 13 channels for everyone. - publication_year stays 2024 (online-first date and data release year). Evidence: ~/Projects/moabb/.paper-audit/reports/mi-figshare/Yilmaz2024/report.md
… audit) - reference/ground: "Ground and reference electrodes were located in the right (A2) and left (A1) ear lobes respectively" (Methods); the per-trial .json example lists the opposite sides, noted in the docstring. - institution: "Miguel Hernandez University of Elche" (affiliation line). - docstring: paper-vs-release note. The paper reports fourteen subjects over both scenarios; Table 1 lists nine Experience M-codes (M05-M11, M20, M21) with two Experience weeks for M05, M08 and M11, and M17 as the Slopes code of S4, whereas the loader follows the released archive (ten Experience M-codes incl. M17; two dates for M05 and M11 only). n_subjects stays 10 (loader-exposed); flagged needs_real_data_check. Evidence: ~/Projects/moabb/.paper-audit/reports/mi-figshare/Ortiz2023/report.md
… audit) Sources: the CC-BY open-access IEEE TNSRE paper and the Hugging Face ZJU-MI-EEG/MI4 dataset card. - hardware/filters: "EEG signals are acquired with a 62-channel g.USBamp amplifier (g.Tec medical engineering, Schiedelberg, Austria) in an extended 10-20 system sampled at 256 Hz and highpass filtered above 0.1 Hz"; the release ships a 62channels_gNautilus.ced file, noted as a conflict. - participants: "Fifteen healthy subjects (average age: 24+-5.1, twelve males)", "Ten of them are fully naive to BCIs". - docstring: six calibration + four feedback runs of 40 trials per session (paper) are merged into the two released files per day; feedback trials last up to 10 s online but are stored as -1..4 s windows. Evidence: ~/Projects/moabb/.paper-audit/reports/mi-figshare/ZjuMI2025/report.md
No source presents "ZJU-MI" or "MI4" as the dataset's name in prose: the primary paper is titled "Enhanced Online Continuous Brain-Control by Deep Learning-Based EEG Decoding" (Jiaheng Wang, Lin Yao, Yueming Wang; IEEE TNSRE vol. 33, 2025, 10.1109/TNSRE.2025.3591254) and never mentions "MI4"; "# MI4 Dataset" is only the Hugging Face card heading of the MI4 sub-folder and `ZJU-MI-EEG` the repository slug. Rule 2 gives FirstAuthorYear of the primary paper: Wang2025. 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).
The authors present MI-BMPI as the dataset's name: the Zenodo record 13626922 is titled "MI-BMPI: Motor Imagery Brain--Mobil Phone Interface Dataset" and the paper is titled "MI-BMPI motor imagery brain-mobile phone dataset and performance evaluation of voting ensembles utilizing QPDM" (Cagatay Murat Yilmaz, Bahar Hatipoglu Yilmaz, Cemal Kose; Neural Computing and Applications, published online 24 December 2024, 10.1007/s00521-024-10917-5; Research Square preprint posted 16 April 2024). Rule 1 gives the official name with the primary-paper year: MIBMPI2024. 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:08
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 four existing MATLAB/EEGLAB motor-imagery loaders from the MI expansion/corrected branches onto current
develop: Jia2019, MIBMPI2024 (was Yilmaz2024), Ortiz2023, Wang2025 (was ZjuMI2025). This is the planned MAT batch, not a claim all four use Figshare: MIBMPI2024 downloads its Zenodo release and Wang2025 uses Hugging Face. No new dataset was implemented from scratch.update_pathremains the deprecated compatibility argument.EDGE boundaryannotations through the common annotation pipeline so filtering does not cross stored epochs.Deliberate exclusion: Patel2025
Compared both source variants. Expansion uses an amplitude-based
1e-9correction; corrected source explicitly says its1e-6is only nominal storage in undocumented, uncalibrated native units. Neither establishes physical SI calibration. The corrected source also accepts 256-sample trials for an inclusive[0,1]interval requiring 257 samples, so one padding sample still enters the epoch. The old source additionally retains short trials by padding. Patel is not registered or ported in this PR: resolve source calibration and valid trial boundaries before upstream scientific use. This finding may affect prior paper-branch results; no reruns are launched here.Draft / merge blockers
test_all_datasets_have_valid_nemar_idremains intentionally failing for these four until genuine IDs and public mirror evidence are available. This is not merge-ready.Local validation
Run with explicit
PYTHONPATHpointing to this worktree (verifiedmoabb.__file__), an isolated fake MNE home, existing temporary MNE_DATA, andMOABB_DOWNLOAD_PROVIDER=auto.test_dataset_acceptandTestData::test_epochs); no real-data checks represented as passed.Results: 1083 passed, 221 skipped, 302 deselected in the bounded offline suite; 15 synthetic batch tests passed. All applicable touched-file pre-commit hooks passed. Separate NEMAR policy check: 4 expected failures, one per added dataset. DOI cache entries were preserved from the existing source branch, not newly verified by network resolution.
Simplification (2026-09-29, head
f1c261b9b)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
2fd36dea6)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 keeps its one warned re-download of a corrupted archive (redownload_corrupted=True). The Figshare URL has no.zipsuffix, and the develop function renames the download to.zipbefore extracting. The archive now extracts intoMNE-ortiz2023-data/MI_walking_figshare21185362/, not next to the cached archive.mne.Annotations(onsets, 0.0, "EDGE boundary")directly, replacingedge_boundary_annotations.colin27_1005/colin27_1020directly.data_dlfake and every monkeypatchedlambdawithMock, and assert oncall_args_list.moabb/datasets/*.py1030 → 1030;moabb/tests/*.py(net) 139 → 140..mat/.setfiles and a corrupted-then-valid archive through the real loaders) is identical apart from the recordeddata_dlcalls. Ortiz2023 now makes fewer calls, because it no longer looks up an archive that is already extracted (cached_calls1 → 0).test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 2547 passed and 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
da3015ad8)download_and_extract_zip(..., redownload_corrupted=True). An offline probe confirmed the same behaviour as before: a corrupt archive warns, is downloaded again withforce_update=Trueand extracted, and a second corruption raises.edge_boundary_annotations.preprocessing.pyEDGE-boundary change is now owned by refactor(datasets): require mne>=1.13, spell colin27 montages, share loader code #1200. Four PRs had each edited it differently.resolve_montage_name.NEMAR_ID_EXEMPT(# no public NEMAR mirror yet; tracked in #1190):Jia2019,Ortiz2023,Yilmaz2024,ZjuMI2025. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py1038 → 1030 (-1%);moabb/tests/*.py(net) 136 → 139 (+2%; includes the NEMAR-exempt lines).test_loader_utils.py): jia2019 82→83, ortiz2023 83→86, yilmaz2024 92→92, zju_mi2025 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): jia2019 80→82, ortiz2023 78→83, yilmaz2024 93→92, zju_mi2025 97→97, preprocessing 40→40.
Pass 2 — loaders and tests
.split(); Parameters boilerplate in private-method docstrings cut_trialsinlined; simpler run detection/trial concatenation in Ortiz and Zju; Ortiz corrupted-zip retry shortened (same warning, same re-download, second corruption still raises)set_annotationscalls (MNE ordering at equal onsets), all validation messages, EDGE-boundary test (only functional test of thepreprocessing.pychange).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
_check_epochs: removed the band-pass|x| < 1e-10probe — all synthetic trials share one constant amplitude, so it passes with or without EDGE boundaries (tautological); the EDGE-boundary count assertion stays as the functional test of thepreprocessing.pychange.test_download_flags: simplified to a transport stub recording(path, force_update, verbose)with one equality assert (module viasys.modules).data_path),test_session_mapping(only proof of file→session/run ordering), units/first-last/missing-duplicate-session tests.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).