lib.adf_config ============== .. py:module:: lib.adf_config .. autoapi-nested-parse:: Config class for the Atmospheric Diagnostics Framework (ADF). This class inherits from the AdfBase class. Currently this class does three things: 1. Initializes an instance of AdfBase. 2. Reads in a config (YAML) file. 3. Expands any keywords into their relevant variable values. Classes ------- .. autoapisummary:: lib.adf_config.AdfConfig Module Contents --------------- .. py:class:: AdfConfig(config_file, debug=False) Bases: :py:obj:`lib.adf_base.AdfBase` Config class, which reads in config (YAML) files and provides a mechanism to process and retreive relevant config variables. .. py:attribute:: __search_dict .. py:attribute:: __kword_pattern .. py:method:: __create_search_dict(config_dict, sub_dict=None) Recursive function that creates a non-hierarchical dictionary for use in global key/value searches. Please note that PyYAML doesn't allow for multiple variables with the same name in the same dictionary, so no need to check here. .. py:method:: __expand_yaml_var_ref(var_val) Recursive function to replace all keywords with their associated values from the provided dictionary. .. py:method:: expand_references(config_dict) Replace keyword (${var} or ${dict.var}) entries in the YAML (config) dictionary that reference other YAML dictionary variables/keys with the values of those variables. Currently this function will always convert the referenced variable to a string. .. py:method:: read_config_var(varname, conf_dict=None, required=False) Checks if variable/list/dictionary exists in configure dictionary,and if so returns it. Please note that in order to protect the values in the original YAML-defined config dictionary, only copies of the variable values are returned to the user.