frejanordsiek / hdf5storage

Python package to read and write a wide range of Python types to/from HDF5 formatted files. Can read/write data to the HDF5 based Matlab v7.3 MAT files.
BSD 2-Clause "Simplified" License
83 stars 24 forks source link

Adding read/write support for numpy.dtype #99

Closed frejanordsiek closed 4 years ago

frejanordsiek commented 4 years ago

Add a marshaller to read/write numpy.dtype objects (https://numpy.org/doc/stable/reference/arrays.dtypes.html).

frejanordsiek commented 4 years ago

Support added in commit 68d83b92ac08fb97811686035800e7b9400cd161 with the new marshaller Marshallers.NumpyDtypeMarshaller.

They are stored as their string representation, which is a bit tricky in the case of dtypes which have their align argument set.

frejanordsiek commented 3 years ago

NumPy 1.20 (https://numpy.org/doc/stable/release/1.20.0-notes.html) changed how dtypes work, with them no longer having the type numpy.dtype but instead inherit from it. Commit 225de6e fixes this. Also, commit baec354 fixes the tests which used the deprecated and now removed numpy.sctypeNA.