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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 90.1MB
glibcpy 3.10–3.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.fixRefer 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.fixEnsure 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.fixRefer 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.