You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently struggling to use the hepdata_lib for cases with inhomogeneous error breakdowns across bins. For instance, I have a distribution with three bins where the first two bins have two error components 'A' and 'B' (but not 'C') and the third bin has error component 'C' (but not 'A' and 'B').
I know this is supported in principle, e.g. by just omitting the respective components in the dictionary. However, when using the library, it seems hepdata_lib/helpers.py raises a ValueError
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
PS - just to be clear: of course I can "make it pass" by just setting the uncertainty to zero, but then all bins will have three uncertainty components, some of them zero, which is not the same as the bin not having the component in its breakdown to begin with. I think the problem is that the check for "non-zero uncertainties" only checks if there's at least one non-zero component and then adds all of them, regardless of their value. Can we make this more flexible?
@20DM : I've moved your comments to a new issue. Indeed, hepdata_lib was designed to be simple and some more advanced features of the HEPData YAML format are not supported (for example, percentage uncertainties, #87). Yes, setting the missing components to zero is the workaround at the moment, but I see your point that this is not the same as omitting those components. I was going to suggest adding an option to the Uncertainty class to suppress zero uncertainties, then checking for this new option when constructing the errors in make_dict, but your solution in PR #265 looks better.
Originally posted by @20DM in #229 (comment)
Originally posted by @20DM in #229 (comment)
The text was updated successfully, but these errors were encountered: