Skip to content

Commit

Permalink
per #2137, enhanced PointStat wrapper to properly set -obs_valid_beg/…
Browse files Browse the repository at this point in the history
…end command line arguments that fix newly added unit tests
  • Loading branch information
georgemccabe committed Apr 26, 2023
1 parent 06604f1 commit 70985a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 12 additions & 0 deletions metplus/wrappers/compare_gridded_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,24 @@ def process_fields(self, time_info):
is_directory=True):
return

# set command line arguments
self.set_command_line_arguments(time_info)

# set environment variables needed by MET config file
self.set_environment_variables(time_info)

# run the MET command
self.build()

def set_command_line_arguments(self, time_info):
"""!Set command line arguments in self.args to add to command to run.
Nothing is done for CompareGridded wrapper. This function can be
overwritten in subclasses.
@param time_info dictionary with time information
"""
return

def get_command(self):
"""! Builds the command to run the MET application
@rtype string
Expand Down
8 changes: 7 additions & 1 deletion metplus/wrappers/point_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ def create_c_dict(self):

return c_dict

def add_obs_valid_args(self, time_info):
def set_command_line_arguments(self, time_info):
"""!Set command line arguments in self.args to add to command to run.
This function is overwritten from CompareGridded wrapper.
@param time_info dictionary with time information
"""
# set optional obs_valid_beg and obs_valid_end arguments
for ext in ['BEG', 'END']:
if self.c_dict[f'OBS_VALID_{ext}']:
obs_valid = do_string_sub(self.c_dict[f'OBS_VALID_{ext}'],
Expand Down

0 comments on commit 70985a7

Please sign in to comment.