Skip to content

Commit

Permalink
Per #2026, removed check to only allow STAT_ANALYSIS_RUNTIME_FREQ=RUN…
Browse files Browse the repository at this point in the history
…_ONCE and added logic to set runtime frequency to once per init/valid if LOOP_ORDER=times and start/end times are not equal to warn users that LOOP_ORDER has been deprecated
  • Loading branch information
georgemccabe committed Jan 26, 2023
1 parent 9b07398 commit 88ef5ec
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions metplus/wrappers/stat_analysis_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ def create_c_dict(self):
c_dict['VERBOSITY'])
)

if not c_dict['RUNTIME_FREQ']:
c_dict['RUNTIME_FREQ'] = 'RUN_ONCE'

if c_dict['RUNTIME_FREQ'] != 'RUN_ONCE':
self.log_error('Only RUN_ONCE is currently supported for '
'STAT_ANALYSIS_RUNTIME_FREQ')

# skip RuntimeFreq wrapper logic to find files
c_dict['FIND_FILES'] = False

Expand Down Expand Up @@ -183,6 +176,18 @@ def create_c_dict(self):
c_dict['DATE_BEG'] = start_dt
c_dict['DATE_END'] = end_dt

if not c_dict['RUNTIME_FREQ']:
# if start and end times are not equal and
# LOOP_ORDER = times (legacy), set frequency to once per init/valid
if (start_dt != end_dt and
self.config.has_option('LOOP_ORDER') and
self.config.getraw('config', 'LOOP_ORDER') == 'times'):
self.logger.warning('LOOP_ORDER has been deprecated. Please '
'set STAT_ANALYSIS_RUNTIME_FREQ instead')
c_dict['RUNTIME_FREQ'] = 'RUN_ONCE_PER_INIT_OR_VALID'
else:
c_dict['RUNTIME_FREQ'] = 'RUN_ONCE'

# read jobs from STAT_ANALYSIS_JOB<n> or legacy JOB_NAME/ARGS if unset
c_dict['JOBS'] = self._read_jobs_from_config()

Expand Down

0 comments on commit 88ef5ec

Please sign in to comment.