astromodule.pipeline.Pipeline.map_run#
- Pipeline.map_run(key: str, array: Sequence[Any], workers: int = 2, validate: bool = True)[source]#
Validates and executes all pipeline steps in a similar way to the
runmethod, but using multiprocessing. This method has a similar implementation to MapReduce [1], in which a function is applied to all elements of a vector. In this case, the function is the pipeline itself and the vector is specified by thearrayparameter. Thus, the pipeline is executedntimes, wherenis the size of thearrayvector. For each execution, the pipeline creates an storage output with identifierkeywhose value is the element of the vector that can be accessed viaPipelineStage.get_output.- Parameters:
- key
str The identifier for an element of
arraythat can be accessed by a pipeline stage usingPipelineStage.get_output.- array
Sequence[Any] The data that will be mapped to pipeline
- workers
int, optional The number of parallel proccesses that will be spawned, by default 2
- validatebool, optional
If
True, a pipeline requirements validation will be performed usingvalidatemethod. IfFalse, the validation will be skiped, by default True
- key
See also
astromodule.pipeline.Pipeline.runastromodule.pipeline.Pipeline.validateastromodule.pipeline.PipelineStage.get_output
References