anemoi.utils.commands package

This module initializes and registers command-line interface (CLI) commands for the Anemoi utilities.

class anemoi.utils.commands.Command

Bases: object

Base class for commands.

accept_unknown_args = False
check(parser: ArgumentParser, args: Namespace) None

Check the command arguments.

run(args: Namespace) None

Run the command.

Parameters:

args (argparse.Namespace) – The arguments for the command

Submodules

anemoi.utils.commands.config module

class anemoi.utils.commands.config.Config

Bases: Command

Handle configuration related commands.

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

Execute the command with the provided arguments.

Parameters:

args (Namespace) – The arguments passed to the command.

anemoi.utils.commands.config.command

alias of Config

anemoi.utils.commands.metadata module

class anemoi.utils.commands.metadata.Metadata

Bases: Command

Edit, remove, dump or load metadata from a checkpoint file.

add_arguments(command_parser: ArgumentParser) None

Add command line arguments to the parser.

Parameters:

command_parser (ArgumentParser) – The argument parser to which the arguments will be added.

run(args: Namespace) None

Execute the command based on the provided arguments.

Parameters:

args (Namespace) – The arguments passed to the command.

edit(args: Namespace) None

Edit the metadata in place using the specified editor.

Parameters:

args (Namespace) – The arguments passed to the command.

view(args: Namespace) None

View the metadata in place using the specified pager.

Parameters:

args (Namespace) – The arguments passed to the command.

remove(args: Namespace) None

Remove the metadata from the checkpoint.

Parameters:

args (Namespace) – The arguments passed to the command.

dump(args: Namespace) None

Dump the metadata from the checkpoint to a file or standard output.

Parameters:

args (Namespace) – The arguments passed to the command.

get(args: Namespace) None

Navigate and print the metadata via a dot-separated path.

Parameters:

args (Namespace) – The arguments passed to the command.

load(args: Namespace) None

Load metadata into the checkpoint from a specified file.

Parameters:

args (Namespace) – The arguments passed to the command.

supporting_arrays(args: Namespace) None

Print the supporting arrays from the metadata.

Parameters:

args (Namespace) – The arguments passed to the command.

anemoi.utils.commands.metadata.command

alias of Metadata

anemoi.utils.commands.requests module

class anemoi.utils.commands.requests.Requests

Bases: Command

Convert a JSON requests file to MARS format.

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

Execute the command with the provided arguments.

Parameters:

args (Namespace) – The arguments passed to the command.

anemoi.utils.commands.requests.command

alias of Requests

anemoi.utils.commands.transfer module

class anemoi.utils.commands.transfer.Transfer

Bases: Command

Transfer files or folders from the source to the target location.

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

Execute the command with the provided arguments.

Parameters:

args (Namespace) – The arguments passed to the command.

anemoi.utils.commands.transfer.command

alias of Transfer