neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.58k stars 421 forks source link

[Feature] Add signal_flatintervals function for flatline detection #940

Open jchromik opened 11 months ago

jchromik commented 11 months ago

Description

This PR aims at adding the function signal_flatintervals. The function can identify flatline intervals in signals and if modelled after signal_flatline. We discussed this feature in #823. It is one step towards making NeuroKit able to process long-term ECGs with bad or unprocessable intervals.

Possible Next Step

A possible next step could be to a bad_intervals keyword argument to the peak detection functions to that the peak detector does not need to process the whole signal but only the good (non-flatline parts).

Limitations / Concerns

Checklist

codecov-commenter commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (87c8c60) 54.82% compared to head (59d0c83) 54.88%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #940 +/- ## ========================================== + Coverage 54.82% 54.88% +0.05% ========================================== Files 304 305 +1 Lines 14269 14287 +18 ========================================== + Hits 7823 7841 +18 Misses 6446 6446 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jchromik commented 11 months ago

@DominiqueMakowski I renamed the parameter tolerance to duration_min. All checks pass now. Code cov is complete for all my changes. (I'm still open for feedback and critique, though ;-) )

stale[bot] commented 8 months ago

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.