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

IndexError in _ecg_findpeaks_manikandan() #1058

Open
cgastaud opened this issue Dec 16, 2024 · 1 comment
Open

IndexError in _ecg_findpeaks_manikandan() #1058

cgastaud opened this issue Dec 16, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@cgastaud
Copy link

Describe the bug
In the function, if the window goes outside the signal length, we try (badly) to clip the window, causing an IndexError
See here

To Reproduce
Example steps to reproduce the behaviour. For instance:

signal = np.arange(5)
search_window_half = 10
i = 0
highs = np.arange(i + 1, i + search_window_half + 1)
highs = np.delete(
    highs, np.arange(np.where(highs == len(signal))[0], len(highs) + 1)  # there shouldn't be a +1 here
)

We could remove the +1, but why not simply change highs to:

highs = np.arange(i + 1, min(i + search_window_half + 1, len(signal))

and remove the if block ?

Expected behaviour
Not throw an error

Copy link

stale bot commented Feb 24, 2025

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix This will not be worked on label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant