-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add v0.7.3 release notes (#2301)
* Forward port PR #2290 and #2294 from `release/v0.7.x` to `main`. * Add release notes for pyhf v0.7.3.
- Loading branch information
1 parent
ba730ce
commit 0189237
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|release v0.7.3|_ | ||
================= | ||
|
||
This is a patch release from ``v0.7.2`` → ``v0.7.3``. | ||
|
||
Fixes | ||
----- | ||
|
||
* Use :func:`numpy.prod` API over ``numpy.product`` as ``numpy.product`` is | ||
|np.product deprecation|_. | ||
(PR :pr:`2242`) | ||
* Guard :class:`pyhf.optimize.opt_minuit.minuit_optimizer` optimizer strategy | ||
from :obj:`None` to ensure :attr:`iminuit.Minuit.strategy` strategies | ||
are correctly handled. | ||
(PRs :pr:`2277`, :pr:`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. | ||
|
||
.. code:: python | ||
# 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``: | ||
|
||
.. code:: python | ||
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 | ||
|
||
.. |release v0.7.3| replace:: ``v0.7.3`` | ||
.. _`release v0.7.3`: https://github.com/scikit-hep/pyhf/releases/tag/v0.7.3 | ||
|
||
.. |np.product deprecation| replace:: deprecated as of NumPy ``v1.25.0`` | ||
.. _`np.product deprecation`: https://numpy.org/devdocs/release/1.25.0-notes.html#deprecations |