diff --git a/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py b/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py index 9da87d0faa..ee4c3bab6a 100644 --- a/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py +++ b/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py @@ -172,6 +172,12 @@ def set_minimum_config_settings(config): 'MODEL1': '{custom}', 'MODEL_LIST': '{custom}'}, {'METPLUS_MODEL': 'model = ["CUSTOM_MODEL"];'}), + # 17 - fcst_lev + ({'FCST_LEVEL_LIST': 'R5'}, + {'METPLUS_FCST_LEVEL': 'fcst_lev = ["R5"];'}), + # 17 - obs_lev + ({'OBS_LEVEL_LIST': 'R7'}, + {'METPLUS_OBS_LEVEL': 'obs_lev = ["R7"];'}), ] ) @pytest.mark.wrapper_d diff --git a/metplus/wrappers/stat_analysis_wrapper.py b/metplus/wrappers/stat_analysis_wrapper.py index 180908f542..f8b7f2a94d 100755 --- a/metplus/wrappers/stat_analysis_wrapper.py +++ b/metplus/wrappers/stat_analysis_wrapper.py @@ -332,7 +332,8 @@ def _run_stat_analysis_job(self, runtime_settings): value = f'"{value}"' else: value = f'[{value}]' - value = f'{item.lower()} = {value};' + item = item.lower().replace('_level', '_lev') + value = f'{item} = {value};' self.env_var_dict[key] = value # send environment variables to logger