CHAP.runner
¶
File : runner.py
Author : Valentin Kuznetsov
Module Contents¶
Classes¶
Representation of Pipeline run configuration. |
Functions¶
Return an argument parser for the |
|
Main function. |
|
Main runner funtion. |
|
Helper function to set CHAP logger. |
|
Run a given pipeline_config. |
API¶
- class CHAP.runner.RunConfig(config={}, comm=None)¶
Representation of Pipeline run configuration.
Initialization
RunConfig constructor.
- Parameters:
config (dict, optional) – Pipeline configuration options, defaults to
{}
.comm (mpi4py.MPI.Comm, optional) – MPI communicator, defaults to
None
.
- opts¶
None
- CHAP.runner.parser()¶
Return an argument parser for the
CHAP
CLI. This parser has one argument: the input CHAP configuration file.
- CHAP.runner.main()¶
Main function.
- CHAP.runner.runner(run_config, pipeline_config, comm=None)¶
Main runner funtion.
- Parameters:
run_config (CHAP.runner.RunConfig) – CHAP run configuration.
pipeline_config (dict) – CHAP Pipeline configuration.
comm (mpi4py.MPI.Comm, optional) – MPI communicator, defaults to
None
.
- Returns:
The pipeline’s returned data field.
- CHAP.runner.setLogger(log_level='INFO')¶
Helper function to set CHAP logger.
- Parameters:
log_level (str) – Logger level, defaults to
"INFO"
.- Returns:
The CHAP logger and logging handler.
- Return type:
logging.Logger, logging.StreamHandler
- CHAP.runner.run(pipeline_config, inputdir=None, outputdir=None, interactive=False, logger=None, log_level=None, log_handler=None, comm=None)¶
Run a given pipeline_config.
- Parameters:
pipeline_config (dict) – CHAP Pipeline configuration.
inputdir (str, optional) – Input directory, defaults to
None'
.outputdir (str, optional) – Output directory, defaults to
None'
.interactive (bool, optional) – Allows for user interactions, defaults to
False
.logger (logging.Logger, optional) – CHAP logger, defaults to
None
.log_level (str, optional) – Logger level, defaults to
None
.log_handler (logging.StreamHandler, optional) – logging handler, defaults to
None
.comm (mpi4py.MPI.Comm, optional) – MPI communicator, defaults to
None
.
- Returns:
The
data
field of the first item in the returned list of pipeline items.