p2p-ld / numpydantic

Type annotations for specifying, validating, and serializing arrays with arbitrary backends in Pydantic (and beyond)
https://numpydantic.readthedocs.io/
MIT License
66 stars 1 forks source link

bugfix - don't choke on empty HDF5 datasets during validation #16

Closed sneakers-the-rat closed 2 months ago

sneakers-the-rat commented 2 months ago

When an HDF5 dataset is empty, it emits a ValueError or IndexError when trying to index an empty array. This causes our validation to fail in a way that it shouldn't - we can specify an empty array (or Any sized array) and we should still be able to validate that.

Fixed and added tests