-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minimum/maximum value of the all-positive/negative data #12383
Conversation
for more information, see https://pre-commit.ci
mne/evoked.py
Outdated
@@ -1965,10 +1965,12 @@ def _get_peak(data, times, tmin=None, tmax=None, mode="abs"): | |||
The minimum point in time to be considered for peak getting. | |||
tmax : float | None | |||
The maximum point in time to be considered for peak getting. | |||
mode : {'pos', 'neg', 'abs'} | |||
mode : {'pos', 'neg', 'abs', 'min', 'max'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confused; this doesn't match the API in the PR description (as was discussed in #12381)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that! I didn't push my changes yet.
I see that you've marked this as |
Okay, thanks for letting me know! I'll be sure to do that next time. Github should let people set up a grace period for notifications. It probably wastes a lot of maintainers' time. |
for more information, see https://pre-commit.ci
…e-python into pr/withmywoessner/12383
for more information, see https://pre-commit.ci
…e-python into pr/withmywoessner/12383
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, just some minor stuff
Co-authored-by: Eric Larson <[email protected]>
for more information, see https://pre-commit.ci
Done! @larsoner Thank you |
@larsoner I let you merge if happy |
Thanks @withmywoessner ! |
) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Larson <[email protected]>
Reference issue
#12381
What does this implement/fix?
Currently,
evoked.get_peak()
can't find a min/max in all positive/ all negative data.Implementation:
evoked.get_peak(mode="neg", strict=False)
strict
determines whether to return error if mode="neg" and there are no negative values (the current behavior, would become the strict=True behavior), or instead to return the minimum value of the all-positive data (the strict=False behavior).