httomo.data.dataset_store.DataSetStoreReader#
- class httomo.data.dataset_store.DataSetStoreReader(source: DataSetStoreWriter, slicing_dim: Literal[0, 1, 2] | None = None, padding: Tuple[int, int] | None = None)[source]#
Class to read from a store that has previously been written by DataSetStoreWriter, in a block-wise fashion.
Methods
__init__
(source[, slicing_dim, padding])finalize
()Method intended to be called after reading all blocks is done, to give implementations a chance to close files, free memory, etc.
read_block
(start, length)Reads a block from the dataset, starting at start of length length, in the current slicing dimension.
Attributes
Auxiliary data
Returns the shape of a chunk, i.e. the data processed in the current MPI process (whether it fits in memory or not).
Returns the start index of the chunk within the global data array
Global data shape across all processes that we eventually have to read.
Slicing dimension - 0, 1, or 2
- property aux_data: AuxiliaryData#
Auxiliary data
- property chunk_shape: Tuple[int, int, int]#
Returns the shape of a chunk, i.e. the data processed in the current MPI process (whether it fits in memory or not)
- property dtype: dtype#
- property filename: Path | None#
- finalize()[source]#
Method intended to be called after reading all blocks is done, to give implementations a chance to close files, free memory, etc.
- property global_index: Tuple[int, int, int]#
Returns the start index of the chunk within the global data array
- property global_shape: Tuple[int, int, int]#
Global data shape across all processes that we eventually have to read.
- property is_file_based: bool#
- read_block(start: int, length: int) DataSetBlock [source]#
Reads a block from the dataset, starting at start of length length, in the current slicing dimension. Note that start is chunk-based, i.e. mean different things in different processes.
- property slicing_dim: Literal[0, 1, 2]#
Slicing dimension - 0, 1, or 2