httomo.runner.methods_repository_interface.MethodQuery#

class httomo.runner.methods_repository_interface.MethodQuery(*args, **kwargs)[source]#

An interface to query information about a single method. It is used by the backend wrapper classes to determine required information.

Note: Implementers might get the information from different places, such as YAML files, decorators, etc, and it might also be hardcoded for specific ones.

Methods

__init__(*args, **kwargs)

calculate_memory_bytes(non_slice_dims_shape, ...)

Calculate the memory required in bytes, returning bytes method and subtract bytes tuple

calculate_output_dims(non_slice_dims_shape, ...)

Calculate size of the non-slice dimensions for this method

calculate_padding(**kwargs)

Calculate how much padding is needed for the method, before and after the core, in number of slices

get_implementation()

Check for implementation of the method

get_memory_gpu_params()

Get the parameters for the GPU memory estimation

get_output_dims_change()

Check if output dimensions change

get_pattern()

Return the pattern of the method

padding()

Check if the method requires padding (i.e. is 3D and requires overlap regions in slicing dimension).

save_result_default()

Check if this method saves results by default

swap_dims_on_output()

Check if the output 3D array needs to wap axis 0 and 1 to match httomolib.

calculate_memory_bytes(non_slice_dims_shape: Tuple[int, int], dtype: dtype, **kwargs) Tuple[int, int][source]#

Calculate the memory required in bytes, returning bytes method and subtract bytes tuple

calculate_output_dims(non_slice_dims_shape: Tuple[int, int], **kwargs) Tuple[int, int][source]#

Calculate size of the non-slice dimensions for this method

calculate_padding(**kwargs) Tuple[int, int][source]#

Calculate how much padding is needed for the method, before and after the core, in number of slices

get_implementation() Literal['cpu', 'gpu', 'gpu_cupy'][source]#

Check for implementation of the method

get_memory_gpu_params() GpuMemoryRequirement | None[source]#

Get the parameters for the GPU memory estimation

get_output_dims_change() bool[source]#

Check if output dimensions change

get_pattern() Pattern[source]#

Return the pattern of the method

padding() bool[source]#

Check if the method requires padding (i.e. is 3D and requires overlap regions in slicing dimension)

save_result_default() bool[source]#

Check if this method saves results by default

swap_dims_on_output() bool[source]#

Check if the output 3D array needs to wap axis 0 and 1 to match httomolib. (This is typically true for tomopy recon methods)