diff --git a/.github/jobs/set_job_controls.sh b/.github/jobs/set_job_controls.sh index 9c39a5071..10f3b4c21 100755 --- a/.github/jobs/set_job_controls.sh +++ b/.github/jobs/set_job_controls.sh @@ -57,6 +57,12 @@ elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then input_data_version=${branch_name:6} fi + # check for main_vX.Y in the branch name + elif [[ "${branch_name}" =~ .*(main_v)([0-9]+\.[0-9]+).* ]]; then + + truth_data_version=${BASH_REMATCH[1]}${BASH_REMATCH[2]} + input_data_version=${BASH_REMATCH[2]} + fi # check commit messages for skip or force keywords @@ -87,14 +93,27 @@ elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then elif [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then + branch_name=`cut -d "/" -f3 <<< "${GITHUB_REF}"` + + # check for main_vX.Y in the branch name + if [[ "${branch_name}" =~ .*(main_v)([0-9]+\.[0-9]+).* ]]; then + + truth_data_version=${BASH_REMATCH[1]}${BASH_REMATCH[2]} + input_data_version=${BASH_REMATCH[2]} + + fi + if [ "${force_tests}" == "true" ]; then + run_diff=true + fi fi # if updating truth or running diff, run unit tests -if [ "$run_update_truth" == "true" ] || [ "$run_diff" == "true" ]; then +if [ "$run_update_truth" == "true" ] || + [ "$run_diff" == "true" ]; then run_unit_tests=true diff --git a/internal/test_unit/config/EnsembleStatConfig_climo b/internal/test_unit/config/EnsembleStatConfig_climo index 633ab775f..06699abf0 100644 --- a/internal/test_unit/config/EnsembleStatConfig_climo +++ b/internal/test_unit/config/EnsembleStatConfig_climo @@ -71,6 +71,7 @@ fcst = { field = [ { name = "TMP"; level = "Z2"; message_type = [ "ADPSFC" ]; }, + { name = "TMP"; level = "Z2"; message_type = [ "ADPSFC" ]; prob_cat_thresh = [ >275, >280, >285 ]; }, { name = "TMP"; level = "P850"; message_type = [ "ADPUPA" ]; } ]; } diff --git a/src/libcode/vx_stat_out/stat_columns.cc b/src/libcode/vx_stat_out/stat_columns.cc index b2ef7bce7..c6c6244f6 100644 --- a/src/libcode/vx_stat_out/stat_columns.cc +++ b/src/libcode/vx_stat_out/stat_columns.cc @@ -3388,11 +3388,13 @@ void write_pjc_cols(const PCTInfo &pct_info, col++; at.set_entry(r, col, // OY_TP - pct_info.pct.event_count_by_row(i)/(double) n); + (n == 0 ? bad_data_double : + pct_info.pct.event_count_by_row(i)/(double) n)); col++; at.set_entry(r, col, // ON_TP - pct_info.pct.nonevent_count_by_row(i)/(double) n); + (n == 0 ? bad_data_double : + pct_info.pct.nonevent_count_by_row(i)/(double) n)); col++; at.set_entry(r, col, // CALIBRATION @@ -3483,7 +3485,7 @@ void write_eclv_cols(const TTContingencyTable &ct, // // Economic Cost/Loss Value // Dump out the ECLV line: - // TOTAL, BASER, BASER_VALUE, + // TOTAL, BASER, VALUE_BASER, // N_PNT, [CL_], [VALUE_] (for each point) // at.set_entry(r, c+0, // Total Number of pairs diff --git a/src/libcode/vx_statistics/contable_nx2.cc b/src/libcode/vx_statistics/contable_nx2.cc index e94cf60dc..e9964a3b2 100644 --- a/src/libcode/vx_statistics/contable_nx2.cc +++ b/src/libcode/vx_statistics/contable_nx2.cc @@ -467,7 +467,12 @@ return x; double Nx2ContingencyTable::baser() const { - return (double) event_col_total()/n(); + double v; + + if( n() == 0 ) v = bad_data_double; + else v = (double) event_col_total()/n(); + + return ( v ); } @@ -475,7 +480,7 @@ double Nx2ContingencyTable::baser() const { double Nx2ContingencyTable::baser_ci(double alpha, - double &cl, double &cu) const { + double &cl, double &cu) const { double v; v = baser(); diff --git a/src/libcode/vx_statistics/contable_stats.cc b/src/libcode/vx_statistics/contable_stats.cc index b2a9b2bfb..d0c795f2a 100644 --- a/src/libcode/vx_statistics/contable_stats.cc +++ b/src/libcode/vx_statistics/contable_stats.cc @@ -737,6 +737,8 @@ double TTContingencyTable::sedi_ci(double alpha, double TTContingencyTable::cost_loss(double r) const { double num, den, h, m, f, b, v; + if(n() == 0) return(bad_data_double); + // Total proportion of hits, misses, false alarms, and observations h = (double) fy_oy() / n(); m = (double) fn_oy() / n(); diff --git a/src/tools/core/ensemble_stat/ensemble_stat.cc b/src/tools/core/ensemble_stat/ensemble_stat.cc index b15f0fd72..b0fadc0c3 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat.cc +++ b/src/tools/core/ensemble_stat/ensemble_stat.cc @@ -74,6 +74,7 @@ // 041 04/16/24 Halley Gotway MET #2786 Compute RPS from climo bin probs. // 042 04/29/24 Halley Gotway MET #2870 Ignore MISSING keyword. // 043 04/29/24 Halley Gotway MET #2795 Move level mismatch warning. +// 044 06/17/24 Halley Gotway MET #2856 Reinitialize climo_cdf pointer // //////////////////////////////////////////////////////////////////////// @@ -2257,6 +2258,7 @@ void do_pct_cat_thresh(const EnsembleStatVxOpt &vx_opt, // Re-initialize pd_pnt.erase(); + pd_pnt.set_climo_cdf_info_ptr(&vx_opt.cdf_info); // Process the observations for(i_obs=0; i_obs