From e000454c705c561815818e5b0f1b2898641af4f9 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:17:59 -0600 Subject: [PATCH] Per #2299, updated list of deprecated env vars that were previously used in wrapped MET config files --- metplus/wrappers/ascii2nc_wrapper.py | 15 ++++++++ metplus/wrappers/command_builder.py | 24 ------------- metplus/wrappers/ensemble_stat_wrapper.py | 5 ++- metplus/wrappers/grid_diag_wrapper.py | 2 +- metplus/wrappers/grid_stat_wrapper.py | 12 ++++++- metplus/wrappers/mode_wrapper.py | 16 ++++++++- metplus/wrappers/mtd_wrapper.py | 16 +++++++++ metplus/wrappers/pb2nc_wrapper.py | 16 +++++++++ metplus/wrappers/point_stat_wrapper.py | 9 ++++- metplus/wrappers/series_analysis_wrapper.py | 10 +++++- metplus/wrappers/tc_pairs_wrapper.py | 16 +++++++++ metplus/wrappers/tc_stat_wrapper.py | 40 +++++++++++++++++++++ 12 files changed, 151 insertions(+), 30 deletions(-) diff --git a/metplus/wrappers/ascii2nc_wrapper.py b/metplus/wrappers/ascii2nc_wrapper.py index c34229a897..ab079b1328 100755 --- a/metplus/wrappers/ascii2nc_wrapper.py +++ b/metplus/wrappers/ascii2nc_wrapper.py @@ -31,6 +31,21 @@ class ASCII2NCWrapper(LoopTimesWrapper): 'METPLUS_TIME_SUMMARY_DICT', ] + # deprecated env vars that are no longer supported in the wrapped MET conf + DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'TIME_SUMMARY_FLAG', + 'TIME_SUMMARY_RAW_DATA', + 'TIME_SUMMARY_BEG', + 'TIME_SUMMARY_END', + 'TIME_SUMMARY_STEP', + 'TIME_SUMMARY_WIDTH', + 'TIME_SUMMARY_GRIB_CODES', + 'TIME_SUMMARY_VAR_NAMES', + 'TIME_SUMMARY_TYPES', + 'TIME_SUMMARY_VALID_FREQ', + 'TIME_SUMMARY_VALID_THRESH', + ] + def __init__(self, config, instance=None): self.app_name = "ascii2nc" self.app_path = os.path.join(config.getdir('MET_BIN_DIR', ''), diff --git a/metplus/wrappers/command_builder.py b/metplus/wrappers/command_builder.py index b1616ba40b..058a9e93f7 100755 --- a/metplus/wrappers/command_builder.py +++ b/metplus/wrappers/command_builder.py @@ -305,30 +305,6 @@ def _handle_window_once(self, input_list, default_val=0): return default_val - def handle_obs_window_legacy(self, c_dict): - """! Handle obs window config variables like - OBS__WINDOW_[BEGIN/END]. Set c_dict values for begin and end - to handle old method of setting env vars in MET config files, i.e. - OBS_WINDOW_[BEGIN/END]. Set env_var_dict value if any of the values - are set - - @param c_dict dictionary to read items from - """ - edges = [('BEGIN', -5400), - ('END', 5400)] - app = self.app_name.upper() - - # check {app}_WINDOW_{edge} to support PB2NC_WINDOW_[BEGIN/END] - for edge, default_val in edges: - input_list = [f'OBS_{app}_WINDOW_{edge}', - f'{app}_OBS_WINDOW_{edge}', - f'{app}_WINDOW_{edge}', - f'OBS_WINDOW_{edge}', - ] - output_key = f'OBS_WINDOW_{edge}' - value = self._handle_window_once(input_list, default_val) - c_dict[output_key] = value - def handle_file_window_variables(self, c_dict, data_types=None): """! Handle all window config variables like [FCST/OBS]__WINDOW_[BEGIN/END] and diff --git a/metplus/wrappers/ensemble_stat_wrapper.py b/metplus/wrappers/ensemble_stat_wrapper.py index a04a15ba26..661f32cc3e 100755 --- a/metplus/wrappers/ensemble_stat_wrapper.py +++ b/metplus/wrappers/ensemble_stat_wrapper.py @@ -71,10 +71,13 @@ class EnsembleStatWrapper(CompareGriddedWrapper): 'METPLUS_ECLV_POINTS', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ 'CLIMO_MEAN_FILE', 'CLIMO_STDEV_FILE', + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', ] OUTPUT_FLAGS = [ diff --git a/metplus/wrappers/grid_diag_wrapper.py b/metplus/wrappers/grid_diag_wrapper.py index 4eab43f5c9..7219aa5ec2 100755 --- a/metplus/wrappers/grid_diag_wrapper.py +++ b/metplus/wrappers/grid_diag_wrapper.py @@ -36,7 +36,7 @@ class GridDiagWrapper(RuntimeFreqWrapper): 'METPLUS_MASK_DICT', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ 'DESC', 'DATA_FIELD', diff --git a/metplus/wrappers/grid_stat_wrapper.py b/metplus/wrappers/grid_stat_wrapper.py index 5db221779e..8e7ebbf78e 100755 --- a/metplus/wrappers/grid_stat_wrapper.py +++ b/metplus/wrappers/grid_stat_wrapper.py @@ -57,11 +57,21 @@ class GridStatWrapper(CompareGriddedWrapper): 'METPLUS_SEEPS_P1_THRESH', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', 'CLIMO_MEAN_FILE', 'CLIMO_STDEV_FILE', 'VERIF_MASK', + 'FCST_FIELD', + 'OBS_FIELD', + 'FCST_TIME', + 'INPUT_BASE', + 'NEIGHBORHOOD_WIDTH', + 'NEIGHBORHOOD_SHAPE', + 'NEIGHBORHOOD_COV_THRESH', ] OUTPUT_FLAGS = [ diff --git a/metplus/wrappers/mode_wrapper.py b/metplus/wrappers/mode_wrapper.py index a6ff9f128b..49431c4712 100755 --- a/metplus/wrappers/mode_wrapper.py +++ b/metplus/wrappers/mode_wrapper.py @@ -72,9 +72,23 @@ class MODEWrapper(CompareGriddedWrapper): 'METPLUS_OBS_MULTIVAR_LEVEL', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', 'VERIF_MASK', + 'FCST_FIELD', + 'OBS_FIELD', + 'QUILT', + 'FCST_CONV_RADIUS', + 'OBS_CONV_RADIUS', + 'FCST_CONV_THRESH', + 'OBS_CONV_THRESH', + 'FCST_MERGE_THRESH', + 'OBS_MERGE_THRESH', + 'FCST_MERGE_FLAG', + 'OBS_MERGE_FLAG', ] WEIGHTS = { diff --git a/metplus/wrappers/mtd_wrapper.py b/metplus/wrappers/mtd_wrapper.py index effdc96ad0..34bcc647e0 100755 --- a/metplus/wrappers/mtd_wrapper.py +++ b/metplus/wrappers/mtd_wrapper.py @@ -41,6 +41,22 @@ class MTDWrapper(CompareGriddedWrapper): 'METPLUS_OUTPUT_PREFIX', ] + # deprecated env vars that are no longer supported in the wrapped MET conf + DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', + 'FCST_FIELD', + 'OBS_FIELD', + 'FCST_CONV_RADIUS', + 'OBS_CONV_RADIUS', + 'FCST_CONV_THRESH', + 'OBS_CONV_THRESH', + 'MIN_VOLUME', + 'FCST_FILE_TYPE', + 'OBS_FILE_TYPE', + ] + def __init__(self, config, instance=None): self.app_name = 'mtd' self.app_path = os.path.join(config.getdir('MET_BIN_DIR', ''), diff --git a/metplus/wrappers/pb2nc_wrapper.py b/metplus/wrappers/pb2nc_wrapper.py index ff8d6db805..479c567aed 100755 --- a/metplus/wrappers/pb2nc_wrapper.py +++ b/metplus/wrappers/pb2nc_wrapper.py @@ -40,6 +40,22 @@ class PB2NCWrapper(LoopTimesWrapper): 'METPLUS_OBS_BUFR_MAP', ] + # deprecated env vars that are no longer supported in the wrapped MET conf + DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'PB2NC_MESSAGE_TYPE', + 'PB2NC_STATION_ID', + 'OBS_WINDOW_BEGIN', + 'OBS_WINDOW_END', + 'PB2NC_GRID', + 'PB2NC_POLY', + 'OBS_BUFR_VAR_LIST', + 'TIME_SUMMARY_FLAG', + 'TIME_SUMMARY_BEG', + 'TIME_SUMMARY_END', + 'TIME_SUMMARY_VAR_NAMES', + 'TIME_SUMMARY_TYPES', + ] + def __init__(self, config, instance=None): self.app_name = 'pb2nc' self.app_path = os.path.join(config.getdir('MET_BIN_DIR', ''), diff --git a/metplus/wrappers/point_stat_wrapper.py b/metplus/wrappers/point_stat_wrapper.py index 0cf0d087c2..673fbb6d9c 100755 --- a/metplus/wrappers/point_stat_wrapper.py +++ b/metplus/wrappers/point_stat_wrapper.py @@ -48,10 +48,17 @@ class PointStatWrapper(CompareGriddedWrapper): 'METPLUS_SEEPS_P1_THRESH', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', 'CLIMO_MEAN_FILE', 'CLIMO_STDEV_FILE', + 'FCST_FIELD', + 'OBS_FIELD', + 'OBS_WINDOW_BEGIN', + 'OBS_WINDOW_END', 'POINT_STAT_POLY', 'POINT_STAT_GRID', 'POINT_STAT_STATION_ID', diff --git a/metplus/wrappers/series_analysis_wrapper.py b/metplus/wrappers/series_analysis_wrapper.py index 6677726190..c33b4d6440 100755 --- a/metplus/wrappers/series_analysis_wrapper.py +++ b/metplus/wrappers/series_analysis_wrapper.py @@ -63,12 +63,20 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper): 'METPLUS_MASK_DICT', ] - # handle deprecated env vars used pre v4.0.0 + # deprecated env vars that are no longer supported in the wrapped MET conf DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'MODEL', + 'OBTYPE', + 'REGRID_TO_GRID', 'CLIMO_MEAN_FILE', 'CLIMO_STDEV_FILE', 'METPLUS_CTS_LIST', 'METPLUS_STAT_LIST', + 'FCST_FILE_TYPE', + 'OBS_FILE_TYPE', + 'FCST_FIELD', + 'OBS_FIELD', + 'STAT_LIST', ] # variable names of output_stats dictionary diff --git a/metplus/wrappers/tc_pairs_wrapper.py b/metplus/wrappers/tc_pairs_wrapper.py index efd86b894a..5065fe0a4d 100755 --- a/metplus/wrappers/tc_pairs_wrapper.py +++ b/metplus/wrappers/tc_pairs_wrapper.py @@ -70,6 +70,22 @@ class TCPairsWrapper(RuntimeFreqWrapper): 'METPLUS_DIAG_CONVERT_MAP_LIST', ] + # deprecated env vars that are no longer supported in the wrapped MET conf + DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'INIT_BEG', + 'INIT_END', + 'VALID_BEG', + 'VALID_END', + 'INIT_INCLUDE', + 'INIT_EXCLUDE', + 'MODEL', + 'STORM_ID', + 'BASIN', + 'CYCLONE', + 'STORM_NAME', + 'DLAND_FILE', + ] + WILDCARDS = { 'basin': '??', 'cyclone': '*', diff --git a/metplus/wrappers/tc_stat_wrapper.py b/metplus/wrappers/tc_stat_wrapper.py index 5b10e6e7e9..acd3857a9a 100755 --- a/metplus/wrappers/tc_stat_wrapper.py +++ b/metplus/wrappers/tc_stat_wrapper.py @@ -88,6 +88,46 @@ class TCStatWrapper(RuntimeFreqWrapper): 'METPLUS_OUT_VALID_MASK', ] + # deprecated env vars that are no longer supported in the wrapped MET conf + DEPRECATED_WRAPPER_ENV_VAR_KEYS = [ + 'AMODEL', + 'BMODEL', + 'DESC', + 'STORM_ID', + 'BASIN', + 'CYCLONE', + 'STORM_NAME', + 'INIT_INCLUDE', + 'INIT_EXCLUDE', + 'VALID_INCLUDE', + 'VALID_EXCLUDE', + 'INIT_HOUR', + 'VALID_HOUR', + 'LEAD', + 'LEAD_REQ', + 'INIT_MASK', + 'VALID_MASK', + 'TRACK_WATCH_WARN', + 'COLUMN_THRESH_NAME', + 'COLUMN_THRESH_VAL', + 'COLUMN_STR_NAME', + 'COLUMN_STR_VAL', + 'INIT_THRESH_NAME', + 'INIT_THRESH_VAL', + 'INIT_STR_NAME', + 'INIT_STR_VAL', + 'JOBS', + 'INIT_BEG', + 'INIT_END', + 'VALID_BEG', + 'VALID_END', + 'LANDFALL_BEG', + 'LANDFALL_END', + 'WATER_ONLY', + 'LANDFALL', + 'MATCH_POINTS', + ] + def __init__(self, config, instance=None): self.app_name = 'tc_stat' self.app_path = os.path.join(config.getdir('MET_BIN_DIR', ''),