From d282d45a7f9fbdd75691439af61fbcbc2a8c5f56 Mon Sep 17 00:00:00 2001 From: Ben Davies Date: Tue, 10 Sep 2024 12:01:42 +1000 Subject: [PATCH] Fix convert_32_bit() logic for under & overflow checks. --- umpost/um2netcdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umpost/um2netcdf.py b/umpost/um2netcdf.py index b9f1e39..c680b6c 100644 --- a/umpost/um2netcdf.py +++ b/umpost/um2netcdf.py @@ -754,7 +754,8 @@ def convert_32_bit(cube): if _max > MAX_NP_INT32: msg = f"Converting {cube.var_name} causes a 32 bit overflow!" warnings.warn(msg, category=RuntimeWarning) - elif _min < MIN_NP_INT32: + + if _min < MIN_NP_INT32: msg = f"Converting {cube.var_name} causes a 32 bit underflow!" warnings.warn(msg, category=RuntimeWarning)