Skip to content

[FIX] Fixing lack of montage, wrong unit and missed stimulus channels in several datasets. - #700

Merged
bruAristimunha merged 5 commits into
NeuroTechX:developfrom
bruAristimunha:fix-values
Feb 19, 2025
Merged

bruAristimunha merged 5 commits into
NeuroTechX:developfrom
bruAristimunha:fix-values

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

Separated PR as requested by @PierreGtch

@PierreGtch PierreGtch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making a separate pr! Just one comment but ignore it if it's normal

Comment thread docs/source/whats_new.rst Resolved
Comment thread docs/source/whats_new.rst Resolved
@bruAristimunha
bruAristimunha merged commit 45c7ad8 into NeuroTechX:develop Feb 19, 2025
@bruAristimunha
bruAristimunha deleted the fix-values branch February 19, 2025 12:20
bruAristimunha added a commit to bruAristimunha/moabb that referenced this pull request Aug 26, 2026
Rodrigues2017 has the same defect as Cattan2019_PHMD and was named in the
same NeuroTechXgh-700 changelog entry: identical 16-electrode setup, the same
`Fc5`/`Fc6` spelling that `standard_1020` cannot resolve, and no
`set_montage` call anywhere in the loader. Its METADATA additionally
declared `standard_1010`, which is not a montage MNE can build at all.

Auditing the rest of that NeuroTechXgh-700 list: Huebner2018, BaseCastillos2023 and
Ofner2017 do set a montage, so Rodrigues2017 and Cattan2019_PHMD were the
two that slipped.

Version: this batch is bug fixes only, so the next release is a patch.
Sets 1.6.1dev0 and renames the open changelog section accordingly -- the
1.7.0dev0 bump assumed a minor release that this content does not justify.
bruAristimunha added a commit to bruAristimunha/moabb that referenced this pull request Aug 26, 2026
Reuse / simplification:
- Extract `_manifest_subject_files(record, subject)`; the offline check had
  copied ~15 lines of manifest parsing out of `_sourcedata_files_for_subject`.
  It takes the parsed record so each caller keeps its own error policy -- an
  earlier cut of this swallowed OSError and silently turned an unreadable
  manifest into a whole-tree download.
- Extract `_sourcedata_store_holds_data(target_dir)` and call it from
  `nemar_sourcedata_dl` too, which had its own slightly different copy: it
  counted a bare sub-directory as data, so the writer could call a store
  fetched that the reader would not call local.
- `sourcedata_path` now calls `_nemar_subject_ids` instead of repeating it.
- `_NON_EEG_CHANNELS_001_2025` is a tuple: every value was "misc". The
  `if ch in raw.ch_names` filter stays -- `set_channel_types` raises on a name
  that is not in `info`.

Efficiency (measured on an 87-subject store):
- `_sourcedata_store_holds_data` walks depth-first with `os.walk` instead of
  `rglob("*")` plus a `stat` per entry. `rglob` is breadth-first, so it
  enumerated 353 directories before the first file: 2506 us -> 248 us. This
  also repairs the call site in `nemar_sourcedata_dl`, which the extraction
  had otherwise slowed down.
- `nemar_sourcedata_is_local` takes the resolved store root, hoisted out of
  the per-subject loop. Resolving it re-reads MNE's config file four times,
  which was 60% of the per-subject cost.

Correctness caught by the suite while doing the above:
- `_nemar_subject_ids` must return the *scalar* unless the deposit files the
  subject under a second label. Returning `[subject]` unconditionally changed
  what `nemar_sourcedata_dl` receives and broke the per-subject fallback.

Also makes both `set_montage` calls strict: after the FC5/FC6 correction all
16 channels resolve, so `on_missing="ignore"` would only hide the next typo --
which is how this bug survived since NeuroTechXgh-700.
bruAristimunha added a commit that referenced this pull request Aug 26, 2026
… and the NEMAR prefetch guard (#1161)

- BNCI2025_001: type the 7 kinematic channels (target position, hand velocity) as misc. read_raw_eeglab typed them eeg, so every paradigm fed the labels to the classifier as features. EOG named explicitly so the declared channel_types is true by construction.
- Rodrigues2017, Cattan2019_PHMD and Cattan2019_VR: the montage gh-700 announced and never implemented. Fc5/Fc6 were the only two of their 16 names standard_1020 cannot resolve.
- Cattan2019_PHMD interval [0, 1] -> [0, 60]; its own metadata records 60 s blocks.
- NEMAR prefetch settles presence per subject, offline, instead of trusting any non-empty store.
- moabb.analysis no longer imports plotting eagerly, so importing a dataset stops restyling the caller's global matplotlib rcParams.
- The monthly download job pointed at a file that does not exist and collected nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants