mvpa2.base.hdf5.hdf2obj

mvpa2.base.hdf5.hdf2obj(hdf, memo=None)

Convert an HDF5 group definition into an object instance.

Obviously, this function assumes the conventions implemented in the obj2hdf() function. Those conventions will eventually be documented in the module docstring, whenever they are sufficiently stable.

Parameters:

hdf : HDF5 group instance

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

memo : dict

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

Returns:

object instance

Notes

Although, this function uses a way to reconstruct object instances that is similar to unpickling, it should be relatively safe to open HDF files from untrusted sources. Only basic datatypes are stored in HDF files, and there is no foreign code that is executed during reconstructing. For that reason, any type that shall be reconstructed needs to be importable (importing is done be fully-qualified module names).