Skip to content

Commit

Permalink
feature 1069 TCPairs write_valid, valid_inc, valid_exc (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Aug 31, 2021
1 parent ef01c02 commit bba3a9c
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 10 deletions.
15 changes: 15 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7873,3 +7873,18 @@ METplus Configuration Glossary
directory is gathered and passed into the script. Defaults to False.

| *Used by:* TCMPRPlotter
TC_PAIRS_VALID_INCLUDE
Specify the value for 'valid_inc' in the MET configuration file for TCPairs.

| *Used by:* TCPairs
TC_PAIRS_VALID_EXCLUDE
Specify the value for 'valid_exc' in the MET configuration file for TCPairs.

| *Used by:* TCPairs
TC_PAIRS_WRITE_VALID
Specify the value for 'write_valid' in the MET configuration file for TCPairs.

| *Used by:* TCPairs
40 changes: 38 additions & 2 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6588,6 +6588,9 @@ METplus Configuration
| :term:`TC_PAIRS_CONFIG_FILE`
| :term:`TC_PAIRS_INIT_INCLUDE`
| :term:`TC_PAIRS_INIT_EXCLUDE`
| :term:`TC_PAIRS_VALID_INCLUDE`
| :term:`TC_PAIRS_VALID_EXCLUDE`
| :term:`TC_PAIRS_WRITE_VALID`
| :term:`TC_PAIRS_READ_ALL_FILES`
| :term:`TC_PAIRS_MODEL`
| :term:`TC_PAIRS_STORM_ID`
Expand Down Expand Up @@ -6743,7 +6746,7 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`TC_PAIRS_INIT_END`
- init_end

**${METPLUS_INIT_INCLUDE}**
**${METPLUS_INIT_INC}**

.. list-table::
:widths: 5 5
Expand All @@ -6754,7 +6757,7 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`TC_PAIRS_INIT_INCLUDE`
- init_inc

**${METPLUS_INIT_EXCLUDE}**
**${METPLUS_INIT_EXC}**

.. list-table::
:widths: 5 5
Expand All @@ -6765,6 +6768,39 @@ see :ref:`How METplus controls MET config file settings<metplus-control-met>`.
* - :term:`TC_PAIRS_INIT_EXCLUDE`
- init_exc

**${METPLUS_VALID_INC}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`TC_PAIRS_VALID_INCLUDE`
- valid_inc

**${METPLUS_VALID_EXC}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`TC_PAIRS_VALID_EXCLUDE`
- valid_exc

**${METPLUS_WRITE_VALID}**

.. list-table::
:widths: 5 5
:header-rows: 0

* - METplus Config(s)
- MET Config File
* - :term:`TC_PAIRS_WRITE_VALID`
- write_valid

**${METPLUS_VALID_BEG}**

.. list-table::
Expand Down
13 changes: 11 additions & 2 deletions internal_tests/pytests/tc_pairs/test_tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
{'METPLUS_DLAND_FILE': 'dland_file = "my_dland.nc";'}),
# 8: init_exc
({'TC_PAIRS_INIT_EXCLUDE': '20141031_14'},
{'METPLUS_INIT_EXCLUDE': 'init_exc = ["20141031_14"];'}),
{'METPLUS_INIT_EXC': 'init_exc = ["20141031_14"];'}),
# 9: init_inc
({'TC_PAIRS_INIT_INCLUDE': '20141031_14'},
{'METPLUS_INIT_INCLUDE': 'init_inc = ["20141031_14"];'}),
{'METPLUS_INIT_INC': 'init_inc = ["20141031_14"];'}),
# 10: storm name
({'TC_PAIRS_STORM_NAME': 'KATRINA, OTHER'},
{'METPLUS_STORM_NAME': 'storm_name = ["KATRINA", "OTHER"];'}),
Expand Down Expand Up @@ -352,6 +352,15 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'{name = "name2";members = ["member2a", "member2b"];'
'required = [false, true];min_req = 2;}];'
)}),
# 15: valid_exc
({'TC_PAIRS_VALID_EXCLUDE': '20141031_14'},
{'METPLUS_VALID_EXC': 'valid_exc = ["20141031_14"];'}),
# 16: valid_inc
({'TC_PAIRS_VALID_INCLUDE': '20141031_14'},
{'METPLUS_VALID_INC': 'valid_inc = ["20141031_14"];'}),
# 17: write_valid
({'TC_PAIRS_WRITE_VALID': '20141031_14'},
{'METPLUS_WRITE_VALID': 'write_valid = ["20141031_14"];'}),
]
)
def test_tc_pairs_loop_order_processes(metplus_config, config_overrides,
Expand Down
27 changes: 23 additions & 4 deletions metplus/wrappers/tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ class TCPairsWrapper(CommandBuilder):
'METPLUS_STORM_NAME',
'METPLUS_INIT_BEG',
'METPLUS_INIT_END',
'METPLUS_INIT_INCLUDE',
'METPLUS_INIT_EXCLUDE',
'METPLUS_INIT_INC',
'METPLUS_INIT_EXC',
'METPLUS_VALID_BEG',
'METPLUS_VALID_END',
'METPLUS_DLAND_FILE',
'METPLUS_CONSENSUS_LIST',
'METPLUS_WRITE_VALID',
'METPLUS_VALID_INC',
'METPLUS_VALID_EXC',
]

