Closed
Conversation
NPY_PROMOTION_STATE=weak_and_warn reports that several variables changed from int16 to int64. Casting to int64 addresses the issue.
Closed
bemoody
requested changes
Oct 25, 2024
Collaborator
bemoody
left a comment
There was a problem hiding this comment.
This doesn't fix any of the warnings. Think about what the code is doing and what the warning says.
What is the operation that reports a warning?
What is the type and the value of the left-hand side?
What is the type and the value of the right-hand side?
What is the type and the value of the result when it's evaluated under legacy rules?
What is the type and the value of the result when it's evaluated under weak rules?
What is the desired result and why?
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.
As discussed in #493, numpy v2.0 introduced changes to type promotion rules: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion
Running pytest with
numpy==2.0.2andNPY_PROMOTION_STATE=weak_and_warnraises the following warning for wfdb/io/convert/edf.py:The changes in this pull request address these issues by explicitly casting the type.