Configuration

Eradiate’s configuration uses hierarchical settings. The settings configure various parts of the behaviour of the library, ranging from data handling to interpolation error handling. All settings have default values that can be customized by users in several ways, with descending priority:

  1. Environment variables.

  2. An eradiate.toml or eradiate.yml file placed in the current working directory or higher.

Warning

Although it is permitted, modifying the configuration at runtime is discouraged. Settings are assumed immutable during a session and changing them might result in untested behaviour.

In addition to settings, Eradiate has a few environment configuration items that can only be set using environment variables:

ERADIATE_SOURCE_DIR

If set, this configuration item points to the directory where the local copy of the source code is cloned. In that case, Eradiate runs in development mode.

See also

The full configuration reference is available in the eradiate.config reference documentation.

Example configuration file

The following example file lists all of Eradiate’s configuration variables. Note that the values used here do not necessarily correspond to the defaults.

## This is an example of configuration file for Eradiate.
## All settings below can be set using environment variables with the
## `ERADIATE_` prefix (e.g. the `progress` setting can be set with the
## `ERADIATE_PROGRESS` variable).
##
## The configuration module will look for a file named `eradiate.toml`
## in the current working directory, then walk up the file system until it finds
## one.

## -----------------------------------------------------------------------------
##                           CONFIGURATION STARTS HERE
## -----------------------------------------------------------------------------

## Default azimuth convention
## (see https://eradiate.readthedocs.io/en/stable/rst/user_guide/conventions.html#azimuth-definition-conventions)
azimuth_convention = "east_right"

## Progress information display
## (from least to most verbose: none, spectral_loop or kernel)
progress = "spectral_loop"

## Offline mode switch: if true, data download attempts will be suppressed
offline = false

## Seed for the RNG seeding sequence
## By default (if this parameter is unset), the seed sequence is seeded with a
## default value. This ensures the reproducibility of results. A user-defined
## value can be used, and it is also possible to randomize the seed.
## Valid values: int or "random"
rng_seed = 42

## List of paths to always prepend to the file resolver (will be searched first)
## If you use the corresponding environment variable, use ":" as a separator
## E.g. ERADIATE_PATH="/some/path:/some/other/path"
path = []

## Absolute path to downloaded data folder. The default is ~/.cache/eradiate/
data_path = "~/Downloads/eradiate/"

## Path to data registry URL
data_url = "https://eradiate-data-registry.s3.eu-west-3.amazonaws.com/registry-v1/"

[absorption_database.error_handling]
# This section defines the default error handling configuration applied to
# absorption databases instantiated from the factory. This does *not* apply to
# AxsDB globally: users creating databases manually should get this default
# configuration using eradiate.radprops.absorption.get_default_error_handling_config()
# or expect AxsDB to apply its global defaults.
#
# Each coordinate in the absorption database is associated an error handling
# policy. For each issue (missing coordinate [missing], missing dimension
# [scalar] or out-of-bounds query [bounds]), the error is handled either raising
# an exception [raise], emitting a warning [warn] or silently ignoring the issue
# [ignore].
# This configuration ignores bound errors on pressure and temperature variables
# because this usually occurs at high altitude, where the absorption coefficient
# is very low and can be safely forced to 0.
p = { missing = "raise", scalar = "raise", bounds = "ignore" }
t = { missing = "raise", scalar = "raise", bounds = "ignore" }
# Ignore missing molecule coordinates, raise on bound error.
x = { missing = "ignore", scalar = "ignore", bounds = "raise" }