Merged
Conversation
The alias 'np.int' has been removed from recent versions of numpy, and there is no particular reason to want to use it here (as an array data type, 'int' refers to a particular platform-dependent type, which is not at all the same thing as an ordinary Python integer.) Use int64 here for inter-platform consistency and to keep it simple.
Member
|
Looks good to me, thanks Benjamin. |
tompollard
approved these changes
Jun 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes issue #453 by using 64-bit integers on all platforms. (64-bit integers are way overkill for storing RR intervals, but I think it's wise to keep it simple and use 64-bit integers for all types of sample intervals.)
This is a pretty simple fix, but looking at the code I also notice there are a couple of significant issues with this function:
Unlike the ann2rr program, this function only considers the timestamps of the input annotations - it doesn't check whether they're QRS annotations or some other type of annotations (e.g. NOTE or RHYTHM).
Like the ann2rr program, this function includes the interval between the first annotation and the start of the record.
As a result, when you look at Lucas's example in the docstring:
the first two "RR intervals" listed here are bogus and misleading: the first is the interval between the start of the record and the first RHYTHM annotation, and the second is the interval between the RHYTHM annotation and the first NORMAL annotation.
All that is by way of saying, I'd like to add a test case for this function but I think it's kind of broken to begin with and probably its behavior should be better nailed down first.