Beispiel #1
0
def get_title(name, ddict=None):
    if ddict is None:
        global default_dicts
        if default_dicts is None:
            default_dicts = get_complete_dicts(CURRENT_MONTH_DATA_FOLDER)
        ddict = default_dicts
    title_abbr = get_var_abbr(name)
    headline_dict = ddict[0]
    for title, two_labels_list in headline_dict.items():
        if title_abbr == two_labels_list[0]:
            return title
    return FILLER
Beispiel #2
0
def get_title(name, ddict=None):
    if ddict is None:
        global default_dicts
        if default_dicts is None:
            default_dicts = get_complete_dicts(CURRENT_MONTH_DATA_FOLDER)
        ddict = default_dicts
    title_abbr = get_var_abbr(name)
    headline_dict = ddict[0]
    for title, two_labels_list in headline_dict.items():
        if title_abbr == two_labels_list[0]:
            return title
    return FILLER
 def test_get_var_abbr(self):
     self.assertEqual(get_var_abbr('PROD_E_TWh'), 'PROD_E')
Beispiel #4
0
def get_db_varnames():
    # NOTE: these are not unique variables
    return [get_var_abbr(x) for x in get_unique_labels()]
 def test_get_var_abbr(self):
     self.assertEqual(get_var_abbr('PROD_E_TWh'),'PROD_E')
Beispiel #6
0
def test_get_var_abbr():
    assert get_var_abbr('PROD_E_TWh') == 'PROD_E'