Skip to content

Commit

Permalink
more protection against negative nans
Browse files Browse the repository at this point in the history
  • Loading branch information
20DM committed Mar 8, 2024
1 parent 9edc748 commit 4bacfc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hepdata_converter/writers/yoda_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4bacfc7

Please sign in to comment.