torchdms.cli

Command line interface.

Functions

default_map_of_ctx_or_parent

Get the default_map from this context or the parent context.

dry_run_option

json_provider

Enable loading of flags from a JSON file via click_config_file.

print_method_name_and_locals

Print method name and local variables.

restrict_dict_to_params

Restrict the given dictionary to the names of parameters for cmd.

seed_option

set_random_seed

torchdms.cli.json_provider(file_path, cmd_name)[source]

Enable loading of flags from a JSON file via click_config_file.

torchdms.cli.print_method_name_and_locals(method_name, local_variables)[source]

Print method name and local variables.

torchdms.cli.default_map_of_ctx_or_parent(ctx)[source]

Get the default_map from this context or the parent context.

In our application, the default_map is parsed from the JSON configuration file. The parent context can be useful if we are invoked from another subcommand.

torchdms.cli.restrict_dict_to_params(d_to_restrict, cmd)[source]

Restrict the given dictionary to the names of parameters for cmd.