Skip to content
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

error of bbox.contains #499

Open
xiuliren opened this issue Sep 7, 2021 · 1 comment
Open

error of bbox.contains #499

xiuliren opened this issue Sep 7, 2021 · 1 comment
Labels
bug The code is not performing according to the design or a design flaw is seriously impacting users.

Comments

@xiuliren
Copy link
Member

xiuliren commented Sep 7, 2021

it seems that the Vec do not work with np.all

https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/lib.py#L764

np.all(Vec(False,True,True, dtype=bool))
*** TypeError: iteration over a 0-d array

this one works

np.all(np.asarray(Vec(False,True,True, dtype=bool)))
@william-silversmith
Copy link
Contributor

william-silversmith commented Sep 7, 2021

Huh, this is pretty interesting. I suspect this is at fault:

https://github.com/numpy/numpy/blob/v1.21.0/numpy/core/fromnumeric.py#L73

Vec is a subtype of ndarray, so type(obj) will switch away from the ufunc.reduce path. Is this a bug in numpy?

@william-silversmith william-silversmith added the bug The code is not performing according to the design or a design flaw is seriously impacting users. label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code is not performing according to the design or a design flaw is seriously impacting users.
Projects
None yet
Development

No branches or pull requests

2 participants