chariots.runners¶
runners are used to execute Pipelines: they define in what order and how each node of the pipeline should be executed.
For the moment Chariots only provides a basic sequential runner that executes each operation of a pipeline one after the other in a single threat however we have plans to introduce new runners (process and thread based ones as well as some cluster computing one) in future releases.
You can use runners directly if you want to execute your pipeline manually:
>>> runner = SequentialRunner()
>>> runner.run(is_odd_pipeline, 5)
True
or you can set the default runner of your app and it will be used every time a pipeline execution is called:
>>> my_app = Chariots(app_pipelines=[is_odd_pipeline], runner=SequentialRunner(), path=app_path,
... import_name="my_app")
-
class
chariots.runners.
SequentialRunner
[source]¶ Bases:
chariots.base._base_runner.BaseRunner
runner that executes every node in a pipeline sequentially in a single thread.
-
run
(pipeline: chariots._pipeline.Pipeline, pipeline_input: Optional[Any] = None)[source]¶ runs a pipeline, provides it with the correct input and extracts the results if any
- Parameters
pipeline – the pipeline to run
pipeline_input – the input to be given to the pipeline
- Returns
the output of the graph called on the input if applicable
-