httomo.runner.dataset_store_interfaces.DataSetSink#

class httomo.runner.dataset_store_interfaces.DataSetSink(*args, **kwargs)[source]#

Methods

__init__(*args, **kwargs)

finalize()

Method intended to be called after writing all blocks is done, to give implementations a chance to write everything to disk and close the file, etc.

write_block(block)

Writes a block to the store, starting at the index in dataset.chunk_index, in the current slicing dimension.

Attributes

chunk_shape

Returns the shape of a chunk, i.e. the data processed in the current MPI process (whether it fits in memory or not).

global_index

Returns the start index of the chunk within the global data array

global_shape

Global data shape across all processes that we eventually have to write.

slicing_dim

Slicing dimension - 0, 1, or 2

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)

finalize()[source]#

Method intended to be called after writing all blocks is done, to give implementations a chance to write everything to disk and close the file, 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 write.

property slicing_dim: Literal[0, 1, 2]#

Slicing dimension - 0, 1, or 2

write_block(block: DataSetBlock)[source]#

Writes a block to the store, starting at the index in dataset.chunk_index, in the current slicing dimension.

NOTE: Implementers should make sure to move the dataset to CPU if required - it may be on GPU when this method is called.