8000 BUG: do not emit warnings for np.sign, np.equal when using nan by mattip · Pull Request #15209 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: do not emit warnings for np.sign, np.equal when using nan #15209

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

Closed
wants to merge 1 commit into from

Conversation

mattip
Copy link
Member
@mattip mattip commented Dec 31, 2019

We should not emit warnings inside ufuncs without actually meaning to do so. It turns out we were emitting them in np.equal for certain non-regular nan values, and sometimes in np.sign as well.

@mattip
Copy link
Member Author
mattip commented Dec 31, 2019

Fixes gh-15127

@WarrenWeckesser
Copy link
Member
WarrenWeckesser commented Jan 3, 2020

The failure on s390x looks real, but the problem is in the unit test, not in the fix to the code. The platform is big-endian, so the conversion from a to b in the test puts the bytes in the wrong order. If you reverse the bytes in a and then view as float64 on a little-endian platform, you get array([7.29112202e-304]), which is the value displayed in the error log.

Perhaps add something like this before creating b:

if sys.byteorder == 'big':
    a = a[::-1].copy()

@mattip
Copy link
Member Author
mattip commented Jan 4, 2020

Replaced by gh-15230

@mattip mattip closed this Jan 4, 2020
@mattip mattip deleted the isssue-15127 branch January 4, 2020 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0