Vertexselect source index renaming - #14154
Open
Gnefil wants to merge 11 commits into
Open
Conversation
Co-authored-by: Marijn van Vliet <w.m.vanvliet@gmail.com>
Contributor
Author
|
I thought it would only show the last commit, which should be the only one that is new (all previous commits were merged in a previous PR). I think it is not a problem? |
Contributor
Author
|
Also, a "no changelog" tag might be helpful here? |
Gnefil
marked this pull request as ready for review
August 13, 2026 18:42
Gnefil
requested review from
agramfort,
drammock,
larsoner and
wmvanvliet
as code owners
August 13, 2026 18:42
There was a problem hiding this comment.
Pull request overview
This PR updates MNE-Python’s Brain UI event pipeline so VertexSelect events can carry a source_id (source-space index) alongside the picked vertex_id, supporting downstream consumers that need source indices without re-mapping.
Changes:
- Extend
mne.viz.ui_events.VertexSelectwith an optionalsource_idfield (and document it). - Publish
VertexSelect(..., source_id=...)from Brain interactions (time-course initialization and picking). - Add regression tests and a towncrier changelog fragment for the new event payload.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
mne/viz/ui_events.py |
Adds source_id to the VertexSelect UI event dataclass and docs. |
mne/viz/_brain/_brain.py |
Populates and publishes source_id for vertex selection events. |
mne/viz/_brain/tests/test_brain.py |
Tests that vertex selection events include correct source_id (or None). |
doc/changes/dev/14126.newfeature.rst |
Documents the new source_id addition in the changelog. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| hemi: str | ||
| vertex_id: int | ||
| source_id: int = None |
Comment on lines
+1497
to
+1499
| smooth_mat = self.act_data_smooth[hemi][1] | ||
| row = smooth_mat[vertex_id] | ||
| source_id = smooth_mat[vertex_id].argmax() if row.nnz else None |
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.
Reference issue (if any)
#14094
What does this implement/fix?
A small patch to remove redundant variable renaming.
Additional information
Merged PR #14126.