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

Feature #2880 SeriesAnalysis allow time templates in field name #2881

Merged
merged 2 commits into from
Jan 31, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def set_minimum_config_settings(config):
(0, 2, 0.5, 0, False, 'RUN_ONCE_PER_INIT_OR_VALID'),
(2, 7, 1.0, 1, True, 'RUN_ONCE_PER_LEAD'),
(2, 7, 1.0, 2, False, 'RUN_ONCE_PER_LEAD'),
(8, 14, 1.0, 1, True, 'RUN_ONCE_FOR_EACH'),
(8, 14, 1.0, 8, False, 'RUN_ONCE_FOR_EACH'),
(0, 2, 1.0, 0, True, 'RUN_ONCE_FOR_EACH'),
(0, 2, 1.0, 0, False, 'RUN_ONCE_FOR_EACH'),
]
)
@pytest.mark.wrapper_a
Expand Down
15 changes: 10 additions & 5 deletions metplus/wrappers/series_analysis_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from ..util import ti_get_hours_from_lead, ti_get_seconds_from_lead
from ..util import ti_get_lead_string
from ..util import parse_var_list
from ..util import add_to_time_input, is_single_run_time
from ..util import add_to_time_input
from ..util import field_read_prob_info, add_field_info_to_time_info
from .plot_data_plane_wrapper import PlotDataPlaneWrapper
from . import RuntimeFreqWrapper
Expand All @@ -38,7 +38,11 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper):
"""! Performs series analysis with filtering options
"""
RUNTIME_FREQ_DEFAULT = 'RUN_ONCE_PER_INIT_OR_VALID'
RUNTIME_FREQ_SUPPORTED = 'ALL'
RUNTIME_FREQ_SUPPORTED = [
'RUN_ONCE',
'RUN_ONCE_PER_INIT_OR_VALID',
'RUN_ONCE_PER_LEAD',
]

WRAPPER_ENV_VAR_KEYS = [
'METPLUS_MODEL',
Expand Down Expand Up @@ -1086,8 +1090,8 @@ def _get_field_list(self, data_type, var_info, time_info):
# if there are no time tags (init/valid/lead) in the field level
# or if init, valid, and lead have values in time_info,
# get field info for a single field to pass to the MET config file
if (not self._has_time_tag(var_info[f'{data_type}_level']) or
is_single_run_time(time_info)):
if (not self._has_time_tag(var_info[f'{data_type}_level']) and
not self._has_time_tag(var_info[f'{data_type}_name'])):
return self._get_field_sub_level(data_type, var_info, time_info)

field_list = []
Expand Down Expand Up @@ -1122,11 +1126,12 @@ def _get_field_sub_level(self, data_type, var_info, time_dict):
@param time_dict dictionary containing time information
@returns string with formatted field info or None
"""
name = do_string_sub(var_info[f'{data_type}_name'], **time_dict)
level = do_string_sub(var_info[f'{data_type}_level'], **time_dict)
return self.get_field_info(
v_level=level,
v_thresh=var_info[f'{data_type}_thresh'],
v_name=var_info[f'{data_type}_name'],
v_name=name,
v_extra=var_info[f'{data_type}_extra'],
d_type=data_type.upper()
)