Skip to content

Commit

Permalink
feature 1252 allow dictionary value for time_summary.width (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Nov 11, 2021
1 parent fb2ffed commit 7094e0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions internal_tests/pytests/ascii2nc/test_ascii2nc_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ def ascii2nc_wrapper(metplus_config, config_path=None, config_overrides=None):
'grib_code = [11, 204, 211];obs_var = [];'
'type = ["min", "max", "range", "mean", "stdev", "median", "p80"];'
'vld_freq = 0;vld_thresh = 0.0;}')}),
# width as dictionary
({'ASCII2NC_TIME_SUMMARY_WIDTH': '{ beg = -21600; end = 0; }'},
{'METPLUS_TIME_SUMMARY_DICT':
('time_summary = {flag = FALSE;raw_data = FALSE;beg = "000000";'
'end = "235959";step = 300;width = { beg = -21600; end = 0; };'
'grib_code = [11, 204, 211];obs_var = [];'
'type = ["min", "max", "range", "mean", "stdev", "median", "p80"];'
'vld_freq = 0;vld_thresh = 0.0;}')}),
({'ASCII2NC_TIME_SUMMARY_GRIB_CODES': '12, 203, 212'},
{'METPLUS_TIME_SUMMARY_DICT':
Expand Down
9 changes: 5 additions & 4 deletions metplus/wrappers/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2012,10 +2012,11 @@ def handle_time_summary_dict(self, c_dict, remove_bracket_list=None):
'step',
'TIME_SUMMARY_STEP')

self.set_met_config_int(tmp_dict,
f'{app}_TIME_SUMMARY_WIDTH',
'width',
'TIME_SUMMARY_WIDTH')
self.set_met_config_string(tmp_dict,
f'{app}_TIME_SUMMARY_WIDTH',
'width',
'TIME_SUMMARY_WIDTH',
remove_quotes=True)

self.set_met_config_list(tmp_dict,
[f'{app}_TIME_SUMMARY_GRIB_CODES',
Expand Down

0 comments on commit 7094e0a

Please sign in to comment.