Repository navigation
DOC: Say when not to use mean_flip in extract_label_time_course - #14621
Merged
Merged
Conversation
PragnyaKhandelwal
requested review from
agramfort,
drammock and
larsoner
as code owners
December 1, 2026 19:18
larsoner
approved these changes
Dec 1, 2026
larsoner
left a comment
Member
There was a problem hiding this comment.
Agree with the rewording here, thanks @PragnyaKhandelwal
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)
Related to #14428. Forum thread: https://mne.discourse.group/t/11491
What does this implement/fix?
The
modenotes forextract_label_time_courseexplain whatmean_flipdoes but not when it is the wrong choice. The sign flip only makes sense for signed estimates (fixed orientation, orpick_ori="normal"). For non-negative magnitudes such as dSPM, sLORETA or eLORETA with free/loose orientation (pick_ori=None), the flipped vertices cancel the rest, so the label's sign can differ between subjects — the problem in the linked thread. This adds a few sentences saying to usemode="mean"for those, and one sentence to theautoentry noting thatautoselectsmean_flipfor these estimates too.The wording lives in
docdict["eltc_mode_notes"]; the three docstrings insource_estimate.pywere synced withtools/hooks/check_static_docs.py --fix.Additional information
Checked with a small synthetic surface label (mixed normals, all-positive data):
autoandmean_flipgave ≈0.19,meangave ≈0.96. This came up in an MNE assistant benchmark (#14428) where none of the assistants tested gave this answer, so it seemed worth stating in the docs for human readers too.AI disclosure: I used Claude Code (Claude Opus) to draft the docstring wording and the synthetic check; I reviewed it against the source and the forum thread and ran the check myself.