src.install module

Currently unused; intended as a standalone installer script for the package’s conda environments and supporting data.

src.install.shell_command_wrapper(cmd, **kwargs)[source]
src.install.fatal_exception_handler(exc, msg=None)[source]
src.install.find_conda(code_root, conda_config)[source]

Attempt to determine conda location on this system.

src.install.conda_env_create(envs, code_root, conda_config)[source]

Create a set of conda environments from yaml files.

src.install.ftp_download(ftp_config, ftp_data, install_config)[source]

Download files via anonymous FTP.

src.install.untar_data(ftp_data, install_config)[source]

Extract tar files of obs/model data and move contents to correct location.

src.install.set_cli_defaults(code_root, cli_config, install_config)[source]

Write install-time configuration options to the cli.jsonc file used to set run-time default values.

src.install.framework_test(code_root, output_dir, cli_config)[source]
src.install.framework_verify(code_root, run_output)[source]
class src.install.InstallCLIHandler(*args, **kwargs)[source]

Bases: src.cli.MDTFArgParser

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.


Iterator over Action objects associated with all user-defined arguments in parser, as well as those for any subcommands.

parse_args(args=None, namespace=None)

Subclassed implementation of parse_args() which wraps parse_known_args().

parse_known_args(args=None, namespace=None)

Wrapper for parse_known_args() which handles intermediate levels of default settings derived from the user’s settings files. These override defaults defined in the parser itself. The precedence order is:

  1. Argument values explictly given by the user on the command line, as recorded in the is_default attribute of MDTFArgParser.

  2. Argument values from a file the user gave via the -f flag. (CLIConfigManager.defaults[DefaultsFileTypes.USER]).

  3. Argument values specified as the default values in the argument parser, which in turn are set with the following precedence order:

    1. Default values from a site-specfic file (defaults.jsonc), stored in CLIConfigManager.defaults[DefaultsFileTypes.SITE].

    2. Default values from a defaults.jsonc file in the /sites directory, stored in CLIConfigManager.defaults[DefaultsFileTypes.GLOBAL].

    3. Default values hard-coded in the CLI definition file itself.

  • args (optional) – String or list of strings to parse. If a single string is passed, it’s split using split_args(). If not supplied, the default behavior parses sys.argv().

  • namespace (optional) – An object to store the parsed arguments. The default is a new empty argparse.Namespace object.


Tuple of 1) populated namespace containing parsed arguments and 2) unrecognized arguments, as with argparse.ArgumentParser.parse_known_args().

static split_args(argv)

Wrapper for shlex.split().

class src.install.MDTFInstaller(code_root, settings_file)[source]

Bases: object

__init__(code_root, settings_file)[source]

Initialize self. See help(type(self)) for accurate signature.

makedirs(path_keys, delete_existing)[source]