Repository navigation
Add CNBI offline MI datasets: Perdikis2018 and Alawieh2025 - #1191
Merged
bruAristimunha merged 17 commits intoOct 4, 2026
Merged
Conversation
…>83.5%) - Fold test_download_flags[2] into the force-update archive test: the same transport stub already asserts (path, force_update, verbose) forwarding, and a follow-up plain call now proves the cached archive is not re-extracted. - Merge test_perdikis2018_regression.py (copied 16-channel GDF fixture) into test_perdikis_units_first_last_epoch_bad_channel_and_labels: the fixture gains the trigger:1 stim channel and a 783 cue, and asserts positional rename to _EEG_CHANNELS + trigger drop and both_feet/both_hands/rest relabelling. - Merge test_spinalstim2025_regression.py: the O2/OZ swap regression is now the input of the units/bads/first-last test (asserts restored channel order); the missing-EEG-channel error test moves into test_cnbi_offline.py unchanged. Per-file coverage: perdikis2018 78% -> 77% (only the empty-drop branch of _read_calibration_run is no longer taken), spinalstim2025 90% -> 90%. Test LOC 237 -> 156; PR tests collected 14 -> 10.
- 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 (SpinalStim2025, one archive per cohort) -> develop's download_and_extract_subject_zip behind the usual extracted-folder check - colin27_1005 montage name spelled directly (mne>=1.13) - tests: Mock instead of monkeypatched lambdas and the nested transport fake
No source names the dataset "SpinalStim": the Zenodo record is titled "A Multi-Session EEG Dataset of Longitudinal Motor Imagery BCI Training with Transcutaneous Spinal Stimulation in Able-Bodied and Spinal Cord Injury Participants" (creator "Hussein Alawieh") and it "Describes" the primary paper, Alawieh et al., PNAS 122(24), 2025 (10.1073/pnas.2418920122; medRxiv 2024 preprint 10.1101/2024.06.10.24308723). Rule 2 gives FirstAuthorYear of the primary paper: Alawieh2025. 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).
…audit) Sources: Zenodo record 10.5281/zenodo.15454354 description and the PNAS paper (Europe PMC PMC12184508 full text; Crossref author list). - associated_paper_doi 10.1073/pnas.2418920122 (+ medRxiv preprint in related_paper_dois); both added to doi_cache.json via test_dois_resolve. - reference/ground: "Ground: AFz; Reference: CPz" (record), replacing the unsupported "mastoids (M1, M2)"; hardware "ANTNeuro EEGO with Ag/AgCl-coated electrodes". - investigators: "Liu Deland" -> "Deland Liu" (PNAS/Crossref author order). - institution/ethics: "IRB Approval: University of Texas at Austin (Protocol #2020-03-0073)", "ClinicalTrials.gov Registration: NCT05183152". - docstring: record's session format "3-4 runs/session 20 trials/run", cap sizes (32-channel healthy, 64-channel SCI/sub-groups) and the multi-day session labels that are pooled into one MOABB session. Evidence: ~/Projects/moabb/.paper-audit/reports/mi-cnbi/SpinalStim2025/report.md
bruAristimunha
marked this pull request as ready for review
October 4, 2026 17:26
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 Perdikis2018 and Alawieh2025 (was SpinalStim2025) offline calibration subsets, branched from develop
18e7d4c03. Registers API docs, metadata/catalog count, imagery summary and all three cited DOI cache entries. Draft: not merge-ready.Scientific reconciliation
Compared corrected source
f7fe4b041a25bf24ad5d76e0dcdeaf1f1f6f12f0against expansion4e7771cd99a4335e29eb6c8975bb546c01d00e2f, file by file for all four batch candidates; not a wholesale branch transplant.Deferred, not included
paradigm="imagery". Paper DOI https://doi.org/10.3389/fnins.2020.00919. This is execution, not verified MI; needs an explicit motor-execution policy, not silent inclusion in this MI batch. Source branches also disagree on respecting the erroneousmilivoltsHDF5 attribute versus the companion EegPipe volts convention. No unverified unit rewrite imported.Local verification (no dataset downloads)
Explicit
PYTHONPATHverified imports from this worktree using the existing mi-batch-1 environment; isolated_MNE_FAKE_HOME_DIR, existingMNE_DATA,MOABB_DOWNLOAD_PROVIDER=auto.networkchecks,download-marked tests,TestData::test_epochs, license-accesstest_dataset_accept, two selected-session tests whose inherited prefetch can reach real data, and global NEMAR ID gate (run separately below). No paper experiments or real-data computation on laptop; no new real-data verification claimed.Explicit draft / merge blockers
Perdikis2018 has no NEMAR dataset IDandSpinalStim2025 has no NEMAR dataset ID. No invented IDs, exemptions, or fake pending assignments. Genuine assigned IDs/version and anonymous public retrieval evidence are required; this PR does not rehost/publish anything.Simplification (2026-09-29, head
563435784)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
a717e7abd)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 (<cohort root>) its ten develop callers use. Archives now extract intoMNE-spinalstim2025-data/, not next to the cached archive..tar.gzdownload andsafe_extract_tar, because develop has no tar counterpart ofdownload_and_extract_subject_zip.colin27_1005directly.data_dlfake and every monkeypatchedlambdawithMock.apply_function(lambda data: data * SCALE)unit conversions in Perdikis2018 and SpinalStim2025.np.multiplycannot take the scale as a keyword, and writingraw._datawould use private API.moabb/datasets/*.py544 → 551 (the explicit extraction check);moabb/tests/*.py(net) 159 → 160.data_dlcalls. SpinalStim2025 no longer looks up an archive that is already extracted (5 calls → 0), and the forced download now passesfname=Noneexplicitly.test_loader_utils.py,test_preprocessing.py,test_datasets.py,test_metadata.py,test_doi_validation.py) had 2520 passed and 0 failed. ruff 0.15.20 andgit diff --checkare clean.Pass 3: shared helpers, NEMAR skip, new montage names (head
ee3b6de21)download_and_extract_zip.resolve_montage_name.NEMAR_ID_EXEMPT(# no public NEMAR mirror yet; tracked in #1191):Perdikis2018,SpinalStim2025. No ids were invented,NEMAR_ID_PENDINGis untouched, andtest_all_datasets_have_valid_nemar_idpasses locally.moabb/datasets/*.py556 → 544 (-2%);moabb/tests/*.py(net) 156 → 159 (+2%; includes the NEMAR-exempt lines).test_loader_utils.py): perdikis2018 85→85, spinalstim2025 95→94. 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): 10 → 10. Coverage of touched dataset files (pass-1 before → now, offline suite): perdikis2018 78→85, spinalstim2025 90→95.
Pass 2 — loaders and tests
.split(); SpinalStim subject map as one literal (checked equal)_keep_class_cueshelper inside this PRpytest <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_perdikis2018_regression.pyandtest_spinalstim2025_regression.py(third and second copies of the 16-channel GDF fixture) folded intotest_cnbi_offline.py: the Perdikis units/first-last test now also feedstrigger:1+ a783cue and asserts_EEG_CHANNELSrenaming andboth_feet/both_hands/restlabels; the documented d3/d4 O2/OZ swap is now the input of the SpinalStim units/bads/first-last test (asserts restored order); the missing-EEG-channel error test moved unchanged.test_download_flags[2]removed as a duplicate of the force-update archive test (same transport stub, real tar/zip extraction); that test gained a plain follow-up call proving the cached archive is not re-extracted._read_calibration_run), spinalstim2025 90→90%. 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).