v0.7.3
This is a patch release from v0.7.2
→ v0.7.3
.
Fixes
-
Use
np.prod
API overnp.product
asnp.product
is deprecated as of NumPyv1.25.0
. (PR #2242) -
Guard
pyhf.optimize.opt_minuit.minuit_optimizer
optimizer strategy fromNone
to ensureiminuit.Minuit.strategy
strategies are correctly handled. (PRs #2277, #2278)The fixed bug was subtle and only occurred for specific configurations of settings and arguments where
do_grad=False
was used (either explicitly by provided kwarg or implicitly through defaults). To determine if you might have been affected by it, check your code for setups like the following.# Bug is backend independent. JAX is selected as an example where # do_grad=False might be selected in response to the backend's value of # pyhf.tensorlib.default_do_grad being True. pyhf.set_backend("jax", pyhf.optimize.minuit_optimizer(strategy=0)) ... fit_result, opt_result = pyhf.infer.mle.fit( data, model, return_result_obj=True, do_grad=False ) assert opt_result.minuit.strategy.strategy == 0 # fails for pyhf v0.7.2
Full example that fails in
pyhf
v0.7.2
:import pyhf pyhf.set_backend("jax", pyhf.optimize.minuit_optimizer(strategy=0)) model = pyhf.simplemodels.uncorrelated_background( signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0] ) data = [51, 48] + model.config.auxdata # passing with strategy kwarg explicitly given fit_result, opt_result = pyhf.infer.mle.fit( data, model, return_result_obj=True, do_grad=False, strategy=0 ) minuit_strategy = opt_result.minuit.strategy.strategy print(f"# Minuit minimization strategy: {minuit_strategy}") assert minuit_strategy == 0 # strategy kwarg not given fit_result, opt_result = pyhf.infer.mle.fit( data, model, return_result_obj=True, do_grad=False ) minuit_strategy = opt_result.minuit.strategy.strategy print(f"# Minuit minimization strategy: {minuit_strategy}") assert minuit_strategy == 0 # fails for pyhf v0.7.2
Contributors
v0.7.3
benefited from contributions from:
- Alexander Held
- Daniel Werner
What's Changed
- fix(backport): Pass script_runner commands as a single sequence by @matthewfeickert in #2222
- docs(backport): Add sphinx_rtd_theme to extensions by @matthewfeickert in #2223
- ci(backport): Update GitHub Actions workflows by @matthewfeickert in #2279
- fix: Support JAX array API before and after JAX v0.4.1 by @matthewfeickert in #2280
- docs(backport): Update docs build requirements by @matthewfeickert in #2281
- chore(backport): Move to using Ruff for pre-commit by @matthewfeickert in #2282
- chore(backport): Update pre-commit hooks by @matthewfeickert in #2283
- fix(backport): Replace deprecated np.product by np.prod by @matthewfeickert in #2284
- docs(backport): Update use citations by @matthewfeickert in #2285
- docs(backport): Use SVG version of logo for docs by @matthewfeickert in #2286
- feat(backport): Use non-root default user for Docker image by @matthewfeickert in #2287
- fix(backport): Guard Minuit optimizer against provided strategy of None by @matthewfeickert in #2288
- docs: Add v0.7.3 release notes by @matthewfeickert in #2290
- docs(backport): Update models and journal publication citations by @matthewfeickert in #2295
- docs: Add v0.7.2 failing example to v0.7.3 release notes by @matthewfeickert in #2294
Full Changelog: v0.7.2...v0.7.3