config

Module for configuration settings.

config.check_environment() None[source]

Check environment variables for default key settings

Returns:

None

config.custom_serializer(obj)[source]

Custom JSON serializer for ConfigKey objects.

Parameters:

obj – Object to serialize.

Returns:

JSON-serializable representation of the object.

config.dump() None[source]

Dump the current configuration to the tmp directory or stdout.

Returns:

None

config.get_key(name: str) ConfigKey[source]

Get a config key by name

config.load(args: dict | None = None) None[source]

Load the specified configuration files. Missing keys will be filled in with the defaults in DEFAULT_CONFIG.

Parameters:

args – List of configuration files.

Returns:

None

config.override(args: dict, arg: str, option: ConfigKey, name: str | None = None) str | None[source]

Override a configuration option with a new value.

Parameters:
  • args – Dictionary of command-line arguments.

  • arg – Name of the command-line argument.

  • option – Configuration option to override.

  • name – Optional name for logging purposes.

Returns:

Resulting value of the configuration option.

config.resume(job_dir: str, args: dict) None[source]

Reload the configuration for an existing job

Parameters:
  • job_dir – Directory of the existing job.

  • args – Command-line arguments to override configuration settings.

Returns:

None

config.set_cmd_opts(args: dict) None[source]

Override configuration settings with command-line arguments.

Parameters:

args – Dictionary of command-line arguments.

Returns:

None

config.set_error_handling() None[source]

Apply default error handling settings to any errors set to ‘default’ in the configuration.

config.set_host() None[source]

Set the host name in the configuration.

Returns:

None

config.update(file_name: str) None[source]

Update the global configuration with values from the provided dictionary.

Parameters:

file_name – Name of the configuration file.

Returns:

None

config.uuid(skip: int | None = None, limit: int | None = None, chunk: list | None = None) str[source]

Generate a unique identifier based on the job tag and timestamp.

Parameters:
  • skip – Number of initial entries to skip.

  • limit – Maximum number of entries to process.

  • chunk – Optional chunk id list to include in the UUID.

Returns:

Unique identifier string.