Skip to content

Commit

Permalink
Issue #321 test for MPR climo column additions
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Aug 29, 2024
1 parent de1985b commit 9abf043
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion METreformat/test/test_reformatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ def test_tcdiag_from_tcpairs():
assert orig_tcdiag.STORM_SPEED == reformatted_tcdiag.STORM_SPEED


@pytest.mark.skip("Updates made to the MPR linetype will break this test")
def test_mpr_for_line_with_regression_data():
"""
Use one of the MPR linetype files found in the MET
Expand Down Expand Up @@ -1076,3 +1075,32 @@ def test_mpr_for_scatter_with_regression_data():
assert reformatted_subset['fcst'].to_list()[0] == expected_fcst
assert reformatted_subset['obs'].to_list()[0] == expected_obs

def test_mpr_for_climo_data():
"""
Use one of the MPR linetype files found in the MET
nightly regression tests. The MPR linetype has been updated to contain
climo data, where the CLIMO_MEAN, CLIMO_STDEV, and CLIMO_CDF columns were renamed
OBS_CLIMO_MEAN, OBS_CLIMO_STDEV, and OBS_CLIMO_CDF. Two new columns were added:
FCST_CLIMO_MEAN and FCST_CLIMO_STDEV
Verify that the renamed header columns and new columns are present
Args:
Returns:
None: passes or fails
"""

stat_data, config = setup_test("mpr_climo_data.yaml")
wsa = WriteStatAscii(config, logger)
reformatted_df = wsa.process_mpr(stat_data)


# Check for expected column name changes and new columns
expected_col_headers = ['OBS_CLIMO_STDEV', 'OBS_CLIMO_MEAN', 'OBS_CLIMO_CDF', 'FCST_CLIMO_MEAN', 'FCST_CLIMO_STDEV']
reformatted_col_headers = reformatted_df.columns.to_list()
for cur_col in reformatted_col_headers:
assert cur_col in reformatted_col_headers

0 comments on commit 9abf043

Please sign in to comment.