Skip to content

Commit

Permalink
bugfix 1486 PB2NC file window variables not read (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Mar 7, 2022
1 parent c0c568b commit 22075e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 11 additions & 0 deletions internal_tests/pytests/pb2nc/test_pb2nc_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,14 @@ def test_get_config_file(metplus_config):
config.set('config', 'PB2NC_CONFIG_FILE', fake_config_name)
wrapper = PB2NCWrapper(config)
assert wrapper.c_dict['CONFIG_FILE'] == fake_config_name

def test_pb2nc_file_window(metplus_config):
begin_value = -3600
end_value = 3600

config = metplus_config()
config.set('config', 'PB2NC_FILE_WINDOW_BEGIN', begin_value)
config.set('config', 'PB2NC_FILE_WINDOW_END', end_value)
wrapper = PB2NCWrapper(config)
assert wrapper.c_dict['OBS_FILE_WINDOW_BEGIN'] == begin_value
assert wrapper.c_dict['OBS_FILE_WINDOW_END'] == end_value
10 changes: 6 additions & 4 deletions metplus/wrappers/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,12 @@ def handle_file_window_variables(self, c_dict, dtypes=['FCST', 'OBS']):

for dtype in dtypes:
for edge in edges:
input_list = [f'{dtype}_{app}_FILE_WINDOW_{edge}',
f'{dtype}_FILE_WINDOW_{edge}',
f'FILE_WINDOW_{edge}',
]
input_list = [
f'{dtype}_{app}_FILE_WINDOW_{edge}',
f'{app}_FILE_WINDOW_{edge}',
f'{dtype}_FILE_WINDOW_{edge}',
f'FILE_WINDOW_{edge}',
]
output_key = f'{dtype}_FILE_WINDOW_{edge}'
value = self.handle_window_once(input_list, 0)
c_dict[output_key] = value
Expand Down

0 comments on commit 22075e4

Please sign in to comment.