bagofholding.h5.context module
- class bagofholding.h5.context.HasH5FileContext[source]
Bases:
objectA mixin class for context management with an
h5py.Fileobject.Supports addressing a group inside an HDF5 file by extending the filepath past a recognized file extension (e.g.,
folder/file.h5/group/subrefers to the group/group/subinsidefolder/file.h5). This allows storing multiple bags in a single HDF5 file. The set of recognized extensions is controlled byfile_extensions.- property file: Group
The bag’s working root group.
When the bag’s filepath has no interior group component, this is the HDF5 file’s root group (i.e., the
h5py.Fileitself, which is anh5py.Group). When the bag is rooted at an interior path, this is the corresponding sub-group.
- file_extensions: ClassVar[tuple[str, ...]] = ('.h5', '.hdf5')
- filepath: Path
- property h5_file_path: Path
The filesystem path to the underlying HDF5 file.
- property h5_group_path: str
The interior group path inside the HDF5 file.
Returns
"/"when the bag is rooted at the file root.
- property is_subpath: bool
Whether the filepath points inside an HDF5 file rather than at its root.
- libver_str: ClassVar[str] = 'latest'