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
Currently, zero-dimensional arrays get rejected on NumericalTrait(ndim=0), as the latter requires the value to be np.isscalar. Unfortunately np.isscalar(np.array(1)) == False. The error is particularly annoying in conjunction with quantities, as quantities.Quantity is a subclass of np.ndarray and thus it's instances are not numpy array scalars.
The text was updated successfully, but these errors were encountered:
I have to admit that the validation code looks quite complicated to me (does it have to be that complicated?), so I do not want to mess too much with it. I think I have a fix that works though...
burnpanck
added a commit
to burnpanck/numtraits
that referenced
this issue
Jun 16, 2016
Currently, zero-dimensional arrays get rejected on
NumericalTrait(ndim=0)
, as the latter requires the value to benp.isscalar
. Unfortunatelynp.isscalar(np.array(1)) == False
. The error is particularly annoying in conjunction with quantities, asquantities.Quantity
is a subclass ofnp.ndarray
and thus it's instances are not numpy array scalars.The text was updated successfully, but these errors were encountered: