Skip to content

view_scalars no longer works with type objects #575

@jcrist

Description

@jcrist

This used to work in dynd 0.7.0, but doesn't work in the new release:

In [1]: from dynd import nd

In [2]: a = nd.array([1, 2, None])

In [3]: a.dtype.value_type
Out[3]:
nd.array(int32,
         type="type")

In [4]: a.view_scalars(a.dtype.value_type)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-8ec4eaa0d375> in <module>()
----> 1 a.view_scalars(a.dtype.value_type)

dynd/nd/array.pyx in dynd.nd.array.array.view_scalars (/Users/travis/build/libdynd/dynd-python/build/temp.macosx-10.5-x86_64-3.5/dynd/nd/array.cxx:5615)()

dynd/ndt/type.pyx in dynd.ndt.type.type.__init__ (/Users/travis/build/libdynd/dynd-python/build/temp.macosx-10.5-x86_64-3.5/dynd/ndt/type.cxx:1625)()

dynd/ndt/type.pyx in dynd.ndt.type.as_cpp_type (/Users/travis/build/libdynd/dynd-python/build/temp.macosx-10.5-x86_64-3.5/dynd/ndt/type.cxx:4819)()

TypeError: issubclass() arg 1 must be a class

In [5]: import dynd

In [6]: dynd.__version__
Out[6]: "b'f641248'"

It does work with strings though:

In [7]: a.view_scalars('int32')
Out[7]:
nd.array([          1,           2, -2147483648],
         type="3 * int32")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions