bag.simulation.hdf5

Module Contents

Functions

_set_chunk_args(→ None)

save_sim_data_hdf5(→ None)

Saves the given MDArray as a HDF5 file.

load_sim_data_hdf5(→ bag.simulation.data.SimData)

Read simulation results from HDF5 file.

Attributes

BLOSC_FILTER

MB_SIZE

bag.simulation.hdf5.BLOSC_FILTER[source]
bag.simulation.hdf5.MB_SIZE[source]
bag.simulation.hdf5._set_chunk_args(kwargs: Dict[str, Any], chunk_size_mb: int, shape: Tuple[int, Ellipsis], unit_size: int) None[source]
bag.simulation.hdf5.save_sim_data_hdf5(data: bag.simulation.data.SimData, hdf5_path: pathlib.Path, compress: bool = True, chunk_size_mb: int = 2, cache_size_mb: int = 20, cache_modulus: int = 2341) None[source]

Saves the given MDArray as a HDF5 file.

The simulation environments are stored as fixed length byte strings, and the sweep parameters are stored as dimension label for each data.

Parameters:
  • data (SimData) – the data.

  • hdf5_path (Path) – the hdf5 file path.

  • compress (str) – HDF5 compression method. Defaults to ‘lzf’ for speed (use ‘gzip’ for space).

  • chunk_size_mb (int) – HDF5 data chunk size, in megabytes. 0 to disable.

  • cache_size_mb (int) – HDF5 file chunk cache size, in megabytes.

  • cache_modulus (int) – HDF5 file chunk cache modulus.

bag.simulation.hdf5.load_sim_data_hdf5(path: pathlib.Path, cache_size_mb: int = 20, cache_modulus: int = 2341) bag.simulation.data.SimData[source]

Read simulation results from HDF5 file.

Parameters:
  • path (Path) – the file to read.

  • cache_size_mb (int) – HDF5 file chunk cache size, in megabytes.

  • cache_modulus (int) – HDF5 file chunk cache modulus.

Returns:

results – the data.

Return type:

SimData