pyhf to Combine converter
Tool to convert models from pyhf to CMS Combine and vise versa
This tool has been fully verified to produce the same model structure and expected yields, as well as to produce fits that are within 1% of the central value of each other. This has been done through the comparison of NLL plots, pull plots, and raw difference calculations.
Environment for Combine
In order to use the package, one must first create a docker container that is capable of running Combine. To do so, enter the following commands once you have Docker installed.
docker pull pyhf/pyhf-combine-converter:cmssw-11.2.0-python3
docker run --rm -ti -P --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined -e CVMFS_MOUNTS="cms.cern.ch oasis.opensciencegrid.org" pyhf/pyhf-combine-converter:cmssw-11.2.0-python3
If the docker container is running, but the Combine commands are not being mounted correctly, run the following commands within the container:
source /cvmfs/cms.cern.ch/cmsset_default.sh
cmsenv
Install
pyhf-combine-converter can be installed from PyPI. Inside of the Python environment containing Combine run
python3 -m pip install pyhf-combine-converter
Use
pyhf-combine-converter provides a CLI API for bidirectional conversion between pyhf and Combine.
Convert from pyhf to Combine
pyhf-to-combine $JSON_FILE_NAME --shape-file $SHAPES_FILE_NAME --out-datacard $DATACARD_FILE_NAME
Convert from Combine to pyhf
combine-to-pyhf $DATACARD_FILE_NAME --out-file $JSON_FILE_NAME
Any questions or issues should be referred to the docs/ folder, in which the translation is put into more detail.
Acknowledgements
This work was done as part of Peter Ridolfi's IRIS-HEP Fellow project which was supported by NSF
cooperative agreement OAC-1836650.
Metadata
Release files for pyhf-combine-converter 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyhf_combine_converter-0.0.5.tar.gz | 1.9 MB | Without provenance | Details for pyhf_combine_converter-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyhf_combine_converter-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for pyhf_combine_converter-0.0.5-py3-none-any.whl |
Total release size: 2.0 MB
Release files / pyhf_combine_converter-0.0.5.tar.gz
| Download URL | pyhf_combine_converter-0.0.5.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37667d7285a494804799e969f9cd00f79d6b39a3dc1c0f87020631edef30d8bf
|
|
BLAKE2b-256 checksum How to use checksums |
dd42115f0e583b01a291c7fa83a29f21341d51d79e490b76ef9d64335ffee9c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / pyhf_combine_converter-0.0.5-py3-none-any.whl
| Download URL | pyhf_combine_converter-0.0.5-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a96bfd5535fa3218b8ec6e2afd016fa64155b59c61828d281d1ab759a094bc81
|
|
BLAKE2b-256 checksum How to use checksums |
aea55684b6b62b682859384660b3b6ea4eb43fb827dd7645829636b29064f4da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for pyhf-combine-converter 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.