bagofholding.h5.bag module
- class bagofholding.h5.bag.H5Bag(filepath: str | Path, *args: object, **kwargs: Any)[source]
Bases:
Bag,HasH5FileContext,ArrayPackerA bag using HDF5 files based on h5py.
The underlying file structure is directly representative of the structure of the decomposed object being stored, and attrs are used to store metadata.
saveaccepts alibveroption (defaultmax_libver) controlling the HDF5 file-format version written, which is also stored in the bag info. Only codes up tomax_libverare accepted;"latest"is not.- get_bespoke_content_class(obj: object) type[BespokeItem[Any, Self]] | None[source]
- load(path: str = 'object', version_validator: Literal['exact', 'semantic-patch', 'semantic-minor', 'semantic-major', 'none'] | Callable[[str, str], bool] = 'exact', version_scraping: dict[str, Callable[[str], str | None]] | None = None) Any[source]
- pack_array(obj: ndarray[tuple[int, ...], dtype[int8] | dtype[int16] | dtype[int32] | dtype[int64] | dtype[uint8] | dtype[uint16] | dtype[uint32] | dtype[uint64] | dtype[float16] | dtype[float32] | dtype[float64] | dtype[complex64] | dtype[complex128] | dtype[bool] | dtype[bytes_] | dtype[str_]], path: str) None[source]
- unpack_array(path: str) ndarray[tuple[int, ...], dtype[int8] | dtype[int16] | dtype[int32] | dtype[int64] | dtype[uint8] | dtype[uint16] | dtype[uint32] | dtype[uint64] | dtype[float16] | dtype[float32] | dtype[float64] | dtype[complex64] | dtype[complex128] | dtype[bool] | dtype[bytes_] | dtype[str_]][source]