From 4bacfc7bb8ff7f90938d7debe7ef6479d32ce522 Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Thu, 7 Mar 2024 19:19:17 -0500 Subject: [PATCH] more protection against negative nans --- hepdata_converter/writers/yoda_writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hepdata_converter/writers/yoda_writer.py b/hepdata_converter/writers/yoda_writer.py index 909a69e..d936851 100644 --- a/hepdata_converter/writers/yoda_writer.py +++ b/hepdata_converter/writers/yoda_writer.py @@ -153,7 +153,8 @@ def _create_estimate(self): if idx not in global_indices: global_indices.append(idx) # construct Estimate - rtn.bin(idx).setVal(self.yval[i]) + y = abs(self.yval[i]) if math.isnan(self.yval[i]) else self.yval[i] + rtn.bin(idx).setVal(y) self._set_error_breakdown(i, rtn.bin(idx)) del global_indices return rtn