Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix 1486 PB2NC file window variables not read #1487

Merged
merged 3 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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