You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Array assert_eq doesn't check for equality on scalars #2680
(Pdb++) _not_empty(a) and_not_empty(True) # the second condition isn't checked
()
(Pdb++) _not_empty(True) # it is hit now, raises an error***AttributeError: 'bool'objecthasnoattribute'shape'
Activity
TomAugspurger commentedon Sep 14, 2017
This check seems fragile:
dask/dask/array/utils.py
Lines 99 to 103 in a1a75a7
I think that will short-circuit when
ais empty.TomAugspurger commentedon Sep 14, 2017
Huh
I'm not quite sure how to distinguish between empty arrays and a scalar.
TST: Have array assert_eq check scalars
TST: Have array assert_eq check scalars
TST: Have array assert_eq check scalars
bmerry commentedon Sep 15, 2017
I imagine it should probably have been
orrather thanand.TST: Have array assert_eq check scalars
shoyer commentedon Sep 15, 2017
getattr(x, 'size', 1)will be 1 for scalars and 0 for empty arrays.np.isscalar()has a pretty strange design. It checks for instances ofnp.generictypes or their built-in Python equivalents (int,float,str, etc).TST: Have array assert_eq check scalars
TST: Have array assert_eq check scalars
TST: Have array assert_eq check scalars (#2681)
TST: Have array assert_eq check scalars (dask#2681)