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

Per #2542 develop gheidke #2543

Merged
merged 2 commits into from
May 15, 2023
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
2 changes: 1 addition & 1 deletion internal/test_unit/config/TCStatConfig_ALAL2010
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs = [
"-job filter -amodel AHWI -rirw_track BDECK -rirw_thresh <=-30 -rirw_exact TRUE -dump_row ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_AHWI_rw.tcst",
"-job rirw -rirw_window 00 -rirw_thresh <=-15 -out_line_type CTC,CTS,MPR",
"-job rirw -rirw_window 12 -rirw_thresh <=-15 -out_line_type CTC,CTS,MPR",
"-job rirw -rirw_window 12 -rirw_thresh <=-15 -out_line_type CTC,CTS -out_stat ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_rirw.stat"
"-job rirw -rirw_window 12 -rirw_thresh <=-15 -out_line_type CTC,CTS -by amodel -out_stat ${MET_TEST_OUTPUT}/tc_stat/ALAL2010_rirw.stat"
];

//
Expand Down
44 changes: 16 additions & 28 deletions src/libcode/vx_statistics/contable_stats.cc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look reasonable to me.

Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,11 @@ if ( Nrows != Ncols ) {

const int N = total();

if ( N == 0 ) {

mlog << Error << "\nContingencyTable::gheidke() -> "
<< "table empty!\n\n";

exit ( 1 );
//
// MET #2542: return bad data for empty tables rather than erroring out
//

}
if ( N == 0 ) return ( bad_data_double );

const double DN = (double) N;
int j, k, m, n;
Expand Down Expand Up @@ -912,14 +909,11 @@ if ( ec_value < 0.0 || ec_value >= 1.0 ) {

const int N = total();

if ( N == 0 ) {

mlog << Error << "\nContingencyTable::gheidke_ec(double) -> "
<< "table empty!\n\n";

exit ( 1 );
//
// MET #2542: return bad data for empty tables rather than erroring out
//

}
if ( N == 0 ) return ( bad_data_double );

int j, sum;
double num, denom, ans;
Expand Down Expand Up @@ -977,14 +971,11 @@ if ( Nrows != Ncols ) {

const int N = total();

if ( N == 0 ) {

mlog << Error << "\nContingencyTable::gkuiper() -> "
<< "table empty!\n\n";

exit ( 1 );
//
// MET #2542: return bad data for empty tables rather than erroring out
//

}
if ( N == 0 ) return ( bad_data_double );

const double DN = (double) N;
int j, k, m, n;
Expand Down Expand Up @@ -1077,14 +1068,11 @@ if ( Nrows != Ncols ) {

const int N = total();

if ( N == 0 ) {

mlog << Error << "\nContingencyTable::gerrity() -> "
<< "table empty!\n\n";

exit ( 1 );
//
// MET #2542: return bad data for empty tables rather than erroring out
//

}
if ( N == 0 ) return ( bad_data_double );

int j, k, m, n;
const double DN = (double) N;
Expand Down