Skip to main content
cabinetry logo

CI status Documentation Status Codecov PyPI version Conda version Python version Code style: black

DOI Scikit-HEP

cabinetry is a Python library for building and steering binned template fits. It is written with applications in High Energy Physics in mind. cabinetry interfaces many other powerful libraries to make it easy for an analyzer to run their statistical inference pipeline.

Statistical models in HistFactory format can be built by cabinetry from instructions in a declarative configuration. cabinetry makes heavy use of pyhf for statistical inference, and provides additional utilities to help study and disseminate fit results. This includes commonly used visualizations. Due to its modular approach, analyzers are free to use all of cabinetry's functionality or only some pieces. cabinetry can be used for inference and visualization with any pyhf-compatible model, whether it was built with cabinetry or not.

Installation

cabinetry can be installed with pip:

python -m pip install cabinetry

This will only install the minimum requirements for the core part of cabinetry. The following will install additional optional dependencies needed for ROOT file reading:

python -m pip install cabinetry[contrib]

Hello world

To run the following example, first generate the input files via the script utils/create_ntuples.py.

import cabinetry

config = cabinetry.configuration.load("config_example.yml")

# create template histograms
cabinetry.templates.build(config)

# perform histogram post-processing
cabinetry.templates.postprocess(config)

# build a workspace
ws = cabinetry.workspace.build(config)

# run a fit
model, data = cabinetry.model_utils.model_and_data(ws)
fit_results = cabinetry.fit.fit(model, data)

# visualize the post-fit model prediction and data
prediction_postfit = cabinetry.model_utils.prediction(model, fit_results=fit_results)
cabinetry.visualize.data_mc(prediction_postfit, data, config=config)

The above is an abbreviated version of an example included in example.py, which shows how to use cabinetry. It requires additional dependencies obtained with pip install cabinetry[contrib].

Documentation

Find more information in the documentation and tutorial material in the cabinetry-tutorials repository. cabinetry is also described in a paper submitted to vCHEP 2021: 10.5281/zenodo.4627037.

Acknowledgements

NSF-1836650

This work was supported by the U.S. National Science Foundation (NSF) cooperative agreement OAC-1836650 (IRIS-HEP).

Release files for cabinetry 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cabinetry 0.6.0
File Size Uploaded
cabinetry-0.6.0.tar.gz 112.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cabinetry 0.6.0
File Interpreter ABI Platform
cabinetry-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 189.9 kB

Release files / cabinetry-0.6.0.tar.gz

Download URL cabinetry-0.6.0.tar.gz
Size 112.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a111fb3eb0a979555d39fda28ecc358ace6a4a052d31c52df9880d060c9a722c
BLAKE2b-256 checksum
How to use checksums
f3a3f2932aed22f1cd94a50ea6d3a7633c2ea4d1e023ce3f81830e8e02e4f4e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / cabinetry-0.6.0-py3-none-any.whl

Download URL cabinetry-0.6.0-py3-none-any.whl
Size 77.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d46eed76143e62e801b7245b96bdd6b89f775510491451bfd513a0d3db91e783
BLAKE2b-256 checksum
How to use checksums
27eeb347e8a8a174688296ecd6a400a364134738d14779334bc82429debfdfe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page