-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
Description
The following example
from nutils.function import Array
import numpy
Array.cast(numpy.array(['a', 'b'], dtype=object))
gives the following error message
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
Array.cast(numpy.array(['a', 'b'], dtype=object))
File "<stdin>", line 144, in cast
value = _Constant(value)
File "<stdin>", line 752, in __init__
self._value = types.arraydata(value)
File "<stdin>", line 573, in __call__
return args[0].__new__(*args, **kwargs)
File "<stdin>", line 747, in __new__
dtype = dict(b=bool, u=int, i=int, f=float, c=complex)[array.dtype.kind]
KeyError: 'O'
This is not really helpful. Consider adding a proper error message informing the caller that object arrays are not supported.
IshaanDesai