-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Fix C types in scalartypes #24240
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
Conversation
@@ -301,10 +301,10 @@ genint_type_str(PyObject *self) | |||
item = PyLong_FromUnsignedLong(*(uint32_t *)val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These and above are also wrong (or maybe just badly named). Probably makes sense to just use npy_<name>
, although they are the same anyway.
(I suppose, in practice we probably don't support any platform for which all but long
aren't correct.)
numpy#23746 introduced a fast path for scalar int conversions, but the map between Python types and C types was subtly wrong. This fixes tests on at least ppc32 (big-endian). Many thanks to Sebastian Berg for debugging this with me and pointing out what needed to be fixed. Closes numpy#24239. Fixes: 81caed6
f5eb12c
to
d9c0c96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force pushed the larger fix, good to go now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Thanks! Sorry I hadn't got back to it yet, appreciate you finishing it off. |
#23746 introduced a fast path for scalar int conversions, but the map between Python types and C types was subtly wrong.
This fixes tests on at least ppc32 (big-endian).
Many thanks to Sebastian Berg for debugging this with me and pointing out what needed to be fixed.
Closes #24239.
Fixes: 81caed6