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 a082ac2ab..53bf25e1c 100644 --- a/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py +++ b/internal/tests/pytests/wrappers/stat_analysis/test_stat_analysis.py @@ -32,16 +32,17 @@ def stat_analysis_wrapper(metplus_config): ('', []), ('0,1,2,3', ['"000000"', '"010000"', '"020000"', '"030000"']), ('01', ['"010000"']), - ('010000', ['"010000"']), ('begin_end_incr(0,3,1)', ['"000000"', '"010000"', '"020000"', '"030000"']), + ('24, 48, 72, 96, 120, 144, 168, 192, 216, 240', + ['"240000"', '"480000"', '"720000"', '"960000"', '"1200000"', + '"1440000"', '"1680000"', '"1920000"', '"2160000"', '"2400000"']), ] ) @pytest.mark.wrapper_d def test_handle_format_lists(metplus_config, input, expected_output): config = metplus_config([TEST_CONF]) config.set('config', 'FCST_LEAD_LIST', input) - config.set('config', 'LOOP_LIST_ITEMS', 'FCST_LEAD_LIST') wrapper = StatAnalysisWrapper(config) assert wrapper.c_dict['FCST_LEAD_LIST'] == expected_output diff --git a/metplus/wrappers/stat_analysis_wrapper.py b/metplus/wrappers/stat_analysis_wrapper.py index 04db29105..36d075e62 100755 --- a/metplus/wrappers/stat_analysis_wrapper.py +++ b/metplus/wrappers/stat_analysis_wrapper.py @@ -255,7 +255,8 @@ def _format_conf_list(self, conf_list): @staticmethod def _format_hms(value): - return value.zfill(2).ljust(6, '0') + padded_value = value.zfill(2) + return padded_value.ljust(len(padded_value) + 4, '0') def c_dict_error_check(self, c_dict): @@ -399,7 +400,8 @@ def set_lists_loop_or_group(self, c_dict): return c_dict - def format_thresh(self, thresh_str): + @staticmethod + def format_thresh(thresh_str): """! Format thresholds for file naming Args: