Skip to content

read to standard numpy data types, python types etc. #1908

@beckermr

Description

@beckermr

I ran into something a bit funny relative to my expectations.

The data type of numpy arrays when read back in is not a subtype of say np.ndarray, the actual dict structure is not a python dict, etc.

>>> print(type(md), type(md["z"]), isinstance(md["z"], np.ndarray))

<class 'asdf.tags.core.AsdfObject'> <class 'asdf.tags.core.ndarray.NDArrayType'> False

I get why this happens, but it breaks the ability of data to "round trip" to and from files and get the same thing back out, interface the ASDF data into other tools, etc.

Is there an option or can one add an option to read the whole tree back into non-ASDF types?

This operation would not allow lazy loading, etc., which is the expected behavior.

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