Skip to main content

simplify

CI status Documentation Status codecov PyPI version python version Code style: black

A package that creates simplified likelihoods from full likelihoods. Currently, only one form of simplified likelihoods is implemented, but the idea is to implement additional versions of the simplified likelihoods, such that varying degrees of simplification can be supported.

Installation

Follow good practice and start by creating a virtual environment

python3 -m venv simplify

and then activating it

source simplify/bin/activate

Default install

Install the package with pip

python3 -m pip install simplify-hep[contrib]

Development install

If you want to contribute to simplify, install the development version of the package. Fork the repository, clone the fork, and then install

python3 -m pip install --ignore-installed -U -e .[complete]

Next, setup the git pre-commit hook for Black

pre-commit install

You can run all the tests with

python3 -m pytest

How to run

CLI

Run with e.g.

simplify convert < fullLH.json > simplifiedLH.json

or e.g.

curl http://foo/likelihood.json | simplify convert

where fullLH.json is the full likelihood you want to convert into a simplified likelihood. Simplify is able to read/write from/to stdin/stdout.

In python script

You can also use simplify in a python script, e.g. to create some validation and cross-check plots and tables.

import pyhf
import json

import simplify

pyhf.set_backend(pyhf.tensorlib, "minuit")
spec = json.load(open("likelihood.json", "r"))

ws = pyhf.Workspace(spec) # ws from full LH

# get model and data for each ws we just created
model = ws.model(modifier_settings = {"normsys": {"interpcode": "code4"},"histosys": {"interpcode": "code4p"},})
data = ws.data(model)

# run fit
fit_result = simplify.fitter.fit(ws)

plt = simplify.plot.pulls(
    fit_result,
    "plots/"
)

plt = simplify.plot.correlation_matrix(
    fit_result,
    "plots/",
    pruning_threshold=0.1
)

tables = simplify.plot.yieldsTable(
    ws,
    "plots/",
    fit_result,
)

Dependencies

Naturally relies heavily on pyhf. Part of the code for plotting and validating results is inspired by Alexander Held's cabinetry.

Metadata

Release files for simplify-hep 0.1.5

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

Source distribution (sdist)

Source distribution for simplify-hep 0.1.5
File Size Uploaded Provenance Actions
simplify-hep-0.1.5.tar.gz 21.5 kB Without provenance Details for simplify-hep-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simplify-hep 0.1.5
File Interpreter ABI Platform Actions
simplify_hep-0.1.5-py3-none-any.whl Python 3 none any Details for simplify_hep-0.1.5-py3-none-any.whl

Total release size: 43.1 kB

Release files / simplify-hep-0.1.5.tar.gz

Download URL simplify-hep-0.1.5.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c87348cd0eca31967b798f2891a19bc994c3a4dae4b9fb75d4aef25fd746bc
BLAKE2b-256 checksum
How to use checksums
79b4991afd20401c7702b247a498204000c67e45e88e1df1e2fec4abcce6851d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

Release files / simplify_hep-0.1.5-py3-none-any.whl

Download URL simplify_hep-0.1.5-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b03ff8f45bd76b70730989a192f2aeafdf9b39cff4291d1b1870457de7dbe3ec
BLAKE2b-256 checksum
How to use checksums
f3a6444043d00fa52a57408b67ffc218f8c751f220609c2d64b159d7880fc0a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

Security for simplify-hep 0.1.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.

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