From fdd02b33d5b87a949373d1142b0d8f43e7a5b38b Mon Sep 17 00:00:00 2001
From: Thibault Hallouin <thibault.hallouin@inrae.fr>
Date: Fri, 24 Feb 2023 10:24:27 +0100
Subject: [PATCH] fix bug for some compilers with nansum on integer type

Checking the "nan-ness" of an integer is ill-posed, such that
the standard library of some compilers returns an error message.
Dropping the nan filter here for the sum is safe because `xt::equal`
evaluates to false when either operand is NAN.
---
 include/evalhyd/detail/probabilist/brier.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/evalhyd/detail/probabilist/brier.hpp b/include/evalhyd/detail/probabilist/brier.hpp
index 5e7e73d..e39e523 100644
--- a/include/evalhyd/detail/probabilist/brier.hpp
+++ b/include/evalhyd/detail/probabilist/brier.hpp
@@ -412,7 +412,7 @@ namespace evalhyd
                         );
 
                         // compute number of forecasts in each forecast bin $N_i$
-                        auto N_i = xt::eval(xt::nansum(msk_bins, -1));
+                        auto N_i = xt::eval(xt::sum(msk_bins, -1));
 
                         xt::view(REL_DIAG, xt::all(), xt::all(), m, e, xt::all(),
                                  xt::all(), 2) = N_i;
-- 
GitLab