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

xml2json not working with empty/missing <Data> which should be optional #618

Open
3 tasks done
beojan opened this issue Oct 21, 2019 · 9 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@beojan
Copy link
Contributor

beojan commented Oct 21, 2019

Description

xml2json isn't working. With a single channel file, an empty skeleton is returned:

╭─   beojan   ~/DPhil/hh4b/Resolved/Limits                                                                                                                         SIGINT(2) ↵  54.75M   11:59:30 
╰─ pyhf xml2json meas_scalar_251_xml/Measurement_resolved_4b_2017.xml
0channel [00:00, ?channel/s]
{
    "channels": [],
    "measurements": [],
    "observations": [],
    "version": "1.0.0"
}

With the multi channel file, I get an IsADirectoryError:

IsADirectoryError: [Errno 21] Is a directory: '/home/beojan/DPhil/hh4b/Resolved/Limits/'

Expected Behavior

In each case, JSON would be returned describing the full model.

Actual Behavior

An empty JSON skeleton is returned, or an IsADirectoryError is thrown.

Steps to Reproduce

  1. Write a HistFactory measurement to a ROOT file with meas.writeToFile
  2. Load this file in a new ROOT session and write the XML: meas->PrintXML("meas")
  3. Attempt to convert to JSON: pyhf xml2json meas/meas.xml

PyHF is installed into an empty virtualenv with Python 3.7.4. The PyHF version is 0.1.2, but the problem also appears after installing from git master.

Checklist

  • Run git fetch to get the most up to date version of master
  • Searched through existing Issues to confirm this is not a duplicate issue
  • Filled out the Description, Expected Behavior, Actual Behavior, and Steps to Reproduce sections above or have edited/removed them in a way that fully describes the issue
@lukasheinrich
Copy link
Contributor

thanks @beojan for the report. Can you make the XML and ROOT files available somewhere public (for a toy example there should not be any access issues, no need to use a ATLAS internal example) ? We can then debug. Probably it's some detail that we're not covering for that specific measurement.

@beojan
Copy link
Contributor Author

beojan commented Oct 21, 2019

Attached. I generated dummy data, but the structure is the same. Beware, there's no top level directory in this file, just a ROOT file and the XML file.

test.tar.gz

@beojan
Copy link
Contributor Author

beojan commented Oct 21, 2019

The combination XML is also attached here.
Measurement.xml.txt

In the combination case, the XML doesn't even load, so it's probably not a problem with the specific measurement.

@lukasheinrich
Copy link
Contributor

lukasheinrich commented Oct 21, 2019

Hi, @beojan, the reason is that InputFile is empty for the <Data> section. Is this intentional? (could be related to #566 )

@beojan
Copy link
Contributor Author

beojan commented Oct 21, 2019

Yes, because the measurement is blinded (I'm just looking for expected limits).

@lukasheinrich
Copy link
Contributor

lukasheinrich commented Oct 21, 2019 via email

@beojan
Copy link
Contributor Author

beojan commented Oct 21, 2019 via email

@kratsg kratsg added the bug Something isn't working label Oct 21, 2019
@kratsg kratsg changed the title xml2json not working with files produced by PrintXML xml2json not working with empty/missing <Data> which should be optional Oct 7, 2020
@kratsg
Copy link
Contributor

kratsg commented Oct 7, 2020

./cc @alexander-held who ran into this issue as well.

@alexander-held
Copy link
Member

related: #566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants