From 1cb0a4eac3042772e3f38c2e59177dae692f79f1 Mon Sep 17 00:00:00 2001 From: Chiel van Heerwaarden Date: Wed, 21 Jun 2023 17:01:12 +0200 Subject: [PATCH] Make rfmip fail if the reference data is empty or corrupted. --- examples/rfmip-clear-sky/compare-to-reference.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/rfmip-clear-sky/compare-to-reference.py b/examples/rfmip-clear-sky/compare-to-reference.py index de6cc05bf..3f7b0c629 100755 --- a/examples/rfmip-clear-sky/compare-to-reference.py +++ b/examples/rfmip-clear-sky/compare-to-reference.py @@ -37,6 +37,9 @@ failed = False for v in variables: + if np.any(np.isnan(ref.variables[v].values)): + raise Exception( + v + ": some ref values are missing. Now that is strange.") if np.all(np.isnan(tst.variables[v].values)): raise Exception( v + ": all test values are missing. Were the tests run?")