src.install module¶
Currently unused; intended as a standalone installer script for the package’s conda environments and supporting data.
- 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.
- class src.install.InstallCLIHandler(*args, **kwargs)[source]¶
Bases:
MDTFArgParser
- iter_actions()¶
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 wrapsparse_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:Argument values explictly given by the user on the command line, as recorded in the
is_default
attribute ofMDTFArgParser
.Argument values from a file the user gave via the
-f
flag. (CLIConfigManager.defaults[DefaultsFileTypes.USER]).Argument values specified as the default values in the argument parser, which in turn are set with the following precedence order:
Default values from a site-specfic file (defaults.jsonc), stored in CLIConfigManager.defaults[DefaultsFileTypes.SITE].
Default values from a defaults.jsonc file in the
/sites
directory, stored in CLIConfigManager.defaults[DefaultsFileTypes.GLOBAL].Default values hard-coded in the CLI definition file itself.
- Parameters:
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 parsessys.argv()
.namespace (optional) – An object to store the parsed arguments. The default is a new empty
argparse.Namespace
object.
- Returns:
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()
.