Skip to content

Commit

Permalink
Merge pull request #54 from 20DM/patch_for_none_errors
Browse files Browse the repository at this point in the history
YODA writer: Skip ill-defined error components
  • Loading branch information
GraemeWatt committed Dec 5, 2023
2 parents 885629e + a8bf671 commit 26658e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hepdata_converter/writers/yoda_writer.py
Expand Up @@ -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):
Expand Down

0 comments on commit 26658e4

Please sign in to comment.