From 58668446cd307de494e4465fec3bd68e26efb88d Mon Sep 17 00:00:00 2001 From: Thibault Hallouin <thibault.hallouin@inrae.fr> Date: Tue, 17 Jan 2023 13:30:33 +0100 Subject: [PATCH] fix wrong check to allow condition on streamflow predictions --- include/evalhyd/detail/masks.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/evalhyd/detail/masks.hpp b/include/evalhyd/detail/masks.hpp index 99c815e..daee3e2 100644 --- a/include/evalhyd/detail/masks.hpp +++ b/include/evalhyd/detail/masks.hpp @@ -21,7 +21,6 @@ #include "maths.hpp" -namespace eh = evalhyd; typedef std::map<std::string, std::vector<std::vector<std::string>>> msk_tree; @@ -205,7 +204,7 @@ namespace evalhyd } else if (var == "q_prd_median") { - if (q_prd.size() < 1) + if (q_prd.shape(0) == 1) { throw std::runtime_error( "condition on streamflow predictions " @@ -219,7 +218,7 @@ namespace evalhyd else { // i.e. (var == "q_prd_mean") - if (q_prd.size() < 1) + if (q_prd.shape(0) == 1) { throw std::runtime_error( "condition on streamflow predictions " @@ -251,7 +250,7 @@ namespace evalhyd } else // (str == "quantile") { - return eh::maths::quantile(q, std::stod(num)); + return evalhyd::maths::quantile(q, std::stod(num)); } }; -- GitLab