From 00b77a5e4d0c23c41d9dd63ee18ecfebcf203ec7 Mon Sep 17 00:00:00 2001 From: Jonas Eschle Date: Tue, 15 Oct 2024 18:25:56 -0400 Subject: [PATCH] docs: add pyhf compatibility --- CHANGELOG.rst | 1 + docs/api/static/zfit_physics.pyhf.rst | 32 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 docs/api/static/zfit_physics.pyhf.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5be70da..cb6f38d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Develop Major Features and Improvements ------------------------------- - `TF-PWA `_ support for loss functions. Minimizer can directly minimize the loss function of a model. +- `pyhf `_ support for loss functions. Minimizer can directly minimize the loss function of a model. Breaking changes ------------------ diff --git a/docs/api/static/zfit_physics.pyhf.rst b/docs/api/static/zfit_physics.pyhf.rst new file mode 100644 index 0000000..7a81322 --- /dev/null +++ b/docs/api/static/zfit_physics.pyhf.rst @@ -0,0 +1,32 @@ +pyhf +======================= + +The pure Python package `pyhf `_ is a statistical fitting package for high energy physics for purely binned, templated fits. It is a Python implementation of the HistFactory schema. +The connection to zfit is done via the loss function, which can be created from a pyhf model. + +Import the module with: + +.. code-block:: python + + import zfit_physics.pyhf as zpyhf + +The loss function can be created from a ``data`` and a ``pdf`` model with + +.. code-block:: python + + nll = zpyhf.loss.nll_from_pyhf(data, pdf) + + + +which optionally takes already created :py:class:~`zfit.core.interfaces.ZfitParameter` as arguments. + + + + +Loss +++++++++++++ + +.. automodule:: zfit_physics.pyhf.loss + :members: + :undoc-members: + :show-inheritance: