scikit-hep / pyhf

pure-Python HistFactory implementation with tensors and autodiff
https://pyhf.readthedocs.io/
Apache License 2.0
279 stars 83 forks source link

spec: add "type: histfactory" to likelihood JSON #740

Open lukasheinrich opened 4 years ago

lukasheinrich commented 4 years ago

Description

HepData may start hosting different types of likelihoods in different formats, it might be nice to be explicit / self-explanatory what type of likelihood one is looking at

{
"version": "1.0.0",
"type": "histfactory",
...
}

would be cool.. maybe even we can make this be JSON-LD at some point?

matthewfeickert commented 4 years ago

HepData may start hosting different types of likelihoods in different formats

I noticed that in the drat report from the LHC Re-Interpretation Forum Report draft that was emailed around today (also nice job on Section 2.4 @lukasheinrich). :slightly_smiling_face:

it might be nice to be explicit / self-explanatory what type of likelihood one is looking at

{
"version": "1.0.0",
"type": "histfactory",
...
}

would be cool.. maybe even we can make this be JSON-LD at some point?

This would be really cool! Correct me if I'm wrong, but this could get added in right now and then the next time we bump the JSON schema version number we can make it a requirement for that schema version(?).

kratsg commented 4 years ago

This would be really cool! Correct me if I'm wrong, but this could get added in right now and then the next time we bump the JSON schema version number we can make it a requirement for that schema version(?).

Yes. Add a 2.0.0, copy over the files -- make the change, bump the version, keep it at 1.0.0 in the utils and we should be ok for now. Likely, we'll need to make our tools grab the version from the spec and use that as the default if the user doesn't override it. Then we don't need to maintain a default in our code and just handle the translation by version.