osl_dynamics.config_api.pipeline#

Functions for running full pipelines via the config API.

See the documentation here for example usage.

Module Contents#

Functions#

load_config(config)

Load config.

find_function(name[, extra_funcs])

Find a function to execute via the config API.

run_pipeline(config, output_dir[, data, extra_funcs])

Run a full pipeline.

run_pipeline_from_file(config_file, output_directory)

Run a pipeline from a config file.

osl_dynamics_cli()

Command line interface function for running a pipeline from a config

Attributes#

_logger

osl_dynamics.config_api.pipeline._logger[source]#
osl_dynamics.config_api.pipeline.load_config(config)[source]#

Load config.

Parameters:

config (str or dict) – Path to yaml file, str to convert to dict, or dict containing the config.

Returns:

config – Config for a full pipeline.

Return type:

dict

osl_dynamics.config_api.pipeline.find_function(name, extra_funcs=None)[source]#

Find a function to execute via the config API.

Parameters:
  • name (str) – Function name.

  • extra_funcs (list of functions, optional) – Custom functions passed by the user.

Returns:

func – Function to execute.

Return type:

function

osl_dynamics.config_api.pipeline.run_pipeline(config, output_dir, data=None, extra_funcs=None)[source]#

Run a full pipeline.

Parameters:
  • config (str or dict) – Path to yaml file, str to convert to dict, or dict containing the config.

  • output_dir (str) – Path to output directory.

  • data (osl_dynamics.data.Data, optional) – Data object.

  • extra_funcs (list of functions, optional) – User-defined functions referenced in the config.

osl_dynamics.config_api.pipeline.run_pipeline_from_file(config_file, output_directory, restrict=None)[source]#

Run a pipeline from a config file.

Parameters:
  • config_file (str) – Path to the config file.

  • output_directory (str) – Path to the output directory.

  • restrict (int or str, optional) – GPU to use. If a str is passed it will be cast to an int.

osl_dynamics.config_api.pipeline.osl_dynamics_cli()[source]#

Command line interface function for running a pipeline from a config file.