Skip to content

Configuration

All configuration is centralized in a single Settings object, exposed as the euroflood.settings singleton. Every field is set by an EUROFLOOD_<FIELD> environment variable (or by mutating euroflood.settings at runtime).

import euroflood as ef

ef.settings.output_dir = "results/"     # runtime override
# equivalently:  export EUROFLOOD_OUTPUT_DIR=results/

The table below (from the field descriptions) documents every setting and its EUROFLOOD_* variable.

Settings

Bases: BaseSettings

Global application settings and configuration.

Every field is set by an EUROFLOOD_<FIELD> environment variable (e.g. EUROFLOOD_OUTPUT_DIR) or by mutating the settings singleton at runtime. See each field's description below (or help(euroflood.settings) / the Configuration reference) for what it does.

Note

See https://docs.pydantic.dev/latest/concepts/pydantic_settings/ for environment-variable precedence.

Methods:

Name Description
get_inventory_path

Return the full path to the inventory CSV file.

get_index_tif_path

Return the full path to the global index raster file.

get_dictionary_path

Return the full path to the flood event dictionary JSON file.

get_manifest_path

Return the full path to the cache manifest (version + grid fingerprint).

get_hazard_dir

Return the cache directory for GLOFAS hazard artefacts (index + tiles).

get_hazard_index_path

Return the path to the cached GLOFAS tile-extents GeoJSON.

get_hazard_tiles_dir

Return the cache directory for downloaded GLOFAS hazard tiles.

get_hazard_manifest_path

Return the path to the hazard reference manifest.

get_dictionary_parquet_path

Return the path to the single combo_id-sorted Parquet dictionary file.

get_dictionary_meta_path

Return the path to the small dictionary metadata JSON sidecar.

get_events_path

Return the path to the normalized per-event metadata Parquet table.

source_coop_base_url

Public HTTPS base URL of a published index version (immutable vX.Y.Z).

ensure_dirs

Create necessary directories if they don't exist.

Methods:

get_inventory_path

get_inventory_path() -> Path

Return the full path to the inventory CSV file.

Returns:

Name Type Description
Path Path

The absolute path to the inventory.csv file within the cache directory.

get_index_tif_path

get_index_tif_path() -> Path

Return the full path to the global index raster file.

Returns:

Name Type Description
Path Path

The absolute path to the index TIF file within the cache directory.

get_dictionary_path

get_dictionary_path() -> Path

Return the full path to the flood event dictionary JSON file.

Returns:

Name Type Description
Path Path

The absolute path to the dictionary JSON file within the cache directory.

get_manifest_path

get_manifest_path() -> Path

Return the full path to the cache manifest (version + grid fingerprint).

Returns:

Name Type Description
Path Path

The absolute path to the manifest JSON within the cache directory.

get_hazard_dir

get_hazard_dir() -> Path

Return the cache directory for GLOFAS hazard artefacts (index + tiles).

get_hazard_index_path

get_hazard_index_path() -> Path

Return the path to the cached GLOFAS tile-extents GeoJSON.

Honours hazard_index_path if set (skips the download), otherwise places it under get_hazard_dir.

get_hazard_tiles_dir

get_hazard_tiles_dir() -> Path

Return the cache directory for downloaded GLOFAS hazard tiles.

get_hazard_manifest_path

get_hazard_manifest_path() -> Path

Return the path to the hazard reference manifest.

get_dictionary_parquet_path

get_dictionary_parquet_path() -> Path

Return the path to the single combo_id-sorted Parquet dictionary file.

get_dictionary_meta_path

get_dictionary_meta_path() -> Path

Return the path to the small dictionary metadata JSON sidecar.

get_events_path

get_events_path() -> Path

Return the path to the normalized per-event metadata Parquet table.

source_coop_base_url

source_coop_base_url(version: str) -> str

Public HTTPS base URL of a published index version (immutable vX.Y.Z).

ensure_dirs

ensure_dirs() -> None

Create necessary directories if they don't exist.

This ensures that cache_dir and output_dir exist on the filesystem. Should be called before starting pipelines.

Raises:

Type Description
OSError

If directories cannot be created due to permission issues.