Optional files
configuration system¶
The impactlab_tools
repository contains a general system for passing
configuration information to scripts, and this is used by a few of the
existing repositories. New repositories are welcome to use it, if
they choose. The features of the system are:
Individual jobs are run with configuration dictionaries, which specify the mode or targets of their work.
These configuration options are usually specified on the command-line, and can be read from
.yml
files, from individual configuration arguments on the command line, or both.Optionally, an additional “server configuration” file specifies a shared data directory on the job server, allowing files there to be accessed more easily.
Job configurations¶
The configuration options for individual jobs are usually specified on
the command-line, and accessed through the
files.get_allargv_config()
function. The
files.get_allargv_config()
function builds a single configuration
dictionary from arguments according to the following rules:
FILE.yml
: a full configuration YaML file, merged into the result dictionary
--config=FILE.yml
: a full configuration YaML file, as above
--KEY=VALUE
: a single configuration value to be setanything else: sets an entry in the config file for that anything to have a value of True
Alternatively, files.get_file_config(filepath)
can be used to just
read in a .yml
configuration file.