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

BUG: Fortify string casts against floating point warnings #22868

Merged
merged 1 commit into from Dec 22, 2022

Conversation

charris
Copy link
Member

@charris charris commented Dec 22, 2022

Backport of #22855.
Backport of #22874.

This removes the check for floating point warnings, which is enough in practice. (In principle ufuncs or structured dtypes can chain casts in a way that causes us to check anyway.)

It also checks for isfinite in the scalar repr code so the warnings shouldn't be set to begin with.

Closes gh-22843
Fixes gh-22855

@charris charris added the 08 - Backport Used to tag backport PRs label Dec 22, 2022
@charris charris added this to the 1.24.1 release milestone Dec 22, 2022
@charris
Copy link
Member Author

charris commented Dec 22, 2022

@seberg the PPC failure is actually legit. This is in the added test:

E           UserWarning: The value of smallest normal is undefined for double double

@seberg
Copy link
Member

seberg commented Dec 22, 2022

Arg, didn't notice on the main PR. I guess we were lazy to define it correctly? Seems like it should be possible to define it reasonably well...

But in either case, here the important part is to just replace it with something that always works. Unlikely I will do it today, but should tomorrow.

@charris
Copy link
Member Author

charris commented Dec 22, 2022

Arg, didn't notice on the main PR.

Most of the PPC failures are network failures and can be ignored. The difference here was "one failing check" vs "one action required check".

seberg added a commit to seberg/numpy that referenced this pull request Dec 22, 2022
There is not much value in these values anyway probably, but tiny
isn't reliably for double-double (maybe it should be, but that is
a different issue).

Fixup for numpygh-22855 and numpygh-22868
This removes the check for floating point warnings, which is enough
in practice.  (In principle ufuncs or structured dtypes can chain
casts in a way that causes us to check anyway.)

It also checks for isfinite in the scalar repr code so the warnings
shouldn't be set to begin with.

Closes numpygh-22843
@charris charris merged commit 3e2a0ba into numpy:maintenance/1.24.x Dec 22, 2022
@charris charris deleted the backport-22855 branch December 22, 2022 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 08 - Backport Used to tag backport PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants