Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ketozhang opened this issue May 22, 2024 · 1 comment · May be fixed by #14
Open

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

ketozhang opened this issue May 22, 2024 · 1 comment · May be fixed by #14
Labels
bug Something isn't working

Comments

@ketozhang
Copy link
Owner

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

@ketozhang ketozhang added the bug Something isn't working label May 22, 2024
@ketozhang
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant