Closed
Description
This is a problem that showed up when testing the Zarr Julia interface. Currently nan-values in user-attribute values are not converted to strings (see example below), which does not adhere to JSON specs and causes the Julia JSON parser to fail. So I would suggest to do something analogous to the fill_value
entry in .zarray
, i.e. to either forbid nan
in zarr user attributes or convert them to strings to make the resulting JSON valid.
import zarr
import numpy
z1 = zarr.open('attrtest')
z1.attrs['att1']=numpy.nan
with open('attrtest/.zattrs') as myfile:
print(myfile.read())