esm_tools package¶
ESM Tools (Package Documentation)¶
This package contains almost no code, but instead is where most of the YAML configurations files are distributed. Default namelists are included as well as example runscripts. This section only documents the code contained in the module, please refer to the handbook for user documentation as well as API documentation for the various sub-modules of the project.
Accessing Configuration¶
To access a particular configuration, you can use:
>>> from esm_tools import read_config_file
>>> ollie_config = read_config_file("machines/ollie")
Important note here is that the configuration file has not yet been parsed, so it’s just the dictionary representation of the YAML.
- esm_tools.EDITABLE_INSTALL = False¶
Shows if the installation is installed in editable mode or not.
- Type:
bool
- esm_tools.read_config_file(config)[source]¶
Reads a configuration file, which should be seperated by “/”. For example, “machines/ollie” will retrieve the (unparsed) configuration of the Ollie supercomputer.
- Parameters:
config (str) – Configuration to get, e.g. machines/ollie.yaml, or echam/echam. You may omit the “.yaml” ending if you want, it will be appended automatically if not already there.
- Returns:
A dictionary representation of the config.
- Return type:
dict
- esm_tools.read_namelist_file(nml)[source]¶
Reads a namelist file from a path, seperated by “/”. Similar to
read_config_file
- Parameters:
nml (str) – The namelist to load
- Returns:
A string of the namelist file
- Return type:
str