ENH: Speed up forward computations for iterative fitting#13407
ENH: Speed up forward computations for iterative fitting#13407larsoner merged 8 commits intomne-tools:mainfrom
Conversation
wmvanvliet
left a comment
There was a problem hiding this comment.
Nice to have this implemented in its proper place! Some suggestions for clearer names.
mne/forward/_make_forward.py
Outdated
| src = _ensure_src(src).copy() | ||
| for s in src: | ||
| transform_surface_to(s, "head", self.mri_head_t) |
There was a problem hiding this comment.
I see some lines in this method (such as these) that look similar/identical to stuff happening in _prepare_for_forward. I'm assuming you've already done what you can to DRY, and there's just enough that is different to make it hard/impossible to abstract out a helper func. But mentioning it here in case you missed the redundancy / just forgot to go back and refactor those bits.
There was a problem hiding this comment.
Okay made it a little more DRY by adding a src._transform_to(...) at least! There were maybe half a dozen places it turns out we used that for s in src: transform_surface_to(s, ...) pattern
Todo
_CheckInsideSpherewith equivalent__call__andquerycc @wmvanvliet
Relevant for #13074