Skip to content

Speed up label adjacency computation - #14229

Merged
larsoner merged 1 commit into
mne-tools:mainfrom
larsoner:label-efficiency
Aug 27, 2026
Merged

Speed up label adjacency computation#14229
larsoner merged 1 commit into
mne-tools:mainfrom
larsoner:label-efficiency

Conversation

@larsoner

Copy link
Copy Markdown
Member

Follow-up to #14226 -- I saw it using a large source space and went to change it to use sample plus oct3, then realized with Opus 5 (drafted changes, I reviewed and iterated) there were faster ways to compute the adjacency using sparse matrix tricks, plus dijkstra from scipy (less code for us to maintain!) 🚀

This is about the same + as -, but a lot of the old code is just in comments so that the old / naive way can be viewed next to the faster one. (I find this is helpful when revisiting code later.)

I think we can trust our existing unit tests and verified equivalences here so I'll self-mark for merge-when-green.

@larsoner
larsoner enabled auto-merge (squash) August 27, 2026 10:20
@larsoner
larsoner merged commit eff1e3f into mne-tools:main Aug 27, 2026
30 of 31 checks passed
@larsoner
larsoner deleted the label-efficiency branch August 27, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant