Skip to content

v0.6.0

Compare
Choose a tag to compare
@matthewfeickert matthewfeickert released this 16 Feb 00:46

This is a minor release from v0.5.4v0.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.0 API. Perhaps most relevant is the changes to the pyhf.infer.hypotest API, which now uses a calctype argument to differentiate between using an asymptotic calculator or a toy calculator, and a test_stat kwarg to specify which test statistic the calculator should use, with 'qtilde', corresponding to pyhf.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 pyhf v0.6.0 drops 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, so pyhf is moving forward with a minimum required runtime of Python 3.7.
  • Support for the discovery test statistic, q0, 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 minuit extra, python -m pip install pyhf[minuit], now uses and requires the iminuit v2.X release series and API. Note that iminuit v2.X can result in slight differences in minimization results from iminuit v1.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.
  • pyhf is transitioning 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.
  • pyhf has published a paper in the Journal of Open Source Software. JOSS DOI 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 contrib extra.
  • float-like values are used in division for pyhf.writexml.
  • Model.spec now 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 uproot3 and uproot/uproot4 have been fixed for the xmlio extra.
  • The normsys modifier now uses the pyhf.interpolators.code4 interpolation method by default.
  • The histosys modifier now uses the pyhf.interpolators.code4p interpolation method by default.

Features

Python API

  • The tensorlib API now supports a tensorlib.to_numpy and tensorlib.ravel API.
  • 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 ToyCalculator API.
  • Add a tolerance kwarg to the optimizer API to set a float value 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 the return_correlation Boolean kwarg.
  • Add the pyhf.utils.citation API to get a str of the preferred BibTeX entry for citation of the version of pyhf installed. See the example for the CLI API for more information.
  • The pyhf.infer.hypotest API now uses a calctype argument to differentiate between using an asymptotic calculator or a toy calculator, and a test_stat kwarg 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_stat kwarg for pyhf.infer.hypotest and the calculator APIs is 'qtilde', which corresponds to the alternative test statistic pyhf.infer.test_statistics.qmu_tilde.
  • The return type of p-value like functions is now a 0-dimensional tensor (with shape ()) instead of a float. This is required to support end-to-end automatic differentiation in future releases.

CLI API

  • The CLI API now supports a --citation or --cite option to print the preferred BibTeX entry for citation of the version of pyhf installed.
$ 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://github.com/scikit-hep/pyhf},
}

@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

