-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
unp.isnan fails when input is empty array #164
Comments
Indeed, this makes sense. Well spotted! Let me check how to fix this in a proper way. |
Adding a note that when called with the singleton argument np.nan, it goes to a lot of trouble to create a vectorized call for that one element. Should there be a fast path for singletons vs arrays? |
I would say that the simplicity/uniformity of the code is a positive point and accelerating an already fast case (singletons) is not worth breaking a more maintainable code, at this stage. Also, one could think of similarly accelerating the 2-element case, etc. This is a rabbit hole! |
Fair enough. I'm looking at ways to avoid the overhead a different way (using PintArray to give me an array I can dequantify and pass to unp.isnan as a proper array rather than using map to call unp.isnan on elements one-by-one). |
np.isnan
correctly returns an empty array when given an empty array as an argument.unp.isnan
goes straight to its wrapper, which attempts to vectorize the operation:The text was updated successfully, but these errors were encountered: