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 #2430 TCPairs consensus.diag_required and consensus.diag_min_req #2439

Merged
merged 1 commit into from
Jan 10, 2024
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
10 changes: 10 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7397,6 +7397,16 @@ METplus Configuration Glossary

| *Used by:* TCPairs

TC_PAIRS_CONSENSUS<n>_DIAG_REQUIRED
Specify the value for the nth 'consensus.diag_required' in the MET configuration file for TCPairs.

| *Used by:* TCPairs

TC_PAIRS_CONSENSUS<n>_DIAG_MIN_REQ
Specify the value for the nth 'consensus.diag_min_req' in the MET configuration file for TCPairs.

| *Used by:* TCPairs

TC_PAIRS_CONSENSUS<n>_WRITE_MEMBERS
Specify the value for the nth 'consensus.write_members' in the MET configuration file for TCPairs.

Expand Down
6 changes: 6 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9461,6 +9461,8 @@ METplus Configuration
| :term:`TC_PAIRS_CONSENSUS<n>_MEMBERS`
| :term:`TC_PAIRS_CONSENSUS<n>_REQUIRED`
| :term:`TC_PAIRS_CONSENSUS<n>_MIN_REQ`
| :term:`TC_PAIRS_CONSENSUS<n>_DIAG_REQUIRED`
| :term:`TC_PAIRS_CONSENSUS<n>_DIAG_MIN_REQ`
| :term:`TC_PAIRS_CONSENSUS<n>_WRITE_MEMBERS`
| :term:`TC_PAIRS_SKIP_LEAD_SEQ`
| :term:`TC_PAIRS_RUN_ONCE`
Expand Down Expand Up @@ -9753,6 +9755,10 @@ ${METPLUS_CONSENSUS_LIST}
- consensus.required
* - :term:`TC_PAIRS_CONSENSUS<n>_MIN_REQ`
- consensus.min_req
* - :term:`TC_PAIRS_CONSENSUS<n>_DIAG_REQUIRED`
- consensus.diag_required
* - :term:`TC_PAIRS_CONSENSUS<n>_DIAG_MIN_REQ`
- consensus.diag_min_req
* - :term:`TC_PAIRS_CONSENSUS<n>_WRITE_MEMBERS`
- consensus.write_members

