Add more ERP measures - #14221
Merged
Merged
Conversation
BelizSertcan
requested review from
agramfort,
drammock and
larsoner
as code owners
August 25, 2026 12:15
larsoner
reviewed
Aug 25, 2026
larsoner
left a comment
Member
There was a problem hiding this comment.
You'll need similar changes to other functions. Anything following the : in param names needs to resolve to a intersphinx-findable cross-ref entry, or have an ignore in doc/conf.py:numpydoc_xref_ignore. You will see CircleCI complain about these formatting and reference problems...
Co-authored-by: Jacob Woessner <Woessner.jacob@gmail.com>
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
Member
|
Looks great, thanks @BelizSertcan ! |
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.
This PR completes @withmywoessner 's work in #12434.
Reference issue (if any)
Closes #7848
Closes #12434
What does this implement/fix?
Implements the following ERP measures:
Changes relative to #12434:
average=Truenow returns asingle-row DataFrame, with the channel index shown as
"average", so thecolumn layout stays consistent with
average=False.channelstochannelfor consistency with the rest of MNE.DataFrame.shape. The newtests check computed values against closed-form results.
_check_pandas_installed(strict=True)rather thanimporting pandas at module level, so pandas stays optional for
compute_sme.Bugs fixed from #12434:
compute_frac_area_latency.compute_frac_peak_latencyreturned the peak's own latency for"offset"rather than the true post-peak crossing.
picksother than"all"— thechannelcolumn used the full
ch_nameswhile the data was the picked subset. Nowresolves
picksvia_picks_to_idxbefore building the labels.Additional information
Question for reviewers:
Should
compute_frac_area_latencysupportmode='intg'? For a biphasicsignal the lobes can cancel, so the cumulative integral isn't monotonic and
"the latency at which X% of the area is reached" may have multiple solutions
or none.
Claude Opus 5 helped identifying the bugs and writing the tests, and drafted this PR description.