HDFMapTemplate

class bapsflib._hdf.maps.templates.HDFMapTemplate(group: Group)

Bases: ABC

Template class for all mapping template classes.

Note

  • To fully define a subclass the _build_configs abstract method needs to be defined.

    abstractmethod _build_configs()

    Inspect the HDF5 group and build the configuration dictionary, configs.

    Functionality should specifically populate self._configs instead of self.configs. If a mapping fails, then a HDFMappingError should be raised.

  • If a subclass needs to initialize additional variables before _build_configs is called in the __init__, then those routines can be defined in the _init_before_build_configs method.

    _init_before_build_configs()

    Any initialization that needs to be performed before executing self._build_configs in __init__.

    By default we do nothing, but subclasses can override this for their specific purposes.

Parameters:

group (h5py.Group) – The HDF5 to apply the mapping to.

Attributes Summary

configs

Dictionary containing all the relevant mapping information to translate the corresponding device data in the HDF5 file and provide a consistent user interface via File.

dataset_names

List of names of the HDF5 datasets within the mapped group, at the root level.

group

Instance of the HDF5 group that was mapped.

group_name

Name of the mapped HDF5 group.

group_path

Path of the mapped HDF5 group in the HDF5 file.

info

Metadata information about the mapping type and the mapped group location in the HDF5 file.

maptype

Mapping class type (MapTypes).

subgroup_names

List of names of the HDF5 subgroups within the mapped group, at the root level.

Attributes Documentation

configs

Dictionary containing all the relevant mapping information to translate the corresponding device data in the HDF5 file and provide a consistent user interface via File.

dataset_names

List of names of the HDF5 datasets within the mapped group, at the root level.

group

Instance of the HDF5 group that was mapped.

group_name

Name of the mapped HDF5 group.

group_path

Path of the mapped HDF5 group in the HDF5 file.

info

Metadata information about the mapping type and the mapped group location in the HDF5 file.

Extended Summary

The dictionary will contain the following elements:

info = {
    "group name": "Device",  # name of the mapped HDF5 group
    "group path": "/foo/bar/Device", # internal HDF5 path to the group
    "maptype": self.maptype,  # mapping class type
}
maptype

Mapping class type (MapTypes).

subgroup_names

List of names of the HDF5 subgroups within the mapped group, at the root level.