cli_options
Climate Data CLI Options
This module provides a set of CLI options for extracting climate data from the ERA5 and CMIP6 datasets. These options are used to specify the data to extract, such as the year, month, variable, and dataset. It also provides global variables representing the full space of valid values for these options.
resolve_run_mode_root(param_name: str, value: str, run_mode: str, *, aggregate: bool = False) -> str
Resolve a directory option to the run-mode root unless the user overrode it.
--run-mode selects the storage-root profile; an explicitly-passed
--<param> still wins (detected via click's parameter source).
Source code in src/climate_data/cli_options.py
with_agg_measure(*, allow_all: bool = False) -> Callable[[Callable[P, T]], Callable[P, T]]
Add aggregation measure option to a command.
Source code in src/climate_data/cli_options.py
with_agg_scenario(*, allow_all: bool = False) -> Callable[[Callable[P, T]], Callable[P, T]]
Add aggregation scenario option to a command.
Source code in src/climate_data/cli_options.py
with_agg_version() -> Callable[[Callable[P, T]], Callable[P, T]]
Add aggregation version option to a command.
with_block_key(*, allow_all: bool = False) -> Callable[[Callable[P, T]], Callable[P, T]]
Add block key option to a command.
Source code in src/climate_data/cli_options.py
with_concurrency_limit(*, default: int | None = None) -> Callable[[Callable[P, T]], Callable[P, T]]
Add the jobmon concurrency-limit option to a command.
Pass default to throttle a runner out of the box; leaving it unset means
the option defaults to None, which run_parallel_maybe_dry_run drops
so jobmon applies its own default (10000, effectively unthrottled).
Source code in src/climate_data/cli_options.py
with_debias_method() -> Callable[[Callable[P, T]], Callable[P, T]]
Add the option selecting the Jensen de-bias applied to a multiplicative anomaly.
Source code in src/climate_data/cli_options.py
with_dry_day_rule() -> Callable[[Callable[P, T]], Callable[P, T]]
Add the option selecting how days the driving model reports as dry are treated.
Source code in src/climate_data/cli_options.py
with_dry_run() -> Callable[[Callable[P, T]], Callable[P, T]]
Add dry-run flag to a command.
Source code in src/climate_data/cli_options.py
with_hierarchy(choices: Collection[str] = cdc.HIERARCHY_MAP, *, allow_all: bool = False, default: str | None = None) -> Callable[[Callable[P, T]], Callable[P, T]]
Add hierarchy option to a command.
Pass default to give the (single-value) option a default; this builds
the option directly since with_choice always supplies its own default.
Source code in src/climate_data/cli_options.py
with_location_id() -> Callable[[Callable[P, T]], Callable[P, T]]
Add location ID option to a command.
with_run_mode() -> Callable[[Callable[P, T]], Callable[P, T]]
Add the run-mode option selecting the storage-root profile.
Source code in src/climate_data/cli_options.py
with_year(years: Collection[str], *, allow_all: bool = False) -> Callable[[Callable[P, T]], Callable[P, T]]
Create a CLI option for selecting a year.