mvpa2.base.hdf5.obj2hdf

mvpa2.base.hdf5.obj2hdf(hdf, obj, name=None, memo=None, noid=False, **kwargs)

Store an object instance in an HDF5 group.

A given object instance is (recursively) disassembled into pieces that are storable in HDF5. In general, any pickable object should be storable, but since the parser is not complete, it might not be possible (yet).

Warning

Currently, the parser does not track recursions. If an object contains recursive references all bets are off. Here be dragons...

Parameters:

hdf : HDF5 group instance

HDF5 group instance. this could also be an HDF5 file instance.

obj : object instance

Object instance that shall be stored.

name : str or None

Name of the object. In case of a complex object that cannot be stored natively without disassembling them, this is going to be a new group, Otherwise the name of the dataset. If None, no new group is created.

memo : dict

Dictionary tracking stored objects to prevent recursions (analog to deepcopy).

noid : bool

If True, the to be processed object has no usable id. Set if storing objects that were created temporarily, e.g. during type conversions.

**kwargs

All additional arguments will be passed to h5py.Group.create_dataset()