Skip to content

Conversation

@Kallemakela
Copy link
Contributor

PR Description

Channels are renamed here without a warning or error when there is a mismatch between the raw data and BIDS channels.tsv. This can cause a possible mismatch between channel names and the underlying locations (raw.info['chs'][i]['loc']) and signal data (raw._data).

@larsoner proposed a fix here that was never implemented:

Yikes so there's no real way to know. Maybe we should raise an error but allow people to pass ch_name_mismatch='raise' (default) | 'reorder' | 'rename'. We could even just start with the reorder case as that's the one we actually need here, unless people already have seen datasets that need to rename one.

So I implemented it, except using 'raise' as the default. In my opinion, this makes more sense as this is a clear error in the BIDS dataset.

Maybe we should also:

  • Provide an utility tool for overwriting BIDS channels.tsv files from the raw data files: example for snirf
  • Update the bids validator to check for channel mismatches.

Related issues:
#1360
#1117

Merge checklist

Maintainer, please confirm the following before merging.
If applicable:

  • All comments are resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • New contributors have been added to CITATION.cff
  • PR description includes phrase "closes <#issue-number>"

@welcome
Copy link

welcome bot commented Nov 3, 2025

Hello! 👋 Thanks for opening your first pull request here!
Please read the contributor guide, and please follow the steps outlined in the "Instructions for first-time contributors" section therein. ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@sappelhoff sappelhoff requested a review from larsoner November 3, 2025 16:13
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.92%. Comparing base (465dd55) to head (138e699).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1466      +/-   ##
==========================================
- Coverage   96.92%   96.92%   -0.01%     
==========================================
  Files          43       43              
  Lines       10015    10074      +59     
==========================================
+ Hits         9707     9764      +57     
- Misses        308      310       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kallemakela Kallemakela marked this pull request as ready for review November 4, 2025 08:16
Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

Otherwise I think it's good to go!

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

@drammock feel free to merge if you're happy as well

@larsoner
Copy link
Member

larsoner commented Nov 4, 2025

Or actually @scott-huberty you have a "changes requested", can you re-review and approve if you're happy?

@scott-huberty scott-huberty enabled auto-merge (squash) November 4, 2025 16:32
@scott-huberty
Copy link
Collaborator

Or actually @scott-huberty you have a "changes requested", can you re-review and approve if you're happy?

enabled merged when green. Thanks @Kallemakela !

@scott-huberty scott-huberty merged commit 60830be into mne-tools:main Nov 4, 2025
25 checks passed
@welcome
Copy link

welcome bot commented Nov 4, 2025

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

@sappelhoff
Copy link
Member

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.

Sample NIRS data not read, problem with channel naming

5 participants