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 breaks with HistoPath including filename #2487

Open
1 task done
alexander-held opened this issue May 27, 2024 · 2 comments
Open
1 task done

xml2json breaks with HistoPath including filename #2487

alexander-held opened this issue May 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working schema and spec JSON schema

Comments

@alexander-held
Copy link
Member

alexander-held commented May 27, 2024

Summary

I ran into a setup I hadn't seen previously that seems to break pyhf xml2json. As far as I can tell, cases like the following are problematic:

<Data HistoName="tt1b_1l_data_regBin" InputFile="Fit_1l_combined_Fit_1l_model_428.root" HistoPath="Fit_1l_combined_Fit_1l_model_428.root:/tt1b_1l_hists/data/"  />

Note how HistoPath includes intra-file navigation. The hist2workspace CLI in ROOT seems to handle this fine. I am not sure if this is following intended specification or not and if hist2workspace not crashing is a coincidence or not. The conversion script looks at Fit_1l_combined_Fit_1l_model_428.root:/tt1b_1l_hists/data/ but would need to look at tt1b_1l_hists/data/ in the file, stripping out the file name.

I do not have a minimal public setup to reproduce, please feel free to ping me here and I can put one together (just opening this issue before I forget so we can track it).

OS / Environment

n/a

Steps to Reproduce

n/a

File Upload (optional)

No response

Expected Results

successful conversion

Actual Results

KeyError: 'Both tt_light_1l_data_regBin and Fit_1l_combined_Fit_1l_model_428.root:/tt_light_1l_hists/data/tt_light_1l_data_regBin were tried and not found in [...]/Fit_1l_combined_Fit_1l_model_428.root'

pyhf Version

f561f867f1327ccfa8e631885d28e87863930d8b (newer than v0.7.6)

Code of Conduct

  • I agree to follow the Code of Conduct
@alexander-held alexander-held added bug Something isn't working needs-triage Needs a maintainer to categorize and assign labels May 27, 2024
@alexander-held alexander-held changed the title xml2json breaks with HistoPath xml2json breaks with HistoPath including filename May 27, 2024
@kratsg
Copy link
Contributor

kratsg commented May 27, 2024

I have never seen HistoPath defined this way. If that's the case, then it's gonna need the ability to split at a colon : and then switch out the filename and substitute. If we have a MWE XML+ROOT we can add to this repository, can add a test to cover and make a quick fix.

@kratsg kratsg self-assigned this May 27, 2024
@kratsg kratsg added schema and spec JSON schema and removed needs-triage Needs a maintainer to categorize and assign labels May 27, 2024
@alexander-held
Copy link
Member Author

I have not managed to reproduce this again unfortunately. My best guess at the moment is that it must have been some issue on my end with an accidental search & replace that caused this across the xmls. Given that we can probably close this. If I run into this again I can always come back with a reproducer.

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

No branches or pull requests

2 participants