-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add .view() method for NumPy scalars #3928
Conversation
We will need to differentiate between numpy scalar and regular scalars that do not have the x = 1
x.view(...) # invalid
np.int32(x).view(...) # valid |
I wonder what is the status of view(...) method of numpy.int32 instance
Not implemented (virtual attribute) |
@sklam should we implement |
@esc, the problem is that numba treat numpy scalar type and regular scalar type in the same way. So you have already implemented |
Travis failed, because job exceeded timeout, restarting and keeping fingers crossed. |
@sklam is there anything else I might be able to code up for this? I don't think we should add a |
Seems like it exceeded the time-limit again. Asking Travis-CI people if they can increase the timeout for Numba builds for us. |
the Travis CI builds are redundant to the Azure builds at this point. Should we just drop them? |
@seibert it may really be worth considering. |
Looks like this is failing for Python 2.7 |
Perhaps some sort of ascii vs. unicode issue, certainly does smell like it. |
Unicode ( |
So I updated the tests and they pass locally on 2.7. I hope they will pass CI too. @stuartarchibald @sklam is there any other types where you suggest I test them? Two side quests so far:
|
@stuartarchibald, actually, I think that raise statement can never be reached. Using |
As the intrinsic is a function it could well be reused, but is only likely to be by developers, given that the implementation returned could be invalid in the case of simply removing the exception I'm inclined to leave it in or replace it with |
This implements exactly what I was looking for. Thank you. |
@svenrahmann thanks for the feedback, happy to hear it! 🎉 |
CI revealed some tests that should be skipped on non-64 bit systems. |
All green and ready for review. |
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 for the PR. This in general seems good and does what is expected. I've made a few comments, once resolved I'll re-review with view to merge. Thanks again!
Co-Authored-By: esc <esc@users.noreply.github.com>
Co-Authored-By: esc <esc@users.noreply.github.com>
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 for the fixes, couple more things to resolve and this can be marked for merge.
Thanks for all the feedback, pushing fixes 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 for your persistence in getting this to work. This looks good :)
Pending CI pass, this can be marked for merge. |
😁 |
Travis had a timeout again connecting to anaconda.org restarted the build. |
This implements and fixes #3763