pure-Python HistFactory implementation with tensors and autodiff
APACHE-2.0 License
Bot releases are visible (Hide)
This is a patch release from v0.7.5
→ v0.7.6
.
jax.config
from the jax
top level API to avoid support issues with jax
and jaxlib
v0.4.20+
. (PR #2376)pyhf.infer.test_statistics.qmu
and pyhf.infer.test_statistics.qmu_tilde
that provides users with the higher level pyhf.infer
APIs kwarg
to set the correct test statistic. (PR #2390)pyhf.contrib.viz.brazil.plot_brazil_band
to match the stated return structure. (PR #2411)pyhf.infer
module, correct the fixed_params
type in the docs to be to tuple
or list
. (PR #2420)v0.7.6
benefited from contributions from:
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.5...v0.7.6
Published by matthewfeickert 12 months ago
This is a patch release from v0.7.4
→ v0.7.5
.
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.4...v0.7.5
Published by matthewfeickert about 1 year ago
This is a patch release from v0.7.3
→ v0.7.4
.
Skip callbacks with dead weakrefs while iterating over callbacks in pyhf
events, like pyhf.set_backend
, to avoid the possibility of accessing dead weakrefs before they could be garbage collected. (PR #2310)
The fixed bug was subtle and occurred nondeterministically when the pyhf.tensorlib
was changed repeatedly causing dead weakrefs to be accessed before Python's garbage collection could remove them. Most users should be unaffected.
v0.7.4
benefited from contributions from:
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.3...v0.7.4
Published by matthewfeickert about 1 year ago
This is a patch release from v0.7.2
→ v0.7.3
.
Use np.prod
API over np.product
as np.product
is deprecated as of NumPy v1.25.0
. (PR #2242)
Guard pyhf.optimize.opt_minuit.minuit_optimizer
optimizer strategy from None
to ensure iminuit.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
v0.7.3
benefited from contributions from:
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.2...v0.7.3
Published by matthewfeickert over 1 year ago
This is a patch release from v0.7.1
→ v0.7.2
.
pyhf
became a NumFOCUS Affiliated Project on 2022-12-19. v0.7.1
is the first release to appear in a NumFOCUS Newsletter and v0.7.2
is the first release to appear as part of the Affiliated Projects page. (PR #2179)pyhf.exceptions.InvalidModel
. This guards against modifiers like shapefactor
, shapesys
, and staterror
from being used as POIs. (PR #2197)typing.TYPE_CHECKING
guard to avoid causing a ModuleNotFoundError
when the version of NumPy installed is older than v1.21.0, which is the first NumPy release to include numpy.typing
. (PR #2208)v0.7.2
benefited from contributions from:
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.1...v0.7.2
Published by matthewfeickert over 1 year ago
This is a patch release from v0.7.0
→ v0.7.1
.
tensorflow
extra ('pyhf[tensorflow]'
) now automatically installs tensorflow-macos
for Apple silicon machines. (PR #2119)NotImplementedError
when attempting to convert a XML workspace that contains no data. (PR #2109)v0.7.1
benefited from contributions from:
jax.errors
API as jax._src
removed from public namespace by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/2034
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.0...v0.7.1
Published by matthewfeickert about 2 years ago
This is a minor release from v0.6.3
→ v0.7.0
.
Please note this release has API breaking changes and carefully read these notes while updating your code to the v0.7.0
API.
All backends are now fully compatible and tested with Python 3.10. (PR #1809)
The pyhf.tensorlib.poisson
API now allows for the expected rate parameter lam
to be 0
in the case that the observed events n
is 0
given that the limit $$\lim_{\lambda \to 0} ,\mathrm{Pois}(n | \lambda)$$ is well defined. (PR #1657)
pyhf.readxml.parse
now supports reading of XML configurations with absolute paths. To support this, pyhf xlm2json
now has a -v/--mount
option. (PR #1909)
Support for model specifications without a parameter of interest defined is added. (PRs #1638, #1636)
The pyhf.parameters.paramsets
classes suggested_fixed
attribute behavior has been updated. To access the behavior used in pyhf
v0.6.x
use the suggested_fixed_as_bool
attribute. (PR #1639)
pyhf.pdf._ModelConfig.par_names
is changed to be a property attribute. (PR #2027)
The order of model parameters is now sorted by model parameter name. (PR #1625)
Support for writing user custom modifiers is added. (PRs #1625, #1644)
Performance in pyhf.readxml
is increased by improvements to pyhf.readxml.import_root_histogram
. (PR #1691)
pyhf.contrib.utils.download
is now more robust to different target file types. (PRs #1697, #1704)
A pyhf.default_backend
has been added that is configurable through a default
kwarg in pyhf.set_backend
. (PR #1646) This is part of work to make pyhf
fully automatic differentiable. (Issue #882)
Schema validation now allows for both list
and pyhf.tensorlib
objects to exist in the model specification. (PR #1647)
The minimum required dependencies have been updated to support added features:
scipy>=1.2.0
(PR #1274)click>=8.0.0
(PRs #1909, #1958)jsonschema>=4.15.0
(PRs #1976, #1979)importlib_resources>=1.4.0
(for Python 3.7, 3.8) (PR #1979)typing_extensions>=3.7.4.3
(for Python 3.7 only) (PRs #1940, #1961)The minimum required backend versions have been updated to support added features:
jax>=0.2.10
, jaxlib>=0.1.61
(PR #1962)torch>=1.10.0
(PR #1657)tensorflow>=2.7.0
, tensorflow-probability>=0.11.0
(PRs #1962, #1657)iminuit>=2.7.0
(PR #1895)'xmlio'
extra requires uproot>=4.1.1
(PR #1567)Use improvements to jsonschema.RefResolver
to avoid jsonschema.exceptions.RefResolutionError
. (PR #1976)
Use the conditional maximum likelihood estimators of the nuisance parameters to create the sampling distributions for pyhf.infer.calculators.ToyCalculator
. (PR #1610) This follows the joint recommendations of the ATLAS and CMS experiments in Procedure for the LHC Higgs boson search combination in Summer 2011.
The following functions have been added to the pyhf.tensorlib
API:
pyhf.tensorlib.transpose
(PR #1696)pyhf.tensorlib.percentile
(PR #817)pyhf.readxml.parse
now supports reading of XML configurations with absolute paths with the addition of the mounts
optional argument. (PR #1909)
Support for overriding the paths for finding schemas is added, using the pyhf
installed location as a base via pyhf.utils.schemas
. (PRs #1753, #1818)
>>> from pathlib import Path
>>> import pyhf.schema
>>> current_schema_path = pyhf.schema.path
>>> current_schema_path
PosixPath('/path/to/your/venv/lib/python3.X/site-packages/pyhf/schemas')
>>> custom_schema_path = Path("/path/to/custom/pyhf/schema")
>>> with pyhf.schema(custom_schema_path):
... print(repr(pyhf.schema.path))
...
PosixPath('/path/to/custom/pyhf/schema')
>>> pyhf.schema.path
PosixPath('/path/to/your/venv/lib/python3.X/site-packages/pyhf/schemas')
In pyhf.workspace.Workspace.model
the parameter of interest specified in the measurement may now be overridden using the added poi_name
kwarg. (PR #1636)
The pyhf.parameters.paramsets
classes suggested_fixed
attribute behavior has been updated to return a list
of bool
of length n_parameters
. To access the behavior used in pyhf
v0.6.x
use the suggested_fixed_as_bool
attribute. (PR #1639)
pyhf.pdf._ModelConfig.par_names
is changed to be a property attribute. (PR #2027)
The order of model parameters is now sorted by model parameter name. (PR #1625)
>>> import pyhf
>>> model = pyhf.simplemodels.correlated_background(
... signal=[12.0, 11.0],
... bkg=[50.0, 52.0],
... bkg_up=[45.0, 57.0],
... bkg_down=[55.0, 47.0],
... )
>>> model.config.par_order
['correlated_bkg_uncertainty', 'mu']
>>> model.config.par_names
['correlated_bkg_uncertainty', 'mu']
Support for writing user custom modifiers is added.
(PRs #1625, #1644) This is still in the stage where it is targeted at expert users.
{modifier}_builder
classes are added for all modifiers. (PRs #1625) For example, pyhf.modifiers.histosys.histosys_builder
.
When using pyhf.writexml
and the normfactor
parameter config is missing inits
or bounds
, fall back to using default values. (PRs #1819)
Supported options for pyhf.infer.hypotest
can now be passed as kwargs through the pyhf.infer.intervals.upper_limits.upper_limit
API. (PR #1613) This now enables things like using pyhf.infer.calculators.ToyCalculator
as the calculator used for the hypothesis test scan:
>>> import numpy as np
>>> import pyhf
>>> pyhf.set_backend("jax")
>>> model = pyhf.simplemodels.uncorrelated_background(
... signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0]
... )
>>> observations = [51, 48]
>>> data = pyhf.tensorlib.astensor(observations + model.config.auxdata)
>>> scan = np.linspace(0, 5, 21)
>>> obs_limit, exp_limits, (scan, results) = pyhf.infer.intervals.upper_limits.upper_limit(
... data, model, scan, return_results=True, calctype="toybased", ntoys=3000
... )
Allow for fit parameter values from required fits in pyhf.infer.test_statistics
functions to be returned by use of return_fitted_pars
kwarg with the pyhf.infer.test_statistics
functions and return_calculator
kwarg with pyhf.infer.hypotest
. (PR #1554)
A validate
kwarg has been added to pyhf.workspace.Workspace
and
pyhf.pdf.Model
to allow skipping validation. (PR #1646) This should only be used by expert users who understand the risks.
A pyhf.default_backend
has been added that is configurable through a default
kwarg in pyhf.set_backend
. (PR #1646) This allows setting the pyhf.default_backend
to be different from the value of pyhf.tensorlib
returned by pyhf.get_backend
, which can be useful in situations where differentiable model construction is needed.
>>> import jax
>>> import pyhf
>>> pyhf.set_backend("jax", default=True)
>>> pyhf.set_backend("numpy")
>>> pyhf.get_backend()
(<pyhf.tensor.numpy_backend.numpy_backend object at 0x...>, <pyhf.optimize.scipy_optimizer object at 0x...>)
>>> pyhf.default_backend
<pyhf.tensor.jax_backend.jax_backend object at 0x...>
>>> def example_op(x):
... return 2 * pyhf.default_backend.power(pyhf.default_backend.astensor(x), 3)
...
>>> example_op([2.0])
DeviceArray([16.], dtype=float64)
>>> jax.jacrev(jax.jit(example_op))([2.0])
[DeviceArray([24.], dtype=float64, weak_type=True)]
Schema validation now allows for both list
and pyhf.tensorlib
objects to exist in the model specification. (PR #1647)
>>> import pyhf
>>> signal = pyhf.tensorlib.astensor([12.0, 11.0])
>>> background = pyhf.tensorlib.astensor([50.0, 52.0])
>>> background_uncertainty = pyhf.tensorlib.astensor([3.0, 7.0])
>>> model = pyhf.simplemodels.uncorrelated_background(
... signal=signal, bkg=background, bkg_uncertainty=background_uncertainty
... )
The pyhf xlm2json
CLI API now has a -v/--mount
option to support reading XML configurations with absolute paths. (PR #1909) Similar to Docker volume mounts, the options allows a user to pass two fields separated by a colon (:
). The first field is a local path and the second field is the absolute path specified in the XML configuration to be substituted. Without the -v/--mount
option a user would have to manually edit the absolute path in each XML file it appeared in!
pyhf xml2json \
--mount /local/path/to/workspace:/absolute/path/to/replace/inside/xml \
--output-file workspace.json \
workspace/analysis_config.xml
pyhf.infer.intervals.upperlimit
API has been deprecated in favor of pyhf.infer.intervals.upper_limits.upper_limit
.pyhf.infer.intervals.upperlimit
API will removed in pyhf
v0.9.0
. (PR #1274)The pyhf.simplemodels.hepdata_like
API, deprecated since pyhf
v0.6.2
, has been removed. (PR #1670) Use the pyhf.simplemodels.uncorrelated_background
API instead.
pyhf.workspace.Workspace
's parameters
attribute is removed in favor of using pyhf.pdf._ModelConfig
's parameters
. (PR #1625)
pyhf.workspace.Workspace.get_measurement
has the poi_name
kwarg removed. (PR #1636)
v0.7.0
benefited from contributions from:
include_auxdata
kwarg for pyhf.Workspace.data
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1588
pyhf.pdf._ModelConfig.channels
is a list by @RhnSharma in https://github.com/scikit-hep/pyhf/pull/1592
jupyter-black
pre-commit hook over nbqa-black
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1598
uproot4
writing speedup to v0.6.3 release notes by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1601
Accept
header to requests in contrib.utils.download
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1673
_ModelConfig.suggested_fixed
list contains only booleans for all modifiers by @alexander-held in https://github.com/scikit-hep/pyhf/pull/1706
pyhf.contrib.utils.download
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1715
tolist
fallback by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1746
RuntimeWarning
from NumPy by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1873
github.workflow
property to ensure unique concurrency group by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1879
find_namespace:
to ensure discovery of package data by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1881
license_files
in setup.cfg by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1883
build
error on warnings by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1887
defs.json
again by @lhenkelm in https://github.com/scikit-hep/pyhf/pull/1917
validate
kwarg to top-level functions in pyhf.simplemodels
by @phinate in https://github.com/scikit-hep/pyhf/pull/1858
_ModelConfig.set_poi(None)
to unset model POI by @kratsg in https://github.com/scikit-hep/pyhf/pull/1985
--no-extras
functionality by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1995
par_names
a _ModelConfig property attribute by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/2027
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.6.3...v0.7.0
Published by matthewfeickert about 2 years ago
This is the fourth v0.7.0
release candidate. Please use this for API testing, and for testing correctness or performance for v0.7.0
.
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.0rc4'
_ModelConfig.set_poi(None)
to unset model POI by @kratsg in https://github.com/scikit-hep/pyhf/pull/1985
--no-extras
functionality by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1995
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.0rc3...v0.7.0rc4
Published by matthewfeickert about 2 years ago
This is the third v0.7.0
release candidate. Please use this for API testing, and for testing correctness or performance for v0.7.0
.
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.0rc3'
validate
kwarg to top-level functions in pyhf.simplemodels
by @phinate in https://github.com/scikit-hep/pyhf/pull/1858
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.0rc2...v0.7.0rc3
Published by matthewfeickert about 2 years ago
This is the second v0.7.0
release candidate. Please use this for API testing, and for testing correctness or performance for v0.7.0
.
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.0rc2'
build
error on warnings by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1887
defs.json
again by @lhenkelm in https://github.com/scikit-hep/pyhf/pull/1917
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.7.0rc1...v0.7.0rc2
Published by matthewfeickert over 2 years ago
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'
include_auxdata
kwarg for pyhf.Workspace.data
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1588
pyhf.pdf._ModelConfig.channels
is a list by @RhnSharma in https://github.com/scikit-hep/pyhf/pull/1592
jupyter-black
pre-commit hook over nbqa-black
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1598
uproot4
writing speedup to v0.6.3 release notes by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1601
Accept
header to requests in contrib.utils.download
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1673
_ModelConfig.suggested_fixed
list contains only booleans for all modifiers by @alexander-held in https://github.com/scikit-hep/pyhf/pull/1706
pyhf.contrib.utils.download
by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1715
tolist
fallback by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1746
RuntimeWarning
from NumPy by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1873
github.workflow
property to ensure unique concurrency group by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1879
find_namespace:
to ensure discovery of package data by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1881
license_files
in setup.cfg by @matthewfeickert in https://github.com/scikit-hep/pyhf/pull/1883
Full Changelog: https://github.com/scikit-hep/pyhf/compare/v0.6.3...v0.7.0rc1
Published by matthewfeickert about 3 years ago
This is a patch release from v0.6.2
→ v0.6.3
.
uproot
v4.1.0
the xmlio
extra no longer requires uproot3
and all dependencies on uproot3
and uproot3-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 with pyhf json2xml
.v2.2.1
and later and TensorFlow Probability v0.10.1
and later. (PR #1001)pyhf.workspace.Workspace.data()
with_aux
keyword arg has been renamed to include_auxdata
to improve API consistency. (PR #1562)v8.0+
was resolved. pyhf
is now fully compatible with Click v7
and v8
releases. (PR #1530)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 the channels
list. (PR #1546)
The pyhf.workspace.Workspace.data()
with_aux
keyword arg has been renamed to include_auxdata
to improve API consistency. (PR #1562)
_ChannelSummaryMixin.channel_nbins
by keys to match channels
order (#1546)Published by matthewfeickert over 3 years ago
This is a patch release from v0.6.1
→ v0.6.2
.
pyhf.simplemodels.hepdata_like()
API has been deprecated in favor of pyhf.simplemodels.uncorrelated_background()
. The pyhf.simplemodels.hepdata_like()
API will be removed in pyhf v0.7.0
. (PR #1438)pyhf.contrib.viz.brazil.plot_results()
. See the Python API changes section for more information.pyhf.patchset.PatchSet
schema now allows string types for patch values in patchsets. (PR #1488)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 which pyhf
is a dependency. (PR #1382)dir()
on any pyhf
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 the pyhf
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
v0.6.1
and later on Docker Hub and the GitHub Container Registry. Visit https://github.com/pyhf/cuda-images for more information.tensorlib
ones
and zeros
methods through a dtype
argument. This allows for precision to be properly set through the pyhf.set_backend()
precision
argument. (PR #1369)64b
. (PR #1400)pyhf.contrib.utils
. (PR #1460)pyhf.simplemodels.hepdata_like()
API has been deprecated in favor of pyhf.simplemodels.uncorrelated_background()
. The pyhf.simplemodels.hepdata_like()
API will be removed in pyhf v0.7.0
. (PR #1438)pyhf.simplemodels.correlated_background()
API has been added to provide an example model with a single channel with a correlated background uncertainty. (PR #1435)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 the matplotlib
API, pyhf.contrib.viz.brazil.plot_results()
now returns a lists of the artists drawn on the axis and moves the ax
arguments to the to the last argument. (PR #1377)pyhf.compat
module has been added to aid in translating to and from ROOT names. (PR #1439)patchset inspect
API to list the individual patches in a PatchSet
. (PR #1412)pyhf patchset inspect [OPTIONS] [PATCHSET]
v0.6.2
benefited from contributions from:
pyhf patchset inspect
(#1412)Published by matthewfeickert over 3 years ago
This is a patch release from v0.6.0
→ v0.6.1
.
torch.distributions
in PyTorch v1.8.0
, accommodating changes have been made in the underlying implementations for pyhf.tensor.pytorch_backend.pytorch_backend
. These changes require a new lower bound of torch
v1.8.0
for use of the PyTorch backend.validate_args
kwarg is used with torch.distributions
to ensure a continuous approximation of the Poisson distribution in torch
v1.8.0+
.solver_options
kwarg can be passed to the pyhf.optimize.opt_scipy.scipy_optimizer
optimizer for additional configuration of the minimization. See scipy.optimize.show_options
for additional options of optimization solvers.torch
API is now used to provide the implementations of the ravel
, tile
, and outer
tensorlib methods for the PyTorch backend.Published by matthewfeickert over 3 years ago
This is a minor release from v0.5.4
→ v0.6.0
.
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.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.q0
, has now been added through the pyhf.infer.test_statistics.q0
API.pyhf.infer.calculators.ToyCalculator
API. Please see the corresponding example notebook for more detailed exploration of the API.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
.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 of pyhf
, as documented in the Use and Citations section of the documentation.contrib
extra.float
-like values are used in division for pyhf.writexml
.Model.spec
now supports building new models from existing models.uproot3
and uproot
/uproot4
have been fixed for the xmlio
extra.normsys
modifier now uses the pyhf.interpolators.code4
interpolation method by default.histosys
modifier now uses the pyhf.interpolators.code4p
interpolation method by default.tensorlib
API now supports a tensorlib.to_numpy
and tensorlib.ravel
API.pyhf.infer.calculators.ToyCalculator
API has been added to support pseudoexperiments (toys).ToyCalculator
API.tolerance
kwarg to the optimizer API to set a float
value as a tolerance for termination of the fit.pyhf.optimize.opt_minuit.minuit_optimizer
optimizer now can return correlations of the fitted parameters through use of the return_correlation
Boolean kwarg.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.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.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
.tensor
(with shape ()
) instead of a float
. This is required to support end-to-end automatic differentiation in future releases.--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}
}
v0.6.0
benefited from contributions from:
Published by matthewfeickert almost 4 years ago
This is a patch release from v0.5.3 → v0.5.4.
uproot3
instead of uproot
v3.X
releases to avoid conflicts when uproot4
is installed in an environment with uproot
v3.X
installed and namespace conflicts with uproot-methods
. Adoption of uproot3
in v0.5.4
will ensure v0.5.4
works 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
Published by matthewfeickert almost 4 years ago
This is a patch release from v0.5.2 → v0.5.3.
pyhf.infer.intervals.upperlimit
pyhf.workspace.build
pyhf.infer.fit
: pyhf fit
pyhf combine --merge-channels --join <join option>
pyhf contrib download
Published by matthewfeickert about 4 years ago
Published by matthewfeickert about 4 years ago
Published by matthewfeickert about 4 years ago