[yt_analysis/yt] h5py serialization (issue #539)
New issue 539: h5py serialization https://bitbucket.org/yt_analysis/yt/issue/539/h5py-serialization Sam Skillman: It seems that with some version of h5py, we now run into these issues when using pf.h.save_object() with any type of data: ``` #!python In [1]: pf.h.save_object(np.ones(10), 'ones') /home/skillman/local/lib/python2.7/site-packages/h5py/_hl/dataset.py:94: RuntimeWarning: tp_compare didn't return -1 or -2 for exception dset_id.write(h5s.ALL, h5s.ALL, data) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /home/skillman/local/src/yt-hg/yt/mods.pyc in <module>() ----> 1 pf.h.save_object(np.ones(10), 'ones') /home/skillman/local/src/yt-hg/yt/data_objects/hierarchy.pyc in save_object(self, obj, name) 318 """ 319 s = cPickle.dumps(obj, protocol=-1) --> 320 self.save_data(s, "/Objects", name, force = True) 321 322 def load_object(self, name): /home/skillman/local/src/yt-hg/yt/data_objects/hierarchy.pyc in _save_data(self, array, node, name, set_attr, force, passthrough) 293 for q in node.split('/'): 294 if q: myGroup = myGroup.require_group(q) --> 295 arr = myGroup.create_dataset(name,data=array) 296 if set_attr is not None: 297 for i, j in set_attr.items(): arr.attrs[i] = j /home/skillman/local/lib/python2.7/site-packages/h5py/_hl/group.pyc in create_dataset(self, name, shape, dtype, data, **kwds) 69 """ 70 ---> 71 dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds) 72 dset = dataset.Dataset(dsid) 73 if name is not None: /home/skillman/local/lib/python2.7/site-packages/h5py/_hl/dataset.pyc in make_new_dset(parent, shape, dtype, data, chunks, compression, shuffle, fletcher32, maxshape, compression_opts, fillvalue) 92 93 if data is not None: ---> 94 dset_id.write(h5s.ALL, h5s.ALL, data) 95 96 return dset_id /home/skillman/local/lib/python2.7/site-packages/h5py/h5d.so in h5py.h5d.DatasetID.write (h5py/h5d.c:2866)() /home/skillman/local/lib/python2.7/site-packages/h5py/_proxy.so in h5py._proxy.dset_rw (h5py/_proxy.c:1766)() /home/skillman/local/lib/python2.7/site-packages/h5py/defs.so in h5py.defs.H5Tconvert (h5py/defs.c:18439)() /home/skillman/local/lib/python2.7/site-packages/h5py/_errors.so in h5py._errors.set_exception (h5py/_errors.c:711)() /home/skillman/local/lib/python2.7/site-packages/h5py/_conv.so in h5py._conv.str2vlen (h5py/_conv.c:3382)() /home/skillman/local/lib/python2.7/site-packages/h5py/_conv.so in h5py._conv.generic_converter (h5py/_conv.c:1302)() /home/skillman/local/lib/python2.7/site-packages/h5py/_conv.so in h5py._conv.conv_str2vlen (h5py/_conv.c:2158)() ValueError: VLEN strings do not support embedded NULLs In [2]: ``` Responsible: samskillman -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue.
participants (1)
-
Sam Skillman