httomo.method_wrappers.stats_calc.StatsCalcWrapper#
- class httomo.method_wrappers.stats_calc.StatsCalcWrapper(method_repository: MethodRepository, module_path: str, method_name: str, comm: mpi4py.MPI.Comm, save_result: bool | None = None, output_mapping: Dict[str, str] = {}, **kwargs)[source]#
This class calculates global statistics and deliver a side_output. It also forces to return the original dataset to be passed to the next method.
Note that the side output is only set once the last block in the chunk has been processed.
Methods
__init__
(method_repository, module_path, ...)Constructs a MethodWrapper for a method located in module_path with the name method_name.
should_select_this_class
(module_path, ...)Method to dermine if this class should be used for wrapper instantiation, given the module path and method name.
Attributes
task_id
pattern
- classmethod should_select_this_class(module_path: str, method_name: str) bool [source]#
Method to dermine if this class should be used for wrapper instantiation, given the module path and method name.
The make_method_wrapper function will iterate through all subclasses and evaluate this condition in the order of declaration, falling back to GenericMethodWrapper if all evaluate to False.
Therefore, deriving classes should override this method to indicate the criteria when they should be instantiated.