rubem.configuration.app_settings.AppSettings

class AppSettings(**data)[source]

Bases: BaseModel

The application settings.

Parameters:
  • value_ranges – Admissible ranges of the input rasters and the model variables.

  • i18n – Language settings.

  • logging – A logging.config.dictConfig dictionary; empty for the default setup. Read-only on the instance; get_setting() and model_dump() hand out plain copies.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

default

The settings of default_file(), read once per file.

default_file

The settings file selected by PYTHON_ENVIRONMENT, or the packaged one.

get_setting

Return a top-level setting as plain data, or None when absent.

load

Load the settings from a JSON file.

Attributes

value_ranges

i18n

logging

classmethod default()[source]

The settings of default_file(), read once per file.

Return type:

AppSettings

classmethod default_file()[source]

The settings file selected by PYTHON_ENVIRONMENT, or the packaged one.

Return type:

Path

get_setting(key)[source]

Return a top-level setting as plain data, or None when absent.

Kept for callers written against the previous dictionary-based settings.

Return type:

Any

classmethod load(settings_file)[source]

Load the settings from a JSON file.

Raises:

FileNotFoundError – If the file does not exist.

Return type:

AppSettings

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].