Skip to content
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

Unusual behavior of peakprom? #4

Closed
ymtoo opened this issue Feb 28, 2020 · 2 comments · Fixed by #5
Closed

Unusual behavior of peakprom? #4

ymtoo opened this issue Feb 28, 2020 · 2 comments · Fixed by #5

Comments

@ymtoo
Copy link

ymtoo commented Feb 28, 2020

Maxima of an array of all zeros is

julia> peakprom(zeros(10), Maxima())
([2, 4, 6, 8], [0.0, 0.0, 0.0, 0.0])

instead of (Int64[], Float64[]).

halleysfifthinc added a commit that referenced this issue Feb 28, 2020
Previously, we didn't check if the less-than comparison between 2
elements was false because they were equal, this erroneously added peaks
in every window due to the default of `peak = true`.

Added checks to avoid comparing an element with itself, and checks to
treat equality between different elements as not a peak.
halleysfifthinc added a commit that referenced this issue Feb 28, 2020
halleysfifthinc added a commit that referenced this issue Feb 29, 2020
Previously, we didn't check if the less-than comparison between 2
elements was false because they were equal, this erroneously added peaks
in every window due to the default of `peak = true`.

Added checks to avoid comparing an element with itself, and checks to
treat equality between different elements as not a peak.
halleysfifthinc added a commit that referenced this issue Feb 29, 2020
@halleysfifthinc
Copy link
Owner

Good catch! I've got a PR in progress, and I should release a new version in a couple days.

@ymtoo
Copy link
Author

ymtoo commented Feb 29, 2020

Thanks!

halleysfifthinc added a commit that referenced this issue Feb 29, 2020
Previously, we didn't check if the less-than comparison between 2
elements was false because they were equal, this erroneously added peaks
in every window due to the default of `peak = true`.

Added checks to avoid comparing an element with itself, and checks to
treat equality between different elements as not a peak.
halleysfifthinc added a commit that referenced this issue Feb 29, 2020
halleysfifthinc added a commit that referenced this issue Feb 29, 2020
Previously, we didn't check if the less-than comparison between 2
elements was false because they were equal, this erroneously added peaks
in every window due to the default of `peak = true`.

Added checks to avoid comparing an element with itself, and checks to
treat equality between different elements as not a peak.
halleysfifthinc added a commit that referenced this issue Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants