diff --git a/include/evalhyd/determinist.hpp b/include/evalhyd/determinist.hpp index 90dd9694a8d0078e792604141fcf7c7fd9d43077..0cb6e7b369f75d4f5e52ef22609eb1f7dd54c56c 100644 --- a/include/evalhyd/determinist.hpp +++ b/include/evalhyd/determinist.hpp @@ -78,12 +78,12 @@ namespace evalhyd for ( const auto& metric : metrics ) { - if ( metric == "nse" ) + if ( metric == "NSE" ) { if (std::find(req_dep.begin(), req_dep.end(), metric) == req_dep.end()) - evaluator.calc_nse(); - r.emplace_back(evaluator.nse); + evaluator.calc_NSE(); + r.emplace_back(evaluator.NSE); } } diff --git a/include/evalhyd/determinist/evaluator.hpp b/include/evalhyd/determinist/evaluator.hpp index a0ae42dde690421a7991ad0da0ffb09d0c7b7ce0..e2e42e12ebbde202f7ca349089366b9839f3f707 100644 --- a/include/evalhyd/determinist/evaluator.hpp +++ b/include/evalhyd/determinist/evaluator.hpp @@ -30,11 +30,11 @@ namespace evalhyd } }; // members for evaluation metrics - A nse; + A NSE; // methods to compute elements // TODO // methods to compute metrics - void calc_nse(); + void calc_NSE(); }; // Compute the Nash-Sutcliffe Efficiency (NSE). @@ -54,7 +54,7 @@ namespace evalhyd // Array of computed Nash-Sutcliffe efficiencies. // shape: (...) template <class A> - void Evaluator<A>::calc_nse() + void Evaluator<A>::calc_NSE() { // compute average observed flow A q_avg = xt::mean(q_obs, -1, xt::keep_dims); @@ -64,7 +64,7 @@ namespace evalhyd A f_den = xt::sum(xt::square(q_obs - q_avg), -1, xt::keep_dims); // return computed NSE - nse = 1 - (f_num / f_den); + NSE = 1 - (f_num / f_den); } } } diff --git a/tests/test_determinist.cpp b/tests/test_determinist.cpp index d4296313f4379ca422a8e9852f0aa6c5ea313b70..6a7c90a5ea1966c0378183035811b350d532a80a 100644 --- a/tests/test_determinist.cpp +++ b/tests/test_determinist.cpp @@ -29,12 +29,12 @@ TEST(DeterministTests, TestNSE) { // compute scores (both with 2D and 1D tensors) std::vector<xt::xtensor<double, 2>> metrics_2d = evalhyd::determinist::evaluate<xt::xtensor<double, 2>>( - {"nse"}, observed_2d, forecast_2d + {"NSE"}, observed_2d, forecast_2d ); std::vector<xt::xtensor<double, 1>> metrics_1d = evalhyd::determinist::evaluate<xt::xtensor<double, 1>>( - {"nse"}, observed_1d, forecast_1d + {"NSE"}, observed_1d, forecast_1d ); // check results (both with 2D and 1D tensors)