anemoi.utils.settings_schema package

Submodules

anemoi.utils.settings_schema.base module

class anemoi.utils.settings_schema.base.AnemoiBaseSettingsSchema(**extra_data: Any)

Bases: BaseModel

Base schema for Anemoi settings.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

anemoi.utils.settings_schema.datasets module

class anemoi.utils.settings_schema.datasets.DatasetsNamedConfig(**extra_data: Any)

Bases: BaseModel

Named dataset mappings (friendly name -> full path/URL).

model_config = {'extra': 'allow'}

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

class anemoi.utils.settings_schema.datasets.DatasetsConfig(*, path: list[str] = <factory>, use_search_path_not_found: bool = False, ignore_naming_conventions: bool = False, named: DatasetsNamedConfig = <factory>, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Configuration for dataset discovery and validation.

Used by anemoi-datasets for search paths, naming convention checks, and named dataset aliases.

path: list[str]

list of directories or S3 prefixes for .zarr dataset lookup.

Type:

Search paths

use_search_path_not_found: bool

When true, if a .zarr path does not exist, strip to basename and search the paths above instead of failing immediately.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

ignore_naming_conventions: bool

When true, skip all dataset naming-convention validation during creation.

named: DatasetsNamedConfig

Map of friendly dataset names to full paths or URLs.

anemoi.utils.settings_schema.object_storage module

class anemoi.utils.settings_schema.object_storage.ObjectStorageBucketConfig(*, endpoint_url: str | None = None, access_key_id: SecretStr | None = None, secret_access_key: SecretStr | None = None, region: str | None = None, skip_signature: bool | None = False, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Per-bucket overrides for object storage configuration.

endpoint_url: str | None

Bucket-specific endpoint URL.

access_key_id: SecretStr | None

Bucket-specific access key ID.

secret_access_key: SecretStr | None

Bucket-specific secret access key.

region: str | None

Bucket-specific region.

skip_signature: bool | None

Skip signature for public buckets.

get(key: str, default: str | None = None) str | None

Get a configuration value with fallback to the global setting.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

class anemoi.utils.settings_schema.object_storage.ObjectStorageConfig(*, type: str = 's3', endpoint_url: str | None = None, access_key_id: SecretStr | None = None, secret_access_key: SecretStr | None = None, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Object storage configuration for S3-compatible services.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

type: str

Default storage type (only ‘s3’ is currently supported).

endpoint_url: str | None

Global endpoint URL (leave empty for default AWS endpoint).

access_key_id: SecretStr | None

Global access key ID.

secret_access_key: SecretStr | None

Global secret access key.

get(key: str, default: str | None = None) str | None

Get a configuration value with fallback to the global setting.

anemoi.utils.settings_schema.paramdb module

class anemoi.utils.settings_schema.paramdb.ParamDBConfig(*, default_origin: str = 'ecmf', cache_length: int = 30, local_cache: Annotated[Path, PathType(path_type=file)] | None = None, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Configuration for the GRIB parameter database lookups.

Used by anemoi.utils.grib to control how GRIB parameter metadata is resolved (online API vs local cache, default origin for disambiguation, and cache lifetime).

default_origin: str

Default origin to use when disambiguating parameters with the same shortname.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

cache_length: int

Cache length in days for GRIB parameter lookups.

local_cache: Annotated[Path, PathType(path_type=file)] | None

Path to a local JSON cache file for GRIB parameters. If set, used instead of the online API.

anemoi.utils.settings_schema.registry module

class anemoi.utils.settings_schema.registry.RegistryConfig(*, api_url: str | None = None, api_token: SecretStr | None = None, allow_delete: bool = False, plots_uri_pattern: str | None = None, datasets_uri_pattern: str | None = None, weights_uri_pattern: str | None = None, weights_platform: str | None = None, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Configuration for access to the Anemoi registry.

api_url: str | None

API URL for the registry.

api_token: SecretStr | None

API token for authenticating with the registry.

allow_delete: bool

Allow deletion operations in the registry.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

plots_uri_pattern: str | None

URI pattern for plots storage.

datasets_uri_pattern: str | None

URI pattern for datasets storage.

weights_uri_pattern: str | None

URI pattern for weights storage.

weights_platform: str | None

Platform identifier for weights.

anemoi.utils.settings_schema.utils module

class anemoi.utils.settings_schema.utils.UtilsConfig(*, grids_path: Path | None = None, cache_directory: Path = PosixPath('/home/docs/.cache/anemoi'), debug_imports_in_cli: bool = False, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Miscellaneous anemoi-utils settings.

Used by anemoi.utils.grids for custom grid file paths.

grids_path: Path | None

Custom path to a directory containing precomputed grid files (grid-<name>.npz).

When set, grids are loaded from this directory before falling back to the built-in remote source. Supports ~ expansion.

model_config = {'alias_generator': <function AnemoiBaseSettingsSchema.<lambda>>, 'extra': 'allow', 'populate_by_name': True, 'serialize_by_alias': True, 'validate_by_alias': True, 'validate_by_name': True}

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

cache_directory: Path

Custom path to a directory for caching downloaded files (e.g. grid files or grib param).

debug_imports_in_cli: bool

Whether to print debug information about imports in the CLI.