diff --git a/include/evalhyd/evalp.hpp b/include/evalhyd/evalp.hpp index ce9d8e02f2ad737d536c33171d904ab0bfeea100..3263d26388fa9504254fc61d0a7cee868a8c500c 100644 --- a/include/evalhyd/evalp.hpp +++ b/include/evalhyd/evalp.hpp @@ -100,7 +100,7 @@ namespace evalhyd ); // check that optional parameters are given as arguments - eh::utils::check_optionals(metrics, q_thr); + eh::utils::evalp::check_optionals(metrics, q_thr); // check that data dimensions are compatible // > time diff --git a/src/utils.hpp b/src/utils.hpp index 863763939b2b57b27c83cdc9696f6917348d761e..5efbceec1640d2969caa8ce9bb6fc5dd21eadceb 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -92,30 +92,33 @@ namespace evalhyd } } - /// Procedure to check that optional parameters are provided - /// as arguments when required metrics need them. - /// - /// \param [in] metrics: - /// Vector of strings for the metric(s) to be computed. - /// \param [in] thresholds: - /// Array of thresholds for metrics based on exceedance events. - inline void check_optionals ( - const std::vector<std::string>& metrics, - const xt::xtensor<double, 1>& thresholds - ) + namespace evalp { - std::vector<std::string>threshold_metrics = - {"BS", "BS_CRD", "BS_LBD", "BSS"}; - - for (const auto& metric : metrics) + /// Procedure to check that optional parameters are provided + /// as arguments when required metrics need them. + /// + /// \param [in] metrics: + /// Vector of strings for the metric(s) to be computed. + /// \param [in] thresholds: + /// Array of thresholds for metrics based on exceedance events. + inline void check_optionals ( + const std::vector<std::string>& metrics, + const xt::xtensor<double, 1>& thresholds + ) { - if (std::find(threshold_metrics.begin(), threshold_metrics.end(), - metric) != threshold_metrics.end()) - if (thresholds.size() < 1) - throw std::runtime_error( - "missing thresholds *q_thr* required to " - "compute " + metric - ); + std::vector<std::string>threshold_metrics = + {"BS", "BS_CRD", "BS_LBD", "BSS"}; + + for (const auto& metric : metrics) + { + if (std::find(threshold_metrics.begin(), threshold_metrics.end(), + metric) != threshold_metrics.end()) + if (thresholds.size() < 1) + throw std::runtime_error( + "missing thresholds *q_thr* required to " + "compute " + metric + ); + } } } }