NeuroKit
NeuroKit copied to clipboard
[Feature] R-R intervals and associated timestamps as input to HRV functions
Description
This PR aims at adding the ability to directly pass R-R intervals to the HRV functions. See also https://github.com/neuropsychology/NeuroKit/issues/684
Proposed Changes
Instead of separately sanitizing the input and converting to R-R intervals, I added a function _hrv_format_input()
that can accept a dictionary with the keys RRI
and RRI_Time
and always returns the same format (either peaks or intervals depending on the HRV function) regardless of whether peaks or intervals are passed.
Checklist
Here are some things to check before creating the PR. If you encounter any issues, do let us know :)
- [x] I have read the CONTRIBUTING file.
- [x] My PR is targetted at the dev branch (and not towards the master branch).
- [x] I ran the CODE CHECKS on the files I added or modified and fixed the errors.
- [ ] I have added the newly added features to News.rst (if applicable)