-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
FIX: correct sensor name ordering in plot_topomap when using Info object #13686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
larsoner
merged 29 commits into
mne-tools:main
from
Famous077:fix/plot-topomap-sensor-names
Apr 6, 2026
+30
−1
Merged
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
eed9959
FIX: correct sensor name ordering in plot_topomap when using Info object
Famous077 8aaae3b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4eb129b
ADD: changelog entry for fix sensor name ordering in plot_topomap #13686
Famous077 8261a97
Merge remote-tracking branch 'upstream/main' into fix/plot-topomap-se…
Famous077 9485d36
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 5f84b29
FIX: fix changelog entry format and add name to names.inc
Famous077 1a3b004
Merge branch 'fix/plot-topomap-sensor-names' of https://github.com/Fa…
Famous077 f751b66
Address review feedback: remove duplicate changelog, fix format, add …
Famous077 a81c960
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 476fc4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f291f93
TST: move imports to module level in test_plot_topomap_info_names_ord…
Famous077 166d865
DOC: fix contributor name in changelog and names.inc
Famous077 81fec95
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 ffe984a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1a535a2
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 14833a9
TST: verify displayed sensor names match expected in test_plot_topoma…
Famous077 9bb8f60
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1896bd3
TST: restore plt.close('all') calls and keep new test
Famous077 bd396c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 154a0a2
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 a510517
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 dbe3a56
FIX: assert ordered sensor names in test_plot_topomap_info_names_orde…
Famous077 bbe5ff3
Merge branch 'fix/plot-topomap-sensor-names' of https://github.com/Fa…
Famous077 26977da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 049e87c
Merge branch 'main' into fix/plot-topomap-sensor-names
Famous077 b4bfc48
style: fix import grouping via pre-commit
Famous077 149d6c5
Merge branch 'fix/plot-topomap-sensor-names' of https://github.com/Fa…
Famous077 115633a
DOC: revert contributor name to Famous077 for consistency
Famous077 5b6b8f3
FIX: remove unnecessary names reordering in else branch and update te…
Famous077 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix sensor name ordering in :func:`~mne.viz.plot_topomap` when passing an :class:`~mne.Info` object as ``pos`` with ``names`` argument, by :newcontrib:`Famous Raj Bhat`. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1292,9 +1292,13 @@ def _plot_topomap( | |
| pos = _find_topomap_coords(pos, picks=picks[::2], sphere=sphere) | ||
| data, _ = _merge_ch_data(data[picks], ch_type, []) | ||
| data = data.reshape(-1) | ||
| if names is not None: | ||
| names = [names[p] for p in picks[::2]] | ||
| else: | ||
| picks = list(range(data.shape[0])) | ||
| pos = _find_topomap_coords(pos, picks=picks, sphere=sphere) | ||
| if names is not None: | ||
| names = [names[p] for p in picks] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since here |
||
|
|
||
| extrapolate = _check_extrapolate(extrapolate, ch_type) | ||
| if data.ndim > 1: | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't check that name ordering is preserved, it just checks that the names are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ tsbinns I will update shortly.