Global settings#

Some command-line options can set globally in a tango.yml or tango.yaml settings file. Tango will check the current directory and ~/.config/, in that order.

The full spec of this config is defined by the TangoGlobalSettings class.

class tango.settings.TangoGlobalSettings(workspace=None, executor=None, include_package=None, log_level=None, file_friendly_logging=None, multiprocessing_start_method='spawn', environment=None, _path=None)[source]#

Defines global settings for tango.

workspace: Optional[Dict[str, Any]] = None#

Parameters to initialize a Workspace with.

executor: Optional[Dict[str, Any]] = None#

Parameters to initialize an Executor with.

include_package: Optional[List[str]] = None#

An list of modules where custom registered steps or classes can be found.

log_level: Optional[str] = None#

The log level to use. Options are “debug”, “info”, “warning”, and “error”.

Note

This does not affect the cli_logger or logs from Tqdm progress bars.

file_friendly_logging: Optional[bool] = None#

If this flag is set to True, we add newlines to tqdm output, even on an interactive terminal, and we slow down tqdm’s output to only once every 10 seconds.

multiprocessing_start_method: str = 'spawn'#

The start_method to use when starting new multiprocessing workers. Can be “fork”, “spawn”, or “forkserver”. Default is “spawn”.

See multiprocessing.set_start_method() for more details.

environment: Optional[Dict[str, str]] = None#

Environment variables that will be set each time tango is run.

classmethod default()[source]#

Initialize the config from files by checking the default locations in order, or just return the default if none of the files can be found.

Return type:

TangoGlobalSettings

classmethod from_file(path)[source]#

Read settings from a file.

Return type:

TangoGlobalSettings

to_file(path)[source]#

Save the settings to a file.

Return type:

None

save()[source]#

Save the settings to the file it was read from.

Raises:

ValueError – If the settings was not read from a file.

Return type:

None