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
I am trying to hickle objects into existing h5py.File objects and put each object into its own Group. Unfortunately, hickle does not allow me to do that.
Here is a minimal example:
import hickle, numpy, h5py
# open h5py file and create a group
h = h5py.File("test.hdf5", 'w')
h.create_group("Array")
# dump data into that group
d = numpy.ones((10,10))
hickle.dump(d, h["Array"])
which raises:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../lib/python2.7/site-packages/hickle.py", line 308, in dump
h5f = file_opener(file_obj, mode, track_times)
File ".../lib/python2.7/site-packages/hickle.py", line 163, in file_opener
raise FileError
hickle.FileError: Cannot open file. Please pass either a filename string, a file object, or a h5py.File
I assume that it should be easy to also accept h5py.Group objects, as they have the same functionality as the h5py.File.
The text was updated successfully, but these errors were encountered:
Thanks @siebenkopf , that is an excellent suggestion. There is currently some limited support using the path='/path/to/group', but frankly this isn't particularly well tested, and your use case is neat. Adding it to the todo list in #28!
I am trying to
hickle
objects into existingh5py.File
objects and put each object into its ownGroup
. Unfortunately,hickle
does not allow me to do that.Here is a minimal example:
which raises:
I assume that it should be easy to also accept
h5py.Group
objects, as they have the same functionality as theh5py.File
.The text was updated successfully, but these errors were encountered: