commands
couple
- class anemoi.inference.commands.couple.CoupleCmd
Bases:
CommandCouple tasks based on a configuration file.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
inspect
- class anemoi.inference.commands.inspect.InspectCmd
Bases:
CommandInspect the contents of a checkpoint file.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
- run(args: Namespace) None
Run the inspect command.
- Parameters:
args (Namespace) – The arguments passed to the command.
- variables(metadata: Metadata, args: Namespace) None
Print the variable categories in the checkpoint.
- datasets(metadata: Metadata, args: Namespace) None
Print the dataset arguments and keyword arguments for opening datasets.
- requirements(checkpoint: Checkpoint, args: Namespace) None
Print the requirements for the checkpoint, including PyPI and Git dependencies.
- anemoi.inference.commands.inspect.command
alias of
InspectCmd
metadata
patch
- anemoi.inference.commands.patch.diff(old, new, *path)
- class anemoi.inference.commands.patch.PatchCmd
Bases:
CommandPatch a checkpoint file with new dataset metadata from the original training dataset. If the checkpoint’s metadata is already up to date, this command does nothing. Otherwise, it updates the metadata and supporting arrays in-place.
- add_arguments(command_parser: ArgumentParser) None
requests
- class anemoi.inference.commands.requests.RequestCmd
Bases:
CommandMARS request utility.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
- anemoi.inference.commands.requests.command
alias of
RequestCmd
retrieve
- anemoi.inference.commands.retrieve.print_request(verb, request, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)
- anemoi.inference.commands.retrieve.checkpoint_to_requests(checkpoint: Checkpoint, *, dataset_name: str, date: str | datetime | int, staging_dates: str | None = None, forecast_dates: bool = False, use_grib_paramid: bool = False, dont_fail_for_missing_paramid: bool = False, extra: list[str] | None = None, patch_request: Callable[[dict[str, Any]], dict[str, Any]] | None = None, use_scda: bool = False, include: list[str] | None = None, exclude: list[str] | None = None, lead_time: Any | None = None, time_step: Any | None = None) list[dict[str, Any]]
Convert a checkpoint to a list of data requests.
- Parameters:
checkpoint (Checkpoint) – The checkpoint object containing the necessary data.
dataset_name (str) – The name of the dataset to prepare requests for (used for multi-dataset checkpoints).
date (Date) – The date for the data request.
staging_dates (str, optional) – Path to a file with staging dates.
forecast_dates (bool, optional) – Whether to use forecast dates (for forcings).
use_grib_paramid (bool, optional) – Whether to use GRIB parameter IDs.
dont_fail_for_missing_paramid (bool, optional) – Whether to ignore missing parameter IDs.
patch_request (Callable[[DataRequest], DataRequest], optional) – Function to patch the data request.
use_scda (bool, optional) – Whether to use SCDA stream for 6/18 input time.
include (Optional[List[str]]) – Categories to include.
exclude (Optional[List[str]]) – Categories to exclude.
lead_time (Optional[Any]) – The lead time for the data request (used with forecast_dates).
time_step (Optional[Any]) – The time step for the data request (used with forecast_dates).
- Returns:
A list of data requests.
- Return type:
List[DataRequest]
- anemoi.inference.commands.retrieve.comma_separated_list(value)
- class anemoi.inference.commands.retrieve.RetrieveCmd
Bases:
CommandUsed by prepml.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
- anemoi.inference.commands.retrieve.command
alias of
RetrieveCmd
run
- class anemoi.inference.commands.run.RunCmd
Bases:
CommandRun inference from a config yaml file.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
sanitise
- class anemoi.inference.commands.sanitise.SanitiseCmd
Bases:
CommandSanitise a checkpoint file.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
- anemoi.inference.commands.sanitise.command
alias of
SanitiseCmd
validate
- class anemoi.inference.commands.validate.ValidateCmd
Bases:
CommandValidate the virtual environment against a checkpoint file.
- add_arguments(command_parser: ArgumentParser) None
Add arguments to the command parser.
- Parameters:
command_parser (ArgumentParser) – The argument parser to which the arguments will be added.
- anemoi.inference.commands.validate.command
alias of
ValidateCmd