WILDCARDS = {
Expand Down Expand Up @@ -112,16 +115,32 @@ def create_c_dict(self):

self.add_met_config(name='init_inc',
data_type='list',
env_var_name='METPLUS_INIT_INCLUDE',
metplus_configs=['TC_PAIRS_INIT_INCLUDE',
'TC_PAIRS_INIT_INC',
'INIT_INCLUDE'])

self.add_met_config(name='init_exc',
data_type='list',
env_var_name='METPLUS_INIT_EXCLUDE',
metplus_configs=['TC_PAIRS_INIT_EXCLUDE',
'TC_PAIRS_INIT_EXC',
'INIT_EXCLUDE'])

self.add_met_config(name='valid_inc',
data_type='list',
metplus_configs=['TC_PAIRS_VALID_INCLUDE',
'TC_PAIRS_VALID_INC',
'VALID_INCLUDE'])

self.add_met_config(name='valid_exc',
data_type='list',
metplus_configs=['TC_PAIRS_VALID_EXCLUDE',
'TC_PAIRS_VALID_EXC',
'VALID_EXCLUDE'])

self.add_met_config(name='write_valid',
data_type='list',
metplus_configs=['TC_PAIRS_WRITE_VALID'])

self.add_met_config(name='valid_beg',
data_type='string',
metplus_configs=['TC_PAIRS_VALID_BEG',
Expand Down
14 changes: 12 additions & 2 deletions parm/met_config/TCPairsConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,18 @@ ${METPLUS_STORM_NAME}
//
${METPLUS_INIT_BEG}
${METPLUS_INIT_END}
${METPLUS_INIT_INCLUDE}
${METPLUS_INIT_EXCLUDE}
// init_inc =
${METPLUS_INIT_INC}
// init_exc =
${METPLUS_INIT_EXC}

// valid_inc =
${METPLUS_VALID_INC}
// valid_exc =
${METPLUS_VALID_EXC}

// write_valid =
${METPLUS_WRITE_VALID}

//
// Valid model time window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ TC_PAIRS_INIT_EXCLUDE =
TC_PAIRS_INIT_BEG = 2014121318
TC_PAIRS_INIT_END = 2014121418

#TC_PAIRS_VALID_INCLUDE =
#TC_PAIRS_VALID_EXCLUDE =

#TC_PAIRS_WRITE_VALID =

# Specify model valid time window in format YYYYMM[DD[_hh]]
# Only tracks that fall within the valid time window will be used
TC_PAIRS_VALID_BEG =
Expand Down
5 changes: 5 additions & 0 deletions parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ TC_PAIRS_INIT_EXCLUDE =
TC_PAIRS_INIT_BEG =
TC_PAIRS_INIT_END =

#TC_PAIRS_VALID_INCLUDE =
#TC_PAIRS_VALID_EXCLUDE =

#TC_PAIRS_WRITE_VALID =

# Specify model valid time window in format YYYYMM[DD[_hh]]
# Only tracks that fall within the valid time window will be used
TC_PAIRS_VALID_BEG =
Expand Down

0 comments on commit bba3a9c

Please sign in to comment.