You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I'm aware that there are many issues already open about writing lists of unicode strings to h5py attributes. But I found that the same problem exists when I try to write a single unicode string using the .create API, while it works fine when I write the string using the setter API.
This works: h5f["toto"].attrs["toto"] = u"toto"
This causes an error: h5f["toto"].attrs.create("toto", data=u"toto") TypeError: No conversion path for dtype: dtype('<U4')
Is there a reason for this difference in behavior? Or would it be possible to also add the if dtype is None: dtype = base.guess_dtype(value) line to the create method, like it is done in __setitem__ ? (https://github.com/h5py/h5py/blob/master/h5py/_hl/attrs.py#L102)
Hi.
I'm aware that there are many issues already open about writing lists of unicode strings to h5py attributes. But I found that the same problem exists when I try to write a single unicode string using the
.create
API, while it works fine when I write the string using the setter API.This works:
h5f["toto"].attrs["toto"] = u"toto"
This causes an error:
h5f["toto"].attrs.create("toto", data=u"toto")
TypeError: No conversion path for dtype: dtype('<U4')
Is there a reason for this difference in behavior? Or would it be possible to also add the
if dtype is None: dtype = base.guess_dtype(value)
line to thecreate
method, like it is done in__setitem__
? (https://github.com/h5py/h5py/blob/master/h5py/_hl/attrs.py#L102)Summary of the h5py configuration
h5py 2.8.0
HDF5 1.10.2
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.14.5
The text was updated successfully, but these errors were encountered: