Fixes UTF-8 dataset conversion to stringified JSON in hdf5db.py
Updates code format with black
Automates version control with versioneer. Output files now correctly store the latest version (1.1.3) accessible via h5json.__version__
The bug referenced in the 1st point can be reproduced via:
import h5py
with h5py.File('foo.hdf5', "w") as fp:
dt = h5py.string_dtype(encoding='utf-8')
ds = fp.create_dataset("foo", data=["A", "B", "C"], dtype=dt)
Converting foo.hdf5 to JSON yields an error since the array of strings does not get decoded (it is passed as a list of bytes instead). Note that for encoding="ascii", the conversion works (since in this case Hdf5db.bytesArrayToList is called, which decodes the byte strings).
This PR:
h5json.__version__
The bug referenced in the 1st point can be reproduced via:
Converting
foo.hdf5
to JSON yields an error since the array of strings does not get decoded (it is passed as a list of bytes instead). Note that forencoding="ascii"
, the conversion works (since in this caseHdf5db.bytesArrayToList
is called, which decodes the byte strings).