Skip to content

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

Description

@mj-64

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions