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

test_imaging_mixins: ignore RuntimeWarning raised by numpy >= 1.24 #441

Merged
merged 1 commit into from Dec 19, 2022

Conversation

tobiasjj
Copy link
Member

Why?
Numpy >= 1.24 raises a RuntimeWarning during casting if an floating point error occurs:
https://github.com/numpy/numpy/releases/tag/v1.24.0
numpy/numpy#21437

This causes test_imaging_mixins to fail:
numpy_1 24_overflow_warning

The affected funtion is TiffExport.export_tiff()

Solution
Ignore the warning in the tests.

@tobiasjj tobiasjj requested review from a team as code owners December 19, 2022 13:40
@tobiasjj tobiasjj requested review from tommasogritti, JoepVanlier and rpauszek and removed request for JoepVanlier December 19, 2022 13:40
Copy link
Contributor

@rpauszek rpauszek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@tobiasjj tobiasjj merged commit f1b385a into main Dec 19, 2022
@tobiasjj tobiasjj deleted the new_numpy_fix branch December 19, 2022 15:05
@JoepVanlier
Copy link
Member

JoepVanlier commented Jan 1, 2023

@rpauszek @tobiasjj I'm a bit late to the party, but isn't this warning us about an actual bug though?

Shouldn't the correct behavior be to explicitly clip prior to conversion if clip is True? Now the behaviour is undefined (I can't find anything in the numpy docs guaranteeing a particular behavior in the case of overflow). In my quick experiment it wraps around (which is is not what we want I think).

I also notice that the description in the RuntimeError is wrong. It mentions force=True while the argument is called clip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants