Skip to content

Vertexselect source index renaming - #14154

Open
Gnefil wants to merge 11 commits into
mne-tools:mainfrom
Gnefil:vertexselect-source-index
Open

Vertexselect source index renaming#14154
Gnefil wants to merge 11 commits into
mne-tools:mainfrom
Gnefil:vertexselect-source-index

Conversation

@Gnefil

@Gnefil Gnefil commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Reference issue (if any)

#14094

What does this implement/fix?

A small patch to remove redundant variable renaming.

Additional information

Merged PR #14126.

@Gnefil

Gnefil commented Aug 13, 2026

Copy link
Copy Markdown
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?

@Gnefil

Gnefil commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Also, a "no changelog" tag might be helpful here?

@Gnefil
Gnefil marked this pull request as ready for review August 13, 2026 18:42
Copilot AI lite review requested due to automatic review settings August 13, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.VertexSelect with an optional source_id field (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.

Comment thread mne/viz/ui_events.py

hemi: str
vertex_id: int
source_id: int = None
Comment thread mne/viz/_brain/_brain.py
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants