-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
feat/enhancementNew feature or requestNew feature or request
Description
Summary
As it turns out, the HistFactory XML spec allows for <Channel /> with no <Data />. In those cases, it seems that Asimov data is used instead.
We don't currently do this in pyhf. Actually, we haven't run into a spec from a user yet where <Data/> was missing so we never caught the uncovered case that I found in readxml.py as part of #1909 while I'm adding typehints there. Specifically:
Lines 229 to 233 in acde7f4
| data = channel.findall('Data') | |
| if data: | |
| parsed_data = process_data(data[0], rootdir, inputfile, histopath) | |
| else: | |
| parsed_data = None |
parsed_data = None can happen which means that when we write out the observations, we will have 'data': None which is not allowed by the HiFa JSON spec right now (but it technically should be).
In the situation when there's no data for a channel, we should probably generate asimov data for it, but this feels very "magical" to me, but maybe functionality users will want, even if it appears that most frameworks (exporting to XML+ROOT) are not using this right now.
Additional Information
Code of Conduct
- I agree to follow the Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat/enhancementNew feature or requestNew feature or request