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
run
method, 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 thearray
parameter. Thus, the pipeline is executedn
times, wheren
is the size of thearray
vector. For each execution, the pipeline creates an storage output with identifierkey
whose value is the element of the vector that can be accessed viaPipelineStage.get_output
.- Parameters:
- key
str
The identifier for an element of
array
that 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 usingvalidate
method. IfFalse
, the validation will be skiped, by default True
- key
See also
astromodule.pipeline.Pipeline.run
astromodule.pipeline.Pipeline.validate
astromodule.pipeline.PipelineStage.get_output
References