Release Notes¶
v0.6.2¶
This is a patch release from v0.6.1 → v0.6.2.
Important Notes¶
The
pyhf.simplemodels.hepdata_like()API has been deprecated in favor ofpyhf.simplemodels.uncorrelated_background(). Thepyhf.simplemodels.hepdata_like()API will be removed inpyhfv0.7.0. (PR #1438)There is a small breaking API change for
pyhf.contrib.viz.brazil.plot_results(). See the Python API changes section for more information.The
pyhf.patchset.PatchSetschema now allows string types for patch values in patchsets. (PR #1488)Only lower bounds on core dependencies are now set. This allows for greater developer freedom and reduces the risk of breaking user’s applications by unnecessarily constraining libraries. This also means that users will be responsible for ensuring that their installed dependencies do not conflict with or break
pyhf. c.f. Hynek Schlawack’s blog post Semantic Versioning Will Not Save You for more in-depth coverage on this topic. For most users nothing should change. This mainly affects developers of other libraries in whichpyhfis a dependency. (PR #1382)Calling
dir()on anypyhfmodule or trying to tab complete an API will now provide a more helpfully restricted view of the available APIs. This should help provide better exploration of thepyhfAPI. (PR #1403)Docker images of releases are now published to both Docker Hub and to the GitHub Container Registry. (PR #1444)
CUDA enabled Docker images are now available for release
v0.6.1and later on Docker Hub and the GitHub Container Registry. Visit github.com/pyhf/cuda-images for more information.
Fixes¶
Allow for precision to be properly set for the tensorlib
onesandzerosmethods through adtypeargument. This allows for precision to be properly set through thepyhf.set_backend()precisionargument. (PR #1369)The default precision for all backends is now
64b. (PR #1400)Add check to ensure that POIs are not fixed during a fit. (PR #1409)
Parameter name strings are now normalized to remove trailing spaces. (PR #1436)
The logging level is now not automatically set in
pyhf.contrib.utils. (PR #1460)
Features¶
Python API¶
The
pyhf.simplemodels.hepdata_like()API has been deprecated in favor ofpyhf.simplemodels.uncorrelated_background(). Thepyhf.simplemodels.hepdata_like()API will be removed inpyhfv0.7.0. (PR #1438)The
pyhf.simplemodels.correlated_background()API has been added to provide an example model with a single channel with a correlated background uncertainty. (PR #1435)Add CLs component plotting kwargs to
pyhf.contrib.viz.brazil.plot_results(). This allows CLs+b and CLb components of the CLs ratio to be plotted as well. To be more consistent with thematplotlibAPI,pyhf.contrib.viz.brazil.plot_results()now returns a lists of the artists drawn on the axis and moves theaxarguments to the to the last argument. (PR #1377)The
pyhf.compatmodule has been added to aid in translating to and from ROOT names. (PR #1439)
v0.6.1¶
This is a patch release from v0.6.0 → v0.6.1.
Important Notes¶
As a result of changes to the default behavior of
torch.distributionsin PyTorchv1.8.0, accommodating changes have been made in the underlying implementations forpyhf.tensor.pytorch_backend.pytorch_backend(). These changes require a new lower bound oftorchv1.8.0for use of the PyTorch backend.
Fixes¶
In the PyTorch backend the
validate_argskwarg is used withtorch.distributionsto ensure a continuous approximation of the Poisson distribution intorchv1.8.0+.
Features¶
Python API¶
The
solver_optionskwarg can be passed to thepyhf.optimize.opt_scipy.scipy_optimizer()optimizer for additional configuration of the minimization. Seescipy.optimize.show_options()for additional options of optimization solvers.The
torchAPI is now used to provide the implementations of theravel,tile, andoutertensorlib methods for the PyTorch backend.
v0.6.0¶
This is a minor release from v0.5.4 → v0.6.0.
Important Notes¶
Please note this release has API breaking changes and carefully read these notes while updating your code to the
v0.6.0API. Perhaps most relevant is the changes to thepyhf.infer.hypotest()API, which now uses acalctypeargument to differentiate between using an asymptotic calculator or a toy calculator, and atest_statkwarg to specify which test statistic the calculator should use, with'qtilde', corresponding topyhf.infer.test_statistics.qmu_tilde(), now the default option. It also relies more heavily on using kwargs to pass options through to the optimizer.Following the recommendations of NEP 29 — Recommend Python and NumPy version support as a community policy standard
pyhfv0.6.0drops support for Python 3.6. PEP 494 – Python 3.6 Release Schedule also notes that Python 3.6 will be end of life in December 2021, sopyhfis moving forward with a minimum required runtime of Python 3.7.Support for the discovery test statistic, \(q_{0}\), has now been added through the
pyhf.infer.test_statistics.q0()API.Support for pseudoexperiments (toys) has been added through the
pyhf.infer.calculators.ToyCalculator()API. Please see the corresponding example notebook for more detailed exploration of the API.The
minuitextra,python -m pip install pyhf[minuit], now uses and requires theiminuitv2.Xrelease series and API. Note thatiminuitv2.Xcan result in slight differences in minimization results fromiminuitv1.X.The documentation will now be versioned with releases on ReadTheDocs. Please use pyhf.readthedocs.io to access the documentation for the latest stable release of
pyhf.pyhfis transtioning away from Stack Overflow to GitHub Discussions for resolving user questions not covered in the documentation. Please check the GitHub Discussions page to search for discussions addressing your questions and to open up a new discussion if your question is not covered.pyhfhas published a paper in the Journal of Open Source Software.Please make sure to include the paper reference in all citations of
pyhf, as documented in the Use and Citations section of the documentation.
Fixes¶
Fix bug where all extras triggered warning for installation of the
contribextra.float-like values are used in division forpyhf.writexml().Model.specnow supports building new models from existing models.\(p\)-values are now reported based on their quantiles, instead of interpolating test statistics and converting to \(p\)-values.
Namespace collisions between
uproot3anduproot/uproot4have been fixed for thexmlioextra.The
normsysmodifier now uses thepyhf.interpolators.code4interpolation method by default.The
histosysmodifier now uses thepyhf.interpolators.code4pinterpolation method by default.
Features¶
Python API¶
The
tensorlibAPI now supports atensorlib.to_numpyandtensorlib.ravelAPI.The
pyhf.infer.calculators.ToyCalculator()API has been added to support pseudoexperiments (toys).The empirical test statistic distribution API has been added to help support the
ToyCalculatorAPI.Add a
tolerancekwarg to the optimizer API to set afloatvalue as a tolerance for termination of the fit.The
pyhf.optimize.opt_minuit.minuit_optimizer()optimizer now can return correlations of the fitted parameters through use of thereturn_correlationBoolean kwarg.Add the
pyhf.utils.citationAPI to get astrof the preferred BibTeX entry for citation of the version ofpyhfinstalled. See the example for the CLI API for more information.The
pyhf.infer.hypotest()API now uses acalctypeargument to differentiate between using an asymptotic calculator or a toy calculator, and atest_statkwarg to specify which test statistic to use. It also relies more heavily on using kwargs to pass options through to the optimizer.The default
test_statkwarg forpyhf.infer.hypotest()and the calculator APIs is'qtilde', which corresponds to the alternative test statisticpyhf.infer.test_statistics.qmu_tilde().The return type of \(p\)-value like functions is now a 0-dimensional
tensor(with shape()) instead of afloat. This is required to support end-to-end automatic differentiation in future releases.
CLI API¶
The CLI API now supports a
--citationor--citeoption to print the preferred BibTeX entry for citation of the version ofpyhfinstalled.
$ pyhf --citation
@software{pyhf,
author = {Lukas Heinrich and Matthew Feickert and Giordon Stark},
title = "{pyhf: v0.6.0}",
version = {0.6.0},
doi = {10.5281/zenodo.1169739},
url = {https://doi.org/10.5281/zenodo.1169739},
note = {https://github.com/scikit-hep/pyhf/releases/tag/v0.6.0}
}
@article{pyhf_joss,
doi = {10.21105/joss.02823},
url = {https://doi.org/10.21105/joss.02823},
year = {2021},
publisher = {The Open Journal},
volume = {6},
number = {58},
pages = {2823},
author = {Lukas Heinrich and Matthew Feickert and Giordon Stark and Kyle Cranmer},
title = {pyhf: pure-Python implementation of HistFactory statistical models},
journal = {Journal of Open Source Software}
}
Contributors¶
v0.6.0 benefited from contributions from:
Alexander Held
Marco Gorelli
Pradyumna Rahul K
Eric Schanet
Henry Schreiner
v0.5.4¶
This is a patch release from v0.5.3 → v0.5.4.
Fixes¶
Require
uproot3instead ofuprootv3.Xreleases to avoid conflicts whenuproot4is installed in an environment withuprootv3.Xinstalled and namespace conflicts withuproot-methods. Adoption ofuproot3inv0.5.4will ensurev0.5.4works far into the future if XML and ROOT I/O through uproot is required.
Example:
Without the v0.5.4 patch release there is a regression in using uproot v3.X
and uproot4 in the same environment (which was swiftly identified and patched by the
fantastic uproot team)
$ python -m pip install "pyhf[xmlio]<0.5.4"
$ python -m pip list | grep "pyhf\|uproot"
pyhf 0.5.3
uproot 3.13.1
uproot-methods 0.8.0
$ python -m pip install uproot4
$ python -m pip list | grep "pyhf\|uproot"
pyhf 0.5.3
uproot 4.0.0
uproot-methods 0.8.0
uproot4 4.0.0
this is resolved in v0.5.4 with the requirement of uproot3
$ python -m pip install "pyhf[xmlio]>=0.5.4"
$ python -m pip list | grep "pyhf\|uproot"
pyhf 0.5.4
uproot3 3.14.1
uproot3-methods 0.10.0
$ python -m pip install uproot4 # or uproot
$ python -m pip list | grep "pyhf\|uproot"
pyhf 0.5.4
uproot 4.0.0
uproot3 3.14.1
uproot3-methods 0.10.0
uproot4 4.0.0
v0.5.3¶
This is a patch release from v0.5.2 → v0.5.3.
Fixes¶
Workspaces are now immutable
ShapeFactor support added to XML reading and writing
An error is raised if a fit initialization parameter is outside of its bounds (preventing hypotest with POI outside of bounds)
Features¶
Python API¶
Inverting hypothesis tests to get upper limits now has an API with
pyhf.infer.intervals.upperlimitBuilding workspaces from a model and data added with
pyhf.workspace.build
CLI API¶
Added CLI API for
pyhf.infer.fit:pyhf fitpyhf combine now allows for merging channels:
pyhf combine --merge-channels --join <join option>Added utility to download archived pyhf pallets (workspaces + patchsets) to contrib module:
pyhf contrib download