Module for making in-memory mock-ups of h5py objects.
It is sometimes useful to have a consistent API for data that is independent of whether that data lives on disk or in memory. h5py provides this to a certain extent, having h5py.Dataset objects that act very much like numpy arrays. memh5 extends this, providing an in-memory containers, analogous to h5py.Group, h5py.AttributeManager and h5py.Dataset objects.
In addition to these basic classes that copy the h5py API, A higher level data container is provided that utilizes these classes along with the h5py to provide data that is transparently stored either in memory or on disk.
This also allows the creation and use of memh5 objects which can hold data distributed over a number of MPI processes. These MemDatasetDistributed datasets hold caput.mpiarray.MPIArray objects and can be written to, and loaded from disk like normal memh5 objects. Support for this must be explicitly enabled in the root group at creation with the distributed=True flag.
| ro_dict([d]) | A dict that is read-only to the user. |
| MemGroup([distributed, comm]) | In memory implementation of the h5py.Group. |
| MemAttrs | In memory implementation of the h5py.AttributeManager. |
| MemDataset(**kwargs) | Base class for an in memory implementation of h5py.Dataset. |
| MemDatasetCommon(shape, dtype) | In memory implementation of h5py.Dataset. |
| MemDatasetDistributed(shape, dtype[, axis, comm]) | Parallel, in-memory implementation of h5py.Dataset. |
| MemDiskGroup([data_group, distributed, comm]) | Container whose data may either be stored on disk or in memory. |
| BasicCont(*args, **kwargs) | Basic high level data container. |
| attrs2dict(attrs) | Safely copy an h5py attributes object to a dictionary. |
| is_group(obj) | Check if the object is a Group, which includes File objects. |
| get_h5py_File(f, **kwargs) | Checks if input is an h5py.File or filename and returns the former. |
| copyattrs(a1, a2) | |
| deep_group_copy(g1, g2) | Copy full data tree from one group to another. |