From a8bf6715dad08f1aeef041ee7914f67c1f0047bb Mon Sep 17 00:00:00 2001 From: Christian Gutschow Date: Sat, 2 Dec 2023 14:25:23 +0000 Subject: [PATCH] skip ill-defined error components --- hepdata_converter/writers/yoda_writer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hepdata_converter/writers/yoda_writer.py b/hepdata_converter/writers/yoda_writer.py index 822458c..beb63e6 100644 --- a/hepdata_converter/writers/yoda_writer.py +++ b/hepdata_converter/writers/yoda_writer.py @@ -42,13 +42,14 @@ def _set_error_breakdown(self, idx, estimate): return errs = self.err_breakdown[idx] nSources = len(errs.keys()) - for source in errs: + for source, vals in errs.items(): + if not vals: continue label = source if label.upper() == "TOTAL" or \ (nSources == 1 and source == 'error'): label = '' # total uncertainty - errUp = errs[source]['up'] - errDn = errs[source]['dn'] + errUp = vals['up'] + errDn = vals['dn'] estimate.setErr([errDn, errUp], label) def _create_estimate(self):