httomo.method_wrappers.make_method_wrapper#
- httomo.method_wrappers.make_method_wrapper(method_repository: MethodRepository, module_path: str, method_name: str, comm: mpi4py.MPI.Comm, preview_config: PreviewConfig, save_result: bool | None = None, output_mapping: Dict[str, str] = {}, **kwargs) MethodWrapper [source]#
Factory function to generate the appropriate wrapper based on the module path and method name. Clients do not need to be concerned about which particular derived class is returned.
- Parameters:
method_repository (MethodRepository) – Repository of methods that we can use the query properties
module_path (str) – Path to the module where the method is in python notation, e.g. “httomolibgpu.prep.normalize”
method_name (str) – Name of the method (function within the given module)
preview_config (PreviewConfig) – Config for preview value from loader
comm (Comm) – MPI communicator object
save_result (Optional[bool]) – Should the method’s result be saved to an intermediate h5 file? If not given (or None), it queries the method database for the default value.
output_mapping (Dict[str, str]) – A dictionary mapping output names to translated ones. The side outputs will be renamed as specified, if the parameter is given. If not, no side outputs will be passed on.
kwargs – Arbitrary keyword arguments that get passed to the method as parameters.
- Returns:
An instance of a wrapper class
- Return type: