src.mdtf_info module

Functions to collect settings metadata about installed PODs for the package and for online help.

class src.mdtf_info.PodDataTuple(sorted_pods, sorted_realms, pod_data, realm_data)

Bases: tuple

collections.namedtuple() class used to organize the data returned by load_pod_settings().

  • pod_data: Dict mapping each POD short name to a nested dict containing the parsed contents of that POD’s settings.json file.

  • realm_data: Dict mapping each modeling realm name to a list of short names of PODs using variables from that realm.

  • sorted_pods: List of short names of PODs in alphabetical order.

  • sorted_realms: List of names of modeling realms in alphabetical order.

__init__()

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

property pod_data
property realm_data
property sorted_pods
property sorted_realms
src.mdtf_info.load_pod_settings(code_root, pod=None, pod_list=None)[source]

Wrapper to load and parse the contents of POD settings files, used by MDTFFramework and InfoCLIHandler.

Parameters
  • code_root (str) – Absolute path to t

  • pod (str, optional) –

  • pod_list (list, optional) – List of POD names to load settings files.

Raises

PodConfigError – If an error is raised opening or parsing the contents of a settings file. In normal operation, this is treated as a fatal error and will cause package exit.

Returns

Instance of PodDataTuple.

class src.mdtf_info.InfoCLIHandler(code_root, arg_list)[source]

Bases: object

Class which implements the mdtf info online help, which displays information about PODs and their data dependencies from the CLI.

__init__(code_root, arg_list)[source]

Initialization. Reads in all POD metadata via load_pod_settings() and parses it into recognized help topics.

info_cmds()[source]

Handler which prints recognized help topics.

info_pods_all(*args)[source]

Handler which prints summary information on all installed PODs.

info_pod(pod)[source]

Handler which prints information about PODs as taken from their settings.json files, at maximum verbosity.

info_realms_all(*args)[source]

Handler which prints installed PODs corresponding to all modeling realms.

info_realm(realm)[source]

Handler which prints installed PODs corresponding to modeling realm realm.