Skip to main content

A package to translate between pyhf and Combine models

Reason this release was yanked:

broken CLI API

Project description

pyhf to Combine converter

Tool to convert models from pyhf to CMS Combine and vise versa

DOI

PyPI version

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. NSF Award Number

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhf_combine_converter-0.0.4.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

pyhf_combine_converter-0.0.4-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pyhf_combine_converter-0.0.4.tar.gz.

File metadata

File hashes

Hashes for pyhf_combine_converter-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a663ffad842f4fbe5781699ea612ad7cfe79975839f76cd503c2134face45493
MD5 4dd48fcfb094af40a167e1e1b254de95
BLAKE2b-256 ba2ea826d0a39375df556480a44055e92a1c0f89ed7028169fcd39f03afc5fbb

See more details on using hashes here.

File details

Details for the file pyhf_combine_converter-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pyhf_combine_converter-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a2d88f9f3d25617c8e6a3d9ad2d1d261a046ddbd496b09a6362620cade1a0926
MD5 d003e426218dce2246278adcbf0d4983
BLAKE2b-256 4f2b55701fcc44ccd30185a22d3ec67f13f144832e868da45bd91e84db5b5557

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page