Expand Down
36 changes: 30 additions & 6 deletions internal/tests/pytests/wrappers/tc_pairs/test_tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,29 +369,41 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'TC_PAIRS_CONSENSUS1_MEMBERS': 'member1a, member1b',
'TC_PAIRS_CONSENSUS1_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS1_MIN_REQ': '1',
'TC_PAIRS_CONSENSUS1_DIAG_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS1_WRITE_MEMBERS': 'false',},
{'METPLUS_CONSENSUS_LIST': (
'consensus = [{name = "name1";members = ["member1a", "member1b"];'
'required = [true, false];min_req = 1;write_members = FALSE;}];'
'required = [true, false];min_req = 1;'
'diag_required = [false, true];diag_min_req = 2;'
'write_members = FALSE;}];'
)}),
# 14: consensus 2 dictionaries
('INIT', {'TC_PAIRS_CONSENSUS1_NAME': 'name1',
'TC_PAIRS_CONSENSUS1_MEMBERS': 'member1a, member1b',
'TC_PAIRS_CONSENSUS1_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS1_MIN_REQ': '1',
'TC_PAIRS_CONSENSUS1_DIAG_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS1_WRITE_MEMBERS': 'false',
'TC_PAIRS_CONSENSUS2_NAME': 'name2',
'TC_PAIRS_CONSENSUS2_MEMBERS': 'member2a, member2b',
'TC_PAIRS_CONSENSUS2_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS2_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS2_DIAG_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS2_DIAG_MIN_REQ': '3',
'TC_PAIRS_CONSENSUS2_WRITE_MEMBERS': 'true',
},
{'METPLUS_CONSENSUS_LIST': (
'consensus = ['
'{name = "name1";members = ["member1a", "member1b"];'
'required = [true, false];min_req = 1;write_members = FALSE;},'
'required = [true, false];min_req = 1;'
'diag_required = [false, true];diag_min_req = 2;'
'write_members = FALSE;},'
'{name = "name2";members = ["member2a", "member2b"];'
'required = [false, true];min_req = 2;write_members = TRUE;}];'
'required = [false, true];min_req = 2;'
'diag_required = [true, false];diag_min_req = 3;'
'write_members = TRUE;}];'
)}),
# 15: valid_exc
('INIT', {'TC_PAIRS_VALID_EXCLUDE': '20141031_14'},
Expand Down Expand Up @@ -455,29 +467,41 @@ def test_tc_pairs_storm_id_lists(metplus_config, config_overrides,
'TC_PAIRS_CONSENSUS1_MEMBERS': 'member1a, member1b',
'TC_PAIRS_CONSENSUS1_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS1_MIN_REQ': '1',
'TC_PAIRS_CONSENSUS1_DIAG_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS1_WRITE_MEMBERS': 'false',},
{'METPLUS_CONSENSUS_LIST': (
'consensus = [{name = "name1";members = ["member1a", "member1b"];'
'required = [true, false];min_req = 1;write_members = FALSE;}];'
'required = [true, false];min_req = 1;'
'diag_required = [false, true];diag_min_req = 2;'
'write_members = FALSE;}];'
)}),
# 35: consensus 2 dictionaries
('VALID', {'TC_PAIRS_CONSENSUS1_NAME': 'name1',
'TC_PAIRS_CONSENSUS1_MEMBERS': 'member1a, member1b',
'TC_PAIRS_CONSENSUS1_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS1_MIN_REQ': '1',
'TC_PAIRS_CONSENSUS1_DIAG_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS1_WRITE_MEMBERS': 'false',
'TC_PAIRS_CONSENSUS2_NAME': 'name2',
'TC_PAIRS_CONSENSUS2_MEMBERS': 'member2a, member2b',
'TC_PAIRS_CONSENSUS2_REQUIRED': 'false, true',
'TC_PAIRS_CONSENSUS2_MIN_REQ': '2',
'TC_PAIRS_CONSENSUS2_DIAG_REQUIRED': 'true, false',
'TC_PAIRS_CONSENSUS2_DIAG_MIN_REQ': '3',
'TC_PAIRS_CONSENSUS2_WRITE_MEMBERS': 'true',
},
{'METPLUS_CONSENSUS_LIST': (
'consensus = ['
'{name = "name1";members = ["member1a", "member1b"];'
'required = [true, false];min_req = 1;write_members = FALSE;},'
'required = [true, false];min_req = 1;'
'diag_required = [false, true];diag_min_req = 2;'
'write_members = FALSE;},'
'{name = "name2";members = ["member2a", "member2b"];'
'required = [false, true];min_req = 2;write_members = TRUE;}];'
'required = [false, true];min_req = 2;'
'diag_required = [true, false];diag_min_req = 3;'
'write_members = TRUE;}];'
)}),
# 36: valid_exc
('VALID', {'TC_PAIRS_VALID_EXCLUDE': '20141031_14'},
Expand Down
2 changes: 2 additions & 0 deletions metplus/wrappers/tc_pairs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ def _handle_consensus(self):
'members': 'list',
'required': ('list', 'remove_quotes'),
'min_req': 'int',
'diag_required': ('list', 'remove_quotes'),
'diag_min_req': 'int',
'write_members': 'bool',
}
return_code = add_met_config_dict_list(config=self.config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ TC_PAIRS_MISSING_VAL = -9999
#TC_PAIRS_CONSENSUS1_MEMBERS =
#TC_PAIRS_CONSENSUS1_REQUIRED =
#TC_PAIRS_CONSENSUS1_MIN_REQ =
#TC_PAIRS_CONSENSUS1_DIAG_REQUIRED =
#TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ =
#TC_PAIRS_CONSENSUS1_WRITE_MEMBERS =

#TC_PAIRS_CHECK_DUP =
Expand Down
2 changes: 2 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 @@ -96,6 +96,8 @@ TC_PAIRS_DLAND_FILE = MET_BASE/tc_data/dland_global_tenth_degree.nc
#TC_PAIRS_CONSENSUS1_MEMBERS =
#TC_PAIRS_CONSENSUS1_REQUIRED =
#TC_PAIRS_CONSENSUS1_MIN_REQ =
#TC_PAIRS_CONSENSUS1_DIAG_REQUIRED =
#TC_PAIRS_CONSENSUS1_DIAG_MIN_REQ =
#TC_PAIRS_CONSENSUS1_WRITE_MEMBERS =

#TC_PAIRS_CHECK_DUP =
Expand Down