From 1b062e15d409447bde2138c67484b6b55b21f847 Mon Sep 17 00:00:00 2001
From: Thibault Hallouin <thibault.hallouin@inrae.fr>
Date: Mon, 16 Jan 2023 11:11:58 +0100
Subject: [PATCH] add missing check on threholds site dimension

---
 include/evalhyd/evalp.hpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/evalhyd/evalp.hpp b/include/evalhyd/evalp.hpp
index d4e107e..54d8557 100644
--- a/include/evalhyd/evalp.hpp
+++ b/include/evalhyd/evalp.hpp
@@ -257,6 +257,18 @@ namespace evalhyd
                     "numbers of sites"
             );
         }
+
+        if (q_thr_.size() > 0)
+        {
+            if (q_obs_.shape(0) != q_thr_.shape(0))
+            {
+                throw std::runtime_error(
+                        "observations and thresholds feature different "
+                        "numbers of sites"
+                );
+            }
+        }
+
         if (t_msk_.size() > 0)
         {
             if (q_obs_.shape(0) != t_msk_.shape(0))
-- 
GitLab