Changes:

  • docs: Add v0.6.0 release notes (#1314)
  • docs: Update API in notebooks to v0.6.0 (#1312)
  • fix: Make p-value-like values 0-d tensors (#1311)
  • feat: Add kwarg for AsymptoticCalculator base distribution (#993)
  • docs: Add release notes to website (#1304)
  • fix: Restrict iminuit to compatible releases below 2.4.0 (#1307)
  • build: Drop support for Python 3.6 (#1272)
  • build: Update minimum required tqdm release to avoid repr crash (#1302)
  • docs: Add syntax highlighting for bash snippets (#1300)
  • ci: Update PyPI publish GitHub Action to v1.4.2 (#1299)
  • chore: Update to pyupgrade 2.10.0 in pre-commit (#1298)
  • docs: Add use citation from MadAnalysis 5 workshop (#1297)
  • fix: Make wheel naming indicate wheels are not Python 2 compatible (#1295)
  • docs: Widen the content box of docs (#1292)
  • docs: Add JOSS paper to preferred citation and DOI Badge (#1291)
  • ci: Drop GESIS from Binder trigger (#1293)
  • docs: Make 'Statement of Need' explicit section in JOSS paper (#1290)
  • docs: Correct TestPyPI install instructions (#1289)
  • docs: Add warning banners for dev versions on docs (#1288)
  • docs: Make docs badge link to latest stable version on ReadTheDocs (#1287)
  • docs: Redirect questions to GitHub Discussions (#1283)
  • chore: Update to pyupgrade 2.9.0 and nbQA v0.5.7 in pre-commit (#1282)
  • docs: Explicitly give version number in JOSS paper (#1280)
  • feat: Provide support for returning correlations from minuit (#988)
  • fix: Model.spec should be self-consistent and reproducible (#1281)
  • ci: Add pre-commit hooks from pre-commit-hooks recommended by Scikit-HEP (#1276)
  • docs: Add JOSS paper (#1089)
  • docs: Add commas to infer.mle.fixed_poi_fit docstring for clarity (#1273)
  • fix: Report expected p-values based on their quantiles under background hypotheses (#1162)
  • docs: Update README to address JOSS reviewer changes (#1266)
  • feat: Add discovery p0 test statistic (#1232)
  • docs: Add Symmetry Magazine article on likelihood publication (#1263)
  • docs: Add learn notebook on using calculators (#1258)
  • chore: Remove duplicated and unused dependencies (#1261)
  • docs: Build docs with sphinx-build via Sphinx Makefile (#1257)
  • docs: Use sphinxcontrib-bibtex v2.1 and bibtex_bibfiles setting (#1221)
  • docs: Add talks and use citations from 2020 (#1254)
  • fix: Don't use exact assert for test_probability.py (#1252)
  • docs: Fix data ordering bug in ShapeFactor (#1245)
  • docs: Fix math mode syntax in contrib.viz.brazil.plot_results docstring (#1243)
  • docs: Add readxml and writexml (#1242)
  • build: Begin move to uproot4 (#1002)
  • feat: Add to_numpy API to tensorlib (#1226)
  • feat: Use iminuit v2.0 API (#1208)
  • chore: Update to nbQA v0.5.6 in pre-commit (#1240)
  • feat: Test statistic specified by string instead of using qtilde kwarg (#1231)
  • refactor: Clean up docstrings and remove qtilde from hypotest (#1230)
  • build: Use compatible release syntax to give ranges for install_requires (#1229)
  • fix: Control utils.py docstring example with .bumpversion.cfg (#1218)
  • ci: Uninstall dependencies before installed HEAD versions (#1227)
  • chore: Update to nbQA v0.5.5 in pre-commit (#1222)
  • fix: Ensure pytest.approx only compares floats (#1220)
  • docs: Link to conda-forge feedstock and link banner to repo (#1217)
  • chore: Use exc_info in log.error, re-raise last exceptions (#1209)
  • feat: Add utility to get software citation and CLI interface (#1210)
  • chore: Update nbQA in pre-commit (#1207)
  • fix: Update JAX DeviceArray type in docstrings for doctest (#1206)
  • ci: Test only latest Python runtime on MacOS (#1203)
  • feat: Use iminuit v1.5.X API (#1202)
  • docs: Correct spelling of continuous (#1201)
  • chore: Specify exceptions to remove inline ignores of E722 (#1194)
  • chore: Update nbQA in pre-commit (#1199)
  • fix: Use uproot3-methods with uproot3 (#1200)
  • test: Verify NLL values and Minuit parameter uncertainties (#1197)
  • chore: Use flake8 for linting (#1191)
  • fix: Use uproot3 namespace (#1192)
  • chore: Update nbQA in pre-commit (#1190)
  • refactor: Drop 'modifier' from parameter set requirements (#1189)
  • fix: Isolate pyhf contrib commands from rest of CLI (#1186)
  • feat: Configurable optimizer tolerance for termination (#1184)
  • docs: Add CHEP 2019 proceedings use citation (#1185)
  • feat: Set minuit strategy automatically for gradient/non-gradient mode (#1183)
  • docs: Add ATLAS SUSY+Exotics Tutorial (#1181)
  • fix: Ensure float-like values used in division in writexml (#1179)
  • chore: Update pyupgrade and nbQA in pre-commit (#1178)
  • feat: Add default axis labels to contrib.viz.brazil.plot_results (#1176)
  • fix: Pin additional dependencies in pre-commit hooks (#1167)
  • feat: Add nbQA to pre-commit hooks (#1165)
  • chore: Run pyupgrade on codebase (3.6+) (#1164)
  • feat: Add toy calculator, empirical distribution, and toy example notebook (#790)
  • feat: Update model and inference defaults (#1114)
  • feat: Tensorlib ravel functionality (#1147)