Releases: scikit-hep/pyhf
v0.7.0rc1
Notes
This is the first v0.7.0
release candidate and contains a known bugs related to staterror
(Issue #1720) and shapesys
correlation (Issue #1908) that were introduced after v0.6.3
. While this is suitable for API testing, please wait for v0.7.0rc2
before testing correctness or performance.
To install the release candidate you can either use pip install's --pre flag
python -m pip install --upgrade --pre pyhf
or specify the version number exactly
python -m pip install --upgrade 'pyhf==0.7.0rc1'
What's Changed
- fix: Update notebooks to use
include_auxdata
kwarg forpyhf.Workspace.data
by @matthewfeickert in #1588 - ci: Skip doctest for 'Minimum supported dependencies' workflow by @matthewfeickert in #1589
- chore: [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #1593
- docs: Correct v0.6.3 release notes to note
pyhf.pdf._ModelConfig.channels
is a list by @RhnSharma in #1592 - ci: Add Python 3.9 to 'Current Release' workflow tests by @matthewfeickert in #1596
- docs: Update maintainer release checklist with v0.6.3 notes by @matthewfeickert in #1597
- ci: Use
jupyter-black
pre-commit hook overnbqa-black
by @matthewfeickert in #1598 - docs: Add use citation from publishing statistical models white paper by @matthewfeickert in #1600
- docs: Add
uproot4
writing speedup to v0.6.3 release notes by @matthewfeickert in #1601 - docs: Add use citation from collider signatures of coannihilating dark matter paper by @matthewfeickert in #1604
- fix: Use MLEs of NPs to create sampling distributions in ToyCalculator by @masonproffitt in #1610
- docs: Add use citation from simplified likelihoods ATLAS PUB note by @matthewfeickert in #1614
- docs: Use sphinxcontrib-bibtex style 'unsrt' to sort citations in reverse chronological order by @matthewfeickert in #1615
- chore: [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #1616
- docs: Use sphinx-copybutton prompt regex to fully capture examples by @matthewfeickert in #1617
- ci: Allow reporting of coverage on PRs from forks by @matthewfeickert in #1622
- ci: Update codecov-action to v2 API by @matthewfeickert in #1623
- ci: Report coverage to Codecov without token by @matthewfeickert in #1628
- feat: Add hypotest kwargs to pyhf.infer.intervals.upperlimit by @aryan26roy in #1613
- feat: Expose fitted parameter values of implicit fits in test statistic calls by @lhenkelm in #1554
- ci: Add absolufy-imports pre-commit hook by @matthewfeickert in #1635
- feat: Add setup for custom modifiers by @lukasheinrich in #1625
- feat: Allow POI-less models via Workspace.model by @kratsg in #1636
- fix: Fix bug in impact plot visualization by @matthewfeickert in #1642
- feat: Add POI-less specification support by @kratsg in #1638
- docs: Add and apply codespell as a pre-commit hook by @alexander-held in #1645
- fix: custom modifier / new parameter support and test by @lukasheinrich in #1644
- test: Use netlocs that are known to not exist or give known return by @matthewfeickert in #1651
- feat: Add support for arrayful JSON by @lukasheinrich in #1647
- test: Remove 'src' from pytest test testpaths to allow for non-editable install in CI by @matthewfeickert in #1467
- feat: Allow zero rate Poisson by @matthewfeickert in #1657
- ci: Add release candidates to HEAD of dependencies workflow by @matthewfeickert in #1660
- feat: Configurable default backend by @kratsg in #1646
- refactor: Simplified parameters by @lukasheinrich in #1639
- ci: Turn off PyPI release tests on pull requests by @matthewfeickert in #1664
- build: Set lower bound of scipy v1.1.0 by @matthewfeickert in #1661
- build: Update lower bound on jax to v0.2.10 by @matthewfeickert in #1666
- feat: Remove pyhf.simplemodels.hepdata_like from API by @aryan26roy in #1670
- docs: Update 2021 published ATLAS probability models by @matthewfeickert in #1671
- chore: [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #1679
- refactor: Pass
Accept
header to requests incontrib.utils.download
by @matthewfeickert in #1673 - fix: Use https protocol as unauthenticated git protocol is no longer supported by @matthewfeickert in #1680
- docs: Add ATLAS top group probability model records through June 2021 by @matthewfeickert in #1681
- docs: Add ATLAS third-generation scalar leptoquarks search statistical model record by @matthewfeickert in #1682
- fix: Speed-up readxml by caching key lookup instead of using try/except by @kratsg in #1691
- feat: Add percentile function to tensorlib by @matthewfeickert in #817
- docs: only lists are accepted when specifying objects to prune by @alexander-held in #1692
- feat: Add transpose function to tensorlib by @matthewfeickert in #1696
- refactor: Use jax.numpy for JAX backend tensorlib.tolist by @matthewfeickert in #1138
- refactor: Use tensorlib.percentile in calculators by @matthewfeickert in #1694
- test: Use xfail for tests that fail for upstream problems by @matthewfeickert in #1702
- build: Set only lower bounds on backend dependencies by @matthewfeickert in #1698
- docs: Ensure docstring examples are contiguous by @matthewfeickert in #1703
- refactor: Make contrib.utils.download robust to archive file types by @matthewfeickert in #1697
- fix: Accept tar and zip headers in contrib.utils.download requests by @matthewfeickert in #1704
- fix: Ensure
_ModelConfig.suggested_fixed
list contains only booleans for all modifiers by @alexander-held in #1706 - ci: Quote GitHub Action python-version number as YAML strings by @matthewfeickert in #1707
- feat: Raise exception if bin-wise modifier data length doesn't match sample data by @matthewfeickert in #1708
- feat: Catch unexpected keyword arguments in workspace construction by @alexander-held in #1709
- test: Use scikit-hep-testdata to provide probability models for regression tests by @matthewfeickert in #1711
- fix: Skip doctest of
pyhf.contrib.utils.download
by @matthewfeickert in #1715 - chore: Use constraints.txt for lower bound testing by @matthewfeickert in #1713
- docs: Fix download method of probability models archive in impact plot notebook by @matthewfeickert in #1721
- chore: [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #1723
- docs: Fix download method of probability models archive in pull plot notebook by @matthewfeickert in #1724
- feat: Allow skipping validation when constructing workspaces by @alexander-held in #1710
- test: Make fail_backend markers add pytest.mark.xfail and remove fail_jax marker on percentile tests by @matthewfeickert in #1730
- ci: Publish to TestPyPI on tag or by workflow dispatch trigger by @matthewfeickert in #1727
- docs: Truncate floating point docstring examples to 8 decimal places by @matthewfeickert in #1726
- docs: Add GitHub Release Radar check to release checklist by @matthewfeickert in #1733
- docs: Update citation references publication status by @matthewfeickert in #1738
- docs: Add milestone for 1000 project commits to README by @matthewfeickert in #1739
- fix: Disallow nbsphinx v0.8.8 to avoid empty...
v0.6.3
This is a patch release from v0.6.2
→ v0.6.3
.
Important Notes
- With the addition of writing ROOT files in
uproot
v4.1.0
thexmlio
extra no longer requiresuproot3
and all dependencies onuproot3
anduproot3-methods
have been dropped. (PR #1567).uproot4
additionally brings large speedups to writing, which results in an order of magnitude faster conversion time for most workspace conversions from JSON back to XML + ROOT withpyhf json2xml
. - All backends are now fully compatible and tested with Python 3.9. (PR #1574)
- The TensorFlow backend now supports compatibility with TensorFlow
v2.2.1
and later and TensorFlow Probabilityv0.10.1
and later. (PR #1001) - The
pyhf.workspace.Workspace.data()
with_aux
keyword arg has been renamed toinclude_auxdata
to improve API consistency. (PR #1562)
Fixes
- The weakref bug with Click
v8.0+
was resolved.pyhf
is now fully compatible with Clickv7
andv8
releases. (PR #1530)
Features
Python API
-
Model parameter names are now propagated to optimizers through addition of the
pyhf.pdf._ModelConfig.par_names()
API.pyhf.pdf._ModelConfig.par_names()
also handles non-scalar modifiers with 1 parameter. (PRs #1536, #1560)>>> import pyhf >>> model = pyhf.simplemodels.uncorrelated_background( ... signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0] ... ) >>> model.config.parameters ['mu', 'uncorr_bkguncrt'] >>> model.config.npars 3 >>> model.config.par_names() ['mu', 'uncorr_bkguncrt[0]', 'uncorr_bkguncrt[1]']
-
The
pyhf.pdf._ModelConfig
channel_nbins
dict is now sorted by keys to match the order of thechannels
list. (PR #1546) -
The
pyhf.workspace.Workspace.data()
with_aux
keyword arg has been renamed toinclude_auxdata
to improve API consistency. (PR #1562)
Changes
- docs: Add v0.6.3 release notes (#1583)
- docs: Update JAX backend poisson docstring to jax v0.2.20 returns (#1584)
- docs: Fix links to existing issues for 'docs' and 'feat' labels (#1582)
- docs: Use GitHub Issue forms as Issue templates (#1576)
- feat: Add support for Python 3.9 across all backends (#1574)
- fix: Ensure TensorFlow backend Poisson compatibility with other backends (#1001)
- ci: Use Google Cloud Storage buckets for long term JAX wheel stability (#1579)
- docs: Add use citations from vCHEP 2021 (#1572)
- chore: Remove unnecessary str conversions of pathlib.Path objects (#1568)
- feat: Drop uproot3 for uproot4 for writing ROOT files (#1567)
- fix: Remove .dockerignore to give clean working tree during Docker build (#1569)
- style: Update validation scripts to be more Pythonic (#1565)
- feat: Rename kwarg with_aux to include_auxdata in pyhf.Workspace.data API (#1562)
- ci: Check sdist and wheel listed contents with python -m CLI (#1563)
- feat: par_names handles non-scalar modifiers with 1 parameter (#1560)
- docs: Promote comments to docstring examples for pyhf.event (#1556)
- fix: Remove WeakList in favor of built-ins (#1530)
- chore: Define OS in base image tag of Dockerfile (#1552)
- docs: Add CITATION.cff Citation File Format file (#1551)
- refactor: Use absolute imports over explicit relative imports (#1539)
- feat: Sort
_ChannelSummaryMixin.channel_nbins
by keys to matchchannels
order (#1546) - docs: Separate citations into 'use' and 'general' (#1540)
- chore: [pre-commit.ci] pre-commit autoupdate (#1542)
- docs: Add citation from heavy neutral leptons neutrino oscillation model paper (#1537)
- docs: Add project origin summary (#1415)
- feat: Propagate model parameter names to optimizers (#1536)
- fix: Use nightly SciPy wheels from Anaconda in HEAD of dependencies testing (#1533)
- test: Temporarily move to testing against SciPy pre-releases (#1532)
- fix: Unrestrict jaxlib upper bound and exclude jaxlib v0.1.68 (#524)
- test: Remove tests of deprecated simplemodels.hepdata_like API (#1521)
- chore: [pre-commit.ci] pre-commit autoupdate (#1520)
- docs: Update citation for 'Charged Lepton Flavor Violation at the EIC' paper (#1518)
- docs: Add release notes URL to PyPI project urls metadata (#1512)
- test: Remove 32b test_minimize tests from optim tests (#1504)
- fix: Temporarily restrict jaxlib to below v0.1.68 (#1502)
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 in pyhfv0.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.PatchSet
schema 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 whichpyhf
is a dependency. (PR #1382) - Calling
dir()
on anypyhf
module 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 thepyhf
API. (PR #1403)
>>> import pyhf
>>> pyhf. # Tab complete
pyhf.Model( pyhf.Workspace( pyhf.exceptions pyhf.infer pyhf.modifiers pyhf.parameters pyhf.pdf pyhf.set_backend( pyhf.tensor pyhf.utils
pyhf.PatchSet( pyhf.compat pyhf.get_backend( pyhf.interpolators pyhf.optimizer pyhf.patchset pyhf.probability pyhf.simplemodels pyhf.tensorlib pyhf.workspace
- 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.1
and later on Docker Hub and the GitHub Container Registry. Visit https://github.com/pyhf/cuda-images for more information.
Fixes
- Allow for precision to be properly set for the
tensorlib
ones
andzeros
methods through adtype
argument. This allows for precision to be properly set through thepyhf.set_backend()
precision
argument. (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 in pyhfv0.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 thematplotlib
API,pyhf.contrib.viz.brazil.plot_results()
now returns a lists of the artists drawn on the axis and moves theax
arguments to the to the last argument. (PR #1377)
- The
pyhf.compat
module has been added to aid in translating to and from ROOT names. (PR #1439)
CLI API
- The CLI API now supports a
patchset inspect
API to list the individual patches in aPatchSet
. (PR #1412)
pyhf patchset inspect [OPTIONS] [PATCHSET]
Contributors
v0.6.2
benefited from contributions from:
- Alexander Held (@alexander-held)
Changes:
- chore: Update codemeta softwareRequirements to match setup.cfg (#1498)
- docs: Add v0.6.2 release notes (#1495)
- docs: Add developer release checklist Issue template (#1493)
- docs: Improve badge layout and fix broken Docker badge (#1497)
- docs: Add squarks and gluinos search statistical model record (#1496)
- ci: Remove distribution options to enable default build v0.5.0 behavior (#1492)
- chore: Update pre-commit hooks versions and run order (#1490)
- feat: Allow strings in patch values for patchset (#1488)
- chore: Use tmpdir fixture over datadir in pyhf contrib download tests (#1487)
- docs: Add use citation from ATLAS SUSY 3L+compressed combination paper (#1483)
- chore: Add default virtual environment on PATH for Docker image (#1484)
- chore: Use _version.py to follow setuptools_scm recommendations (#1480)
- feat: Add 'contrib' extra to Docker images (#1479)
- docs: Add use citation from Belle II in Moriond EW 2021 contribution (#1475)
- chore: Use newer setuptools_scm for versioning (#1450)
- fix: Do not configure logging in contrib.utils (#1460)
- ci: Don't login to Docker container registries on PRs (#1463)
- chore: Trial pip in-tree-build before release in pip 21.3 (#1453)
- fix: Update to mathjax3_config to support math rendering in Sphinx v4.x+ (#1457)
- build: Revise MANIFEST.in strategy to properly use prune (#1449)
- feat: ROOT parameter name compatibility module (#1439)
- ci: Publish Docker images to GitHub Container Registry (#1444)
- ci: Set pre-commit.ci autoupdate schedule to monthly (#1440)
- chore: [pre-commit.ci] pre-commit autoupdate (#1445)
- refactor: Deprecate simplemodels.hepdata_like API for uncorrelated_background (#1438)
- fix: Remove load option from Docker workflow publish steps (#1442)
- ci: Update Docker workflow to build-push-action v2 (#1441)
- fix: Remove trailing spaces in parameter names (#1436)
- feat: Add correlated_background API to simplemodels (#1435)
- ci: Add custom commit message for pre-commit.ci autoupdate (#1432)
- docs: Add CERN Courier article to media listing (#1429)
- chore: [pre-commit.ci] pre-commit autoupdate (#1428)
- chore: Use module level dir to restrict public API views (#1403)
- docs: Add docstrings to _ModelConfig methods (#1420)
- docs: Update software citation URL to Zenodo DOI (#1424)
- docs: Add utils.citation to Python API docs (#1419)
- docs: Add use citation from Belle II B⁺→ K⁺νν̅ decays search paper (#1421)
- feat: Add CLs component plotting kwargs to contrib.viz.brazil.plot_results (#1377)
- chore: Update Black to release v21.4b1 (#1418)
- chore: Update Black to release v21.4b0 (#1417)
- docs: Add use citation from single leptoquark B-physics anomalies paper (#1416)
- feat:
pyhf patchset inspect
(#1412) - chore: Update flake8 and nbQA in pre-commit (#1411)
- fix: check POIs floating (#1409)
- chore: Update to pyupgrade v2.12.0 in pre-commit (#1404)
- refactor: Set default precision to 64b (#1400)
- fix: Ensure tensorlib precision used throughout TensorFlow backend (#1399)
- fix: Stricter schema definitions for histosys and normsys (#1388)
- chore: Update to nbQA v0.6.0 in pre-commit (#1395)
- fix: Loosen iminuit tolerances for optimization tests (#1306)
- feat: Use PyYAML's safe_load for better security (#1383)
- build: Set only lower bounds on core dependencies (#1382)
- ci: Simplify CodeQL scan setup (#1384)
- chore: Ignore JAX tensor type in doctest (#1379)
- ci: Upload coverage to Codecov in flagged stages for complete coverage report (#1380)
- fix: Correct JAX tensor type in docstring (#1375)
- fix: Set precision for ones and zeros through dtype arg (#1369)
- chore: Update to pyupgrade 2.11.0 in pre-commit (#1370)
- fix: Adjust sbottom region A regression test tolerance for GHA runner change (#1364)
- chore: Update to flake8 3.9.0 in pre-commit (#1363)
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.distributions
in 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 oftorch
v1.8.0
for use of the PyTorch backend.
Fixes
- In the PyTorch backend the
validate_args
kwarg is used withtorch.distributions
to ensure a continuous approximation of the Poisson distribution intorch
v1.8.0+
.
Features
Python API
- The
solver_options
kwarg 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
torch
API is now used to provide the implementations of theravel
,tile
, andouter
tensorlib methods for the PyTorch backend.
Changes
- docs: Add v0.6.1 release notes (#1357)
- test: Test lower bounds of dependencies (#1355)
- refactor: Use torch APIs for ravel, tile, and outer tensorlib methods (#1354)
- ci: Run docs CI on push events only from PR merges (#1353)
- docs: Add use citation for Artificial Proto-Modelling paper (#1347)
- fix: Retain continuous approximation of Poisson in torch v1.8.0 (#1351)
- docs: Add and apply blacken-docs as a pre-commit hook (#1345)
- docs: Clarify and harmonize docstrings for fit parameters (#1344)
- docs: Add record for published ATLAS likelihoods from November 2020 (#1343)
- docs: Add use citation for wino and higgsino dark matter at muon collider (#1340)
- feat: Solver options for scipy (#1337)
- docs: Drop modifierclass and improve autosummary (#1338)
- chore: Update to nbQA 0.5.9 in pre-commit (#1333)
- docs: Update CONTRIBUTING.md to disincentivize 'drive by PRs' (#1332)
- docs: Fix typo in Using Calculator learn notebook (#1331)
- docs: Update ATLAS 3G tt 2L citation (#1330)
- chore: Apply minor code quality revisions (#1325)
- docs: Add use citations for QCD instantons and charged lepton flavor violation (#1329)
- docs: Add CPython implementation and Python 3 only metadata (#1324)
- docs: Update Zenodo BibTeX author field in citation in docs (#1323)
- docs: Use more flexible BibTeX syntax for Zenodo DOI (#1322)
- docs: Add dropping of Python 3.6 support to v0.6.0 release notes (#1317)
- chore: Update codemeta to include v0.6.0 software requirements (#1318)
- docs: Correct typos in v0.6.0 release notes (#1316)
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.0
API. Perhaps most relevant is the changes to thepyhf.infer.hypotest
API, which now uses acalctype
argument to differentiate between using an asymptotic calculator or a toy calculator, and atest_stat
kwarg 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
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, sopyhf
is moving forward with a minimum required runtime of Python 3.7. - Support for the discovery test statistic,
q0
, has now been added through thepyhf.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 theiminuit
v2.X
release series and API. Note thatiminuit
v2.X
can result in slight differences in minimization results fromiminuit
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. Please make sure to include the paper reference in all citations ofpyhf
, 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 forpyhf.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
anduproot
/uproot4
have been fixed for thexmlio
extra. - The
normsys
modifier now uses thepyhf.interpolators.code4
interpolation method by default. - The
histosys
modifier now uses thepyhf.interpolators.code4p
interpolation method by default.
Features
Python API
- The
tensorlib
API now supports atensorlib.to_numpy
andtensorlib.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 afloat
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 thereturn_correlation
Boolean kwarg. - Add the
pyhf.utils.citation
API to get astr
of the preferred BibTeX entry for citation of the version ofpyhf
installed. See the example for the CLI API for more information. - The
pyhf.infer.hypotest
API now uses acalctype
argument to differentiate between using an asymptotic calculator or a toy calculator, and atest_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 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
--citation
or--cite
option to print the preferred BibTeX entry for citation of the version ofpyhf
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 ra...
v0.5.4
This is a patch release from v0.5.3 → v0.5.4.
Fixes
- Require
uproot3
instead ofuproot
v3.X
releases to avoid conflicts whenuproot4
is installed in an environment withuproot
v3.X
installed and namespace conflicts withuproot-methods
. Adoption ofuproot3
inv0.5.4
will ensurev0.5.4
works far into the future if XML and ROOT I/O throughuproot
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.upperlimit
- Building workspaces from a model and data added with
pyhf.workspace.build
CLI API
- Added CLI API for
pyhf.infer.fit
:pyhf fit
- pyhf 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
Changes
- chore: Migrate to new way to set environment variables in GHA (#1139)
- feat: Support ShapeFactor for import/export (#1136)
- style: Adopt new JAX style of np and jnp (#1135)
- docs: Add ss3L hepdata likelihood record (#1133)
- fix: Use JAX v0.2.4+ API (#1134)
- chore: Add file types for diff to .gitattributes (#1130)
- fix: Fixed parameter naming for compatibility with ROOT import/export (#1125)
- fix: Make workspaces immutable (#1132)
- fix: Logic bug for outer joins of merge channels (#1128)
- fix: Validate fit initialization parameters (#1126)
- fix: Use functools.wraps with events.register to render docstrings (#1124)
- docs: Use sphinx obj scope in docs by default (#1122)
- feat: Merge channel functionality in pyhf combine (#1088)
- ci: Make docs separate workflow (#1120)
- refactor: Migrate contrib download to contrib module (#1119)
- docs: Add importance of Issues to CONTRIBUTING.md (#1113)
- refactor: Rename paramset.fixed to paramset.suggested_fixed (#1110)
- feat: Add pyhf.workspace.build (#1101)
- fix: Import all infer submodules (#1104)
- docs: Use 1Lbb DOI in contrib download docstring (#1109)
- fix: Remove improper defaults for contrib download (#1105)
- docs: Add JSON example to README (#1102)
- docs: Add CodeMeta JSON-LD Context File (#1091)
- feat: Add API to download likelihood patchset archives (#1046)
- fix: Avoid deprecation warnings due to invalid escape sequences (#1047)
- docs: Add contributors to website (#1095)
- docs: Remove fixed parameters caveat for TRexFitter in babel (#1093)
- feat: Add test inversion / interval inference API (#953)
- ci: Add code scanning CodeQL workflow (#1085)
- test: Ensure continuous approximation of Poisson implemented (#1084)
- chore: Migrate from bumpversion to bump2version (#1083)
- docs: Add citations from 2019 and 2020 papers (#1081)
- docs: Add information on announcement mailing list (#1079)
- ci: Add workflow for nightly tests of notebooks (#1078)
- ci: Add workflow dispatch support (#1076)
- chore: Update GitHub Action releases and Python runtimes in CI (#1074)
- ci: Add nightly tests using HEAD of dependencies (#1071)
- fix: Restrict iminuit to v1.4.X releases (#1070)
- chore: Migrate from pep517 to python-build (#1066)
- refactor: Remove unused fixtures, refactor validation tests (#1063)
- feat: Add fit to infer CLI API (#1060)
- feat: Add erf and erfinv to tensorlib (#1061)
- feat: Bump to modern pytest (6.0+) (#1049)
v0.5.2
This is a patch release from v0.5.1 → v0.5.2. Changes: - feat: Support configuring fixed values automatically from Model (#1051) - docs: Add SModelS paper to citations list (#1055) - fix: Step sizes for fixed parameters in minuit should be 0.0 (#1054) - fix: Sync SciPy minimizer initialized parameter values with fixed values (#1053) - feat: Prune/Rename raise errors if item name not in workspace (#1050) - style: Update to Black v20.8 formatting (#1048) - fix: Tensor conversion for expected data in _MainModel (#1044) - feat: Add pyhf.Workspace.sorted to give ability to sort Workspace (#1042) - fix: Make pyhf.Workspace.combine return cls instead of Workspace (#1041) - fix: Tensor conversion for expected aux and actual data (#1038) - fix: Weakly reference callables for pub-sub model (#1035) - docs: Add learn notebook on test statistics (#1014) - docs: Extend infer docstrings with mathematical examples (#905) - refactor: Make hypotest return CLs as 0-d tensor (#944) - feat: Add return_by_sample to expected_data API (#731) - fix: Tensorflow tile tensor backend feature parity (#1028) - docs: Add NSF award badge for Throughput project tracking (#1022) - docs: Make all examples in README full examples (#1016) - docs: Add citation in Higgs boson potential at colliders paper (#1020)
v0.5.1
This is a patch release from v0.5.0 → v0.5.1. Changes: - refactor: Factor out tmu-like and qmu-like test statistics (#1005) - feat: Bookkeep fixed parameters (#989) - docs: Match docstring style format (#1012) - feat: Add cdf method to AsymptoticTestStatDistribution (#1010) - docs: Add Conda-forge release version badge (#1003) - fix: Clean apt path after apt-get install (#996) - docs: 1000! (#1000) - build: Restrict TensorFlow to v2.2.X and TensorFlow Probability to v0.10.X (#999) - fix: stitch_pars bug in stitching values other than fixed values (#991)
v0.5.0
This is a minor release from v0.4.4 → v0.5.0. Changes: - revert: Allow 0-dimensional shape tensors (#972) - feat: Add precision setting string API to set_backend (#983) - docs: Replace optimizer table with list (#985) - refactor: Optimizer API harmonization, minuit autodifferentiation support (#951) - fix: Enable jax.np.stack for axis !=0 (#976) - chore: Set minimum version for iminuit to v1.4.3 (#975) - docs: Add 2020 ATLAS Induction Day and PyHEP 2020 tutorials (#967) - fix: Protect against missing JAX imports (#968) - refactor: Use AsymptoticTestStatDistribution.expected_value API in hypotest for better integration (#962) - docs: Clarify role of return_fitted_val kwarg for fit and fixed_poi_fit (#961) - docs: Clarify objective function in infer.mle (#960) - feat: support no POI (#950) - docs: Add hepdata_like model API to docs (#937) - docs: Fix CLs wrapping and add shorter URL (#941) - feat: Enable shell completion (#919) - docs: Add examples of good contributions to CONTRIBUTING (#938) - docs: Add TRExFitter babel translation (#931) - docs: Unrestrict Sphinx from v3.0.X releases (#933) - chore: Future proof release against uproot4 API changes (#930) - fix: Change p-value calculation from 1-cdf(x) to cdf(-x) (#902) - revert: Rollback constraints on cloudpickle given TFP v0.10.1 release (#924) - fix: Set backend global states correctly (#922) - feat: Single precision setting for backends (#914) - ci: Run Docker test on tag pushes to avoid breaking CI (#917)