Skip to content

Commit

Permalink
Feature #2049 Multiple interp.type.method/width (#2051)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Feb 21, 2023
1 parent fa5cd12 commit 165062d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,16 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
{'METPLUS_INTERP_DICT': 'interp = {shape = CIRCLE;}'}),
({'ENSEMBLE_STAT_INTERP_TYPE_METHOD': 'BILIN', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = BILIN;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN];}}'}),
({'ENSEMBLE_STAT_INTERP_TYPE_WIDTH': '2', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = 2;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2];}}'}),
# multiple interp type methods
({'ENSEMBLE_STAT_INTERP_TYPE_METHOD': 'BILIN, NEAREST', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN, NEAREST];}}'}),
# multiple interp type methods
({'ENSEMBLE_STAT_INTERP_TYPE_WIDTH': '2,3', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2, 3];}}'}),
({
'ENSEMBLE_STAT_INTERP_VLD_THRESH': '0.8',
Expand All @@ -457,7 +463,7 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
},
{'METPLUS_INTERP_DICT': ('interp = {vld_thresh = 0.8;'
'shape = CIRCLE;'
'type = {method = BILIN;width = 2;}}')}),
'type = {method = [BILIN];width = [2];}}')}),
({'ENSEMBLE_STAT_CLIMO_MEAN_FILE_NAME': '/some/climo_mean/file.txt', },
{'METPLUS_CLIMO_MEAN_DICT': ('climo_mean = {file_name = '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,16 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
{'METPLUS_INTERP_DICT': 'interp = {shape = CIRCLE;}'}),
({'GRID_STAT_INTERP_TYPE_METHOD': 'BILIN', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = BILIN;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN];}}'}),
({'GRID_STAT_INTERP_TYPE_WIDTH': '2', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = 2;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2];}}'}),
# multiple interp type methods
({'GRID_STAT_INTERP_TYPE_METHOD': 'BILIN, NEAREST', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN, NEAREST];}}'}),
# multiple interp type methods
({'GRID_STAT_INTERP_TYPE_WIDTH': '2,3', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2, 3];}}'}),
({
'GRID_STAT_INTERP_FIELD': 'NONE',
Expand All @@ -476,7 +482,7 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
},
{'METPLUS_INTERP_DICT': ('interp = {vld_thresh = 0.8;'
'shape = CIRCLE;'
'type = {method = BILIN;width = 2;}'
'type = {method = [BILIN];width = [2];}'
'field = NONE;}')}),
({'GRID_STAT_CLIMO_MEAN_FILE_NAME': '/some/climo_mean/file.txt', },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,16 @@ def test_met_dictionary_in_var_options(metplus_config):
{'METPLUS_INTERP_DICT': 'interp = {shape = SQUARE;}'}),
({'POINT_STAT_INTERP_TYPE_METHOD': 'BILIN', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = BILIN;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN];}}'}),
({'POINT_STAT_INTERP_TYPE_WIDTH': '2', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = 2;}}'}),
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2];}}'}),
# multiple interp type methods
({'POINT_STAT_INTERP_TYPE_METHOD': 'BILIN, NEAREST', },
{'METPLUS_INTERP_DICT': 'interp = {type = {method = [BILIN, NEAREST];}}'}),
# multiple interp type methods
({'POINT_STAT_INTERP_TYPE_WIDTH': '2,3', },
{'METPLUS_INTERP_DICT': 'interp = {type = {width = [2, 3];}}'}),
({
'POINT_STAT_INTERP_VLD_THRESH': '0.5',
Expand All @@ -318,7 +324,7 @@ def test_met_dictionary_in_var_options(metplus_config):
{
'METPLUS_INTERP_DICT': ('interp = {'
'vld_thresh = 0.5;shape = SQUARE;'
'type = {method = BILIN;width = 2;}}')}),
'type = {method = [BILIN];width = [2];}}')}),
({'POINT_STAT_CLIMO_MEAN_FILE_NAME': '/some/climo_mean/file.txt', },
{'METPLUS_CLIMO_MEAN_DICT': ('climo_mean = {file_name = '
Expand Down
4 changes: 2 additions & 2 deletions metplus/wrappers/compare_gridded_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ def handle_interp_dict(self, uses_field=False):
'vld_thresh': 'float',
'shape': ('string', 'remove_quotes'),
'type': ('dict', None, {
'method': ('string', 'remove_quotes'),
'width': 'int',
'method': ('list', 'remove_quotes'),
'width': ('list', 'remove_quotes'),
}),
}
if uses_field:
Expand Down

0 comments on commit 165062d

Please sign in to comment.