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

Third loop in wfdb.processing.peaks.find_local_peaks will not be executed and can be removed #474

Open
mj-64 opened this issue Dec 11, 2023 · 0 comments

Comments

@mj-64
Copy link

mj-64 commented Dec 11, 2023

In find_local_peaks() in wfdb.processing.peaks, the last of three loops will not be execute because the condition i < len(sig) is already false when the second loop exits:
[first loop omitted]

while i < len(sig):
    if sig[i] == max(sig[i - radius : i + radius]):
        peak_inds.append(i)
        i += radius
    else:
        i += 1

while i < len(sig):
    if sig[i] == max(sig[i - radius :]):
        peak_inds.append(i)
        i += radius
    else:
        i += 1
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

No branches or pull requests

1 participant