Registry / ai-ml / zfit-interface

zfit-interface

JSON →
library0.0.3pypypi✓ verified 22d ago

zfit-interface provides an abstraction layer to fit zfit models using external minimizers, currently supporting `iminuit`. It aims to offer a flexible interface for High Energy Physics (HEP) data fitting. This is an early-stage library, currently at version 0.0.3, with an irregular release cadence.

pip install zfit-interface
INSTALL
IMPORT
SIG · ZFIT-INTERFACE
Z
zfit-interface
ai-mlpythonv0.0.3
Install
3.7s avg
Import
Disk
90MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 90.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.000s · 86MB
90MB installed
● package 90MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Iminuit
from zfit_interface.minimizer import Iminuit
from zfit_interface.minimizer import Iminuit

This quickstart demonstrates how to define a zfit model and data, then use the `zfit-interface` to fit it with `iminuit`. It involves instantiating the `Iminuit` minimizer wrapper and the `ZfitMinuitFitter`.

import zfit from zfit.models import Gauss from zfit.spaces import Space from zfit_interface.minimizer import Iminuit from zfit_interface.fit import ZfitMinuitFitter # 1. Define a zfit model and data obs = Space('x', limits=(-10, 10)) mu = zfit.Parameter('mu', 0., -1., 1.) sigma = zfit.Parameter('sigma', 1., 0.1, 10.) gauss = Gauss(mu=mu, sigma=sigma, obs=obs) data = gauss.sample(n=1000) # 2. Instantiate the iminuit minimizer from zfit-interface minimizer = Iminuit() # 3. Create the zfit-interface fitter fitter = ZfitMinuitFitter(minimizer=minimizer) # 4. Perform the fit result = fitter.fit(model=gauss, data=data) print(f"Fit result: {result.params}") print(f"Minimizer status: {result.info['minuit_minos_status']}")
Debug
Known issues
breakingAs a 0.x.x version library, the API of `zfit-interface` is still under active development and may introduce breaking changes without strict adherence to semantic versioning until a 1.0.0 release.
fix
Refer to the GitHub repository and release notes for updates when upgrading to newer 0.x.x versions. Be prepared for potential API adjustments.
affects: All versions < 1.0.0
gotchaThis library is an 'interface' for `zfit` models, not a standalone fitting library. It requires `zfit` for model definition and `iminuit` (or other supported minimizers) for the actual minimization process. Users must install these dependencies separately.
fix
Ensure both `zfit` and `iminuit` are installed alongside `zfit-interface` using `pip install zfit iminuit`.
affects: All versions
gotchaThe documentation for `zfit-interface` is currently minimal. Users should be prepared to consult the source code and examples on the GitHub repository for detailed usage patterns and functionality.
fix
Refer directly to the official GitHub repository's `examples` directory and source code for the most up-to-date and complete usage information.
affects: All versions
Upgrade
Version history
0.0.3latest on PyPI · released Dec 1, 2021
Audit
Dependencies
zfitrequiredThis library provides an interface *to* zfit models; zfit is required for defining models.
iminuitrequiredThis library currently uses iminuit as its primary external minimizer, requiring it for fitting functionality.
Agent activity
38 hits · last 30 days
node
30
OpenAI (training)
1
Resources
zfit-interface — pip install zfit-interface · libregistry