eradiate.config#

This module exposes components dedicated to the global configuration of Eradiate.

Core members#

eradiate.config.ENV = str#

Identifier of the environment in which Eradiate is used. Takes the value of the ERADIATE_ENV environment variable if it is set; otherwise defaults to "default".

eradiate.config.SOURCE_DIR = pathlib.Path or None#

Path to the Eradiate source code directory, if relevant. Takes the value of the ERADIATE_SOURCE_DIR environment variable if it is set; otherwise defaults to None.

eradiate.config.settings = dynaconf.Dynaconf#

Main settings data structure. It supports array and attribute indexing, both case-insensitive:

settings["some.key"]
settings["SOME.KEY"]
settings.some.key
settings.SOME.KEY

All settings have a default value specified by the default configuration file and can be overridden by the user from an eradiate.toml file, placed in the current working directory or higher. Each setting can also be overridden using environment variables with the ERADIATE_ prefix.

Example

The some.key setting will be accessed as ERADIATE_SOME__KEY (note the double underscore to figure the hierarchical separator).

Utility#

class eradiate.config.ProgressLevel(value)[source]#

An enumeration defining valid progress levels.

This is an integer enumeration, meaning that levels can be compared to numerics.

static convert(value)[source]#

Attempt conversion of a value to an ProgressLevel instance. The conversion protocol is as follows:

  • If value is a string, it is converted to upper case and passed to the indexing operator of ProgressLevel.

  • If value is an integer, it is passed to the call operator of ProgressLevel.

  • If value is a ProgressLevel instance, it is returned without change.

  • Otherwise, the method raises an exception.

Parameters:

value – Value to attempt conversion of.

Returns:

Converted value

Raises:

TypeError – If no conversion protocol exists for value.

KERNEL = 2#

Up to kernel level progress

NONE = 0#

No progress

SPECTRAL_LOOP = 1#

Up to spectral loop level progress