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}

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}

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.nexus module

class anemoi.utils.settings_schema.nexus.NexusConfig(*, api_url: str | None = None, api_token: SecretStr | None = None, **extra_data: Any)

Bases: AnemoiBaseSettingsSchema

Configuration for access to the Anemoi Nexus.

api_url: str | None

API URL to nexus.

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

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

api_token: SecretStr | None

API token for authenticating with nexus.

anemoi.utils.settings_schema.object_storage module

Pydantic models for object storage configuration.

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

Bases: AnemoiBaseSettingsSchema

Object storage configuration for S3-compatible and Azure Blob services.

At the top level (ObjectStorageConfig) these fields act as global defaults. Under a named sub-section (e.g. [object-storage.”my-bucket”]) they act as per-bucket/account overrides.

endpoint_url: str | None

Endpoint URL. S3-compatible services, Azurite or sovereign clouds for Azure.

skip_signature: bool | None

Skip signature for public storage.

access_key_id: SecretStr | None

S3 bucket access key ID.

secret_access_key: SecretStr | None

S3 bucket secret access key.

region: str | None

S3 bucket region.

account_name: SecretStr | None

Azure Blob Storage account name.

account_key: SecretStr | None

Azure Blob Storage account key.

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

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

sas_token: SecretStr | None

Azure Blob Storage SAS token. May include or omit the leading ‘?’.

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

Get a configuration value with fallback to the global setting.

class anemoi.utils.settings_schema.object_storage.ObjectStorageConfig(*, endpoint_url: str | None = None, skip_signature: bool | None = False, access_key_id: SecretStr | None = None, secret_access_key: SecretStr | None = None, region: str | None = None, account_name: SecretStr | None = None, account_key: SecretStr | None = None, sas_token: SecretStr | None = None, type: Literal['s3', 'az'] | None = None, **extra_data: Any)

Bases: ObjectStorageBucketConfig

Top-level, global object storage configuration.

Inherits all backend fields from ObjectStorageBucketConfig used for per-bucket/account overrides under __pydantic_extra__ (named sub-sections, e.g. [object-storage.”my-bucket”]).

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

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

type: Literal['s3', 'az'] | None

//, `abfs://).

Type:

Deprecated

Type:

retained for backwards compatibility. Backends are dispatched by URL scheme (`s3

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}

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}

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}

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.