Skip to content

Validation error when serializing numpy arrays types due to ASDF's custom NDArrayType #13

Open
@ketozhang

Description

@ketozhang

ASDF file with fields !core/ndarray-1.0.0 are serialized to NDArrayType, a custom data type from ASDF (not the same as np.ndarray).

This causes issues with pydantic models with field typed as np.ndarray (or np.typing.NDArray). Validation fails since NDArrayType is not equal to np.ndarray.

Currently you may work around this by annotating numpy fields as NDArrayType

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions