Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inhomogenous error breakdowns #265

Merged
merged 7 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hepdata_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@
# if at least one of the uncertainties is not zero.
if nonzero_uncs[i]:
for unc in self.uncertainties:
if unc.values[i] is None:
continue

Check warning on line 281 in hepdata_lib/__init__.py

View check run for this annotation

Codecov / codecov/patch

hepdata_lib/__init__.py#L281

Added line #L281 was not covered by tests
if unc.is_symmetric:
valuedict['errors'].append({
"symerror":
Expand Down
3 changes: 2 additions & 1 deletion hepdata_lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def any_uncertainties_nonzero(uncertainties, size):
for unc in uncertainties:

# Treat one-sided uncertainties as
values = np.array(unc.values)
tmp = 0 if unc.is_symmetric else (0,0)
values = np.array([tmp if v is None else v for v in unc.values])
values[values.astype(str)==''] = 0
values = values.astype(float)

Expand Down
Loading