From e644194b29798e7aea00aaa8d09cecdb289663ba Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:32:51 -0600 Subject: [PATCH] per #1842, add quotation marks around name/level/units that were read from the FCST/OBS_VAR variables and around level values read from FCST/OBS_LEVEL_LIST, ci-run-diff --- metplus/wrappers/stat_analysis_wrapper.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/metplus/wrappers/stat_analysis_wrapper.py b/metplus/wrappers/stat_analysis_wrapper.py index 633a7bf36..04db29105 100755 --- a/metplus/wrappers/stat_analysis_wrapper.py +++ b/metplus/wrappers/stat_analysis_wrapper.py @@ -1162,7 +1162,7 @@ def get_level_list(self, data_type): level = f'{remove_quotes(level)}' level_list.append(level) - return level_list + return [f'"{item}"' for item in level_list] def process_job_args(self, job_type, job, model_info, lists_to_loop_items, lists_to_group_items, runtime_settings_dict): @@ -1344,16 +1344,16 @@ def get_c_dict_list(self): c_dict = {} c_dict['index'] = var_info['index'] c_dict['FCST_VAR_LIST'] = [ - var_info['fcst_name'] + f'"{var_info["fcst_name"]}"' ] c_dict['OBS_VAR_LIST'] = [ - var_info['obs_name'] + f'"{var_info["obs_name"]}"' ] c_dict['FCST_LEVEL_LIST'] = [ - var_info['fcst_level'] + f'"{var_info["fcst_level"]}"' ] c_dict['OBS_LEVEL_LIST'] = [ - var_info['obs_level'] + f'"{var_info["obs_level"]}"' ] c_dict['FCST_THRESH_LIST'] = [] @@ -1369,9 +1369,9 @@ def get_c_dict_list(self): c_dict['FCST_UNITS_LIST'] = [] c_dict['OBS_UNITS_LIST'] = [] if fcst_units: - c_dict['FCST_UNITS_LIST'].append(fcst_units) + c_dict['FCST_UNITS_LIST'].append(f'"{fcst_units}"') if obs_units: - c_dict['OBS_UNITS_LIST'].append(obs_units) + c_dict['OBS_UNITS_LIST'].append(f'"{obs_units}"') c_dict['run_fourier'] = run_fourier if pair: @@ -1391,8 +1391,7 @@ def add_other_lists_to_c_dict(self, c_dict): @param c_dict dictionary to add values to """ # add group and loop lists - lists_to_add = self.list_categories - for list_category in lists_to_add: + for list_category in self.list_categories: list_items = self.c_dict[list_category] if list_category not in c_dict: c_dict[list_category] = list_items