diff --git a/include/evalhyd/determinist.hpp b/include/evalhyd/determinist.hpp index 8a716a9f8c995f93a4225c2d66723efb3ef2a549..6b4bc9f64c66550b6fe9f57b1bd8bcbd87e43b9f 100644 --- a/include/evalhyd/determinist.hpp +++ b/include/evalhyd/determinist.hpp @@ -15,21 +15,21 @@ namespace evalhyd /// Function allowing the evaluation of streamflow simulations using a /// range of relevant metrics. /// - /// \param [in] metrics: - /// Vector of strings for the metric(s) to be computed. /// \param [in] q_obs: /// 2D array of streamflow observations. /// shape: (1+, time) /// \param [in] q_sim: /// 2D array of streamflow simulations. /// shape: (1+, time) + /// \param [in] metrics: + /// Vector of strings for the metric(s) to be computed. /// \return /// Vector of 1D array of metrics for each time series. template <class A> std::vector<A> evald( - const std::vector<std::string>& metrics, const xt::xexpression<A>& q_obs, - const xt::xexpression<A>& q_sim + const xt::xexpression<A>& q_sim, + const std::vector<std::string>& metrics ) { const A& obs = q_obs.derived_cast(); diff --git a/include/evalhyd/probabilist.hpp b/include/evalhyd/probabilist.hpp index d05cf9993317c53f1f1ac8e7514c17c3b6775d93..8bf5e1921a0abe143d89ded7609257971724a9c1 100644 --- a/include/evalhyd/probabilist.hpp +++ b/include/evalhyd/probabilist.hpp @@ -17,23 +17,23 @@ namespace evalhyd /// Function allowing the evaluation of streamflow forecasts using a /// range of relevant metrics. /// - /// \param [in] metrics: - /// Vector of strings for the metric(s) to be computed. /// \param [in] q_obs: /// 2D array of streamflow observations. /// shape: (1, time) /// \param [in] q_frc: /// 2D array of streamflow forecasts. /// shape: (members, time) + /// \param [in] metrics: + /// Vector of strings for the metric(s) to be computed. /// \param [in] q_thr (optional): /// 1D array of streamflow exceedance threshold(s). /// shape: (thresholds,) /// \return /// Vector of 2D array of metrics for each threshold. std::vector<xt::xtensor<double, 2>> evalp( - const std::vector<std::string>& metrics, const xt::xtensor<double, 2>& q_obs, const xt::xtensor<double, 2>& q_frc, + const std::vector<std::string>& metrics, const xt::xtensor<double, 1>& q_thr = {} ) { diff --git a/tests/test_determinist.cpp b/tests/test_determinist.cpp index 0d8fe65477f055f3a7565b793a7c007ab8f6307b..50aca4387b8817d98aa3be5b6d780d11ef7d80d2 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::evald<xt::xtensor<double, 2>>( - {"NSE"}, observed_2d, forecast_2d + observed_2d, forecast_2d, {"NSE"} ); std::vector<xt::xtensor<double, 1>> metrics_1d = evalhyd::evald<xt::xtensor<double, 1>>( - {"NSE"}, observed_1d, forecast_1d + observed_1d, forecast_1d, {"NSE"} ); // check results (both with 2D and 1D tensors) diff --git a/tests/test_probabilist.cpp b/tests/test_probabilist.cpp index 911c653c18a71873c1cbc4381b421184bc25fe69..49c7a749b8a593b5027af95fca2d589338b820e1 100644 --- a/tests/test_probabilist.cpp +++ b/tests/test_probabilist.cpp @@ -24,8 +24,8 @@ TEST(ProbabilistTests, TestBrier) { std::vector<xt::xtensor<double, 2>> metrics = evalhyd::evalp( - {"BS", "BSS", "BS_CRD", "BS_LBD"}, xt::transpose(observed), xt::transpose(forecast), + {"BS", "BSS", "BS_CRD", "BS_LBD"}, thresholds );