la icon indicating copy to clipboard operation
la copied to clipboard

nested keys fail on re-assigment

Open jmcloughlin opened this issue 10 years ago • 0 comments

In [1]: io = la.IO('test.h5')

In [2]: io['a'] = la.lrange(10)

In [3]: io['b/c/d'] = la.lrange(30)

In [4]: io
Out[4]: 
larry  dtype  shape
-------------------
a      int64  (10,)
b/c/d  int64  (30,)


In [5]: io['a'] = la.lrange(30)

In [6]: io['b/c/d'] = la.lrange(30)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-3bbe3a8557ba> in <module>()
----> 1 io['b/c/d'] = la.lrange(30)

/home/jmcl/devel/la/la/io.pyc in __setitem__(self, key, value)
    193 
    194         # If you've made it this far the data looks OK so save it
--> 195         save(f, value, key)
    196 
    197         f.close()

/home/jmcl/devel/la/la/io.pyc in save(file, lar, key)
    456     fkey = f[key]
    457     fkey.attrs['larry'] = True
--> 458     fkey['x'] = lar.x
    459     for i in range(lar.ndim):
    460         arrays, datetime_types = _label2arrays(lar.label[i])

/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.pyc in __setitem__(self, name, obj)
    269         else:
    270             ds = self.create_dataset(None, data=obj, dtype=base.guess_dtype(obj))
--> 271             h5o.link(ds.id, self.id, name, lcpl=lcpl)
    272 
    273     def __delitem__(self, name):

/usr/local/lib/python2.7/dist-packages/h5py/h5o.so in h5py.h5o.link (h5py/h5o.c:3094)()

RuntimeError: unable to create link (Links: Unable to initialize object)

jmcloughlin avatar Jul 09 '14 22:07 jmcloughlin