-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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: add int->int loop for trunc #19505
Conversation
Thanks, I think this should have a brief release note at least (see Also needs at least some basic tests (although it looks like the code actually gets executed somewhere already). |
Sure. Will do that. Thanks!! |
Link to the discussion: http://numpy-discussion.10968.n7.nabble.com/np-trunc-is-inconsistent-with-array-api-td49360.html |
This is confusing me, there seem to be some emails there that should be there and were posted to the actual mailing list? But then there are also definitely mails missing and some additional mails (like yours). But does nabble just keep its own stuff around and it is not connected to the actual mailing list, which is hosted on python.org? |
@kshitij12345 I am not sure how you sent your mail, but I think it did not actually go out to the mailing list even though it somehow shows up in nabble. Could you (perhaps subscribe to https://mail.python.org/mailman/listinfo/numpy-discussion and) re-send the mail to numpy-discussion@python.org ? |
In any case this looks good. The other ufuncs in that family: |
@kshitij12345 did you get a chance to look at the other ufuncs and/or ping the mailing list about this? |
@mattip Ah sorry. I missed doing that. Will do both of them in a day or two. Thanks for the ping :) |
numpy/core/tests/test_ufunc.py
Outdated
@@ -612,6 +612,13 @@ def test_true_divide(self): | |||
assert_(res == 0.0) | |||
assert_(res.dtype.name == 'float64') | |||
|
|||
def test_trunc_expected_dtypes(self): | |||
# Supported dtypes by trunc. | |||
for tc in 'bBhHiIlLqQefdgO': |
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.
What about boolean ?
? (What should that actually do?)
Other than that, the only question is whether we should not aim for fixing this for the whole class of truncating functions?
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.
Ah. Right now, bool
get promoted which we don't want. Will add a loop entry for bool
.
As for others, is it ok to do a follow-up PR.
Apologies for the delayed response. (Will be more active henceforth :))
Thanks!
Fixes: #19464
Not entirely sure if this change is automatically picked up by
test_ufunc.py
. Would be great to know if this needs more explicit test.Thanks!
Note: BC-Breaking
cc: @seberg