Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove pyhf.simplemodels.hepdata_like from API #1670

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Making Models from PDFs
~patchset.Patch
simplemodels.uncorrelated_background
simplemodels.correlated_background
simplemodels.hepdata_like

Backends
--------
Expand Down
17 changes: 0 additions & 17 deletions src/pyhf/simplemodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,3 @@ def _deprecated_api_warning(
DeprecationWarning,
stacklevel=3, # Raise to user level
)


def hepdata_like(signal_data, bkg_data, bkg_uncerts, batch_size=None):
"""
.. note:: Deprecated API: Use :func:`~pyhf.simplemodels.uncorrelated_background`
instead.

.. warning:: :func:`~pyhf.simplemodels.hepdata_like` will be removed in
``pyhf`` ``v0.7.0``.
"""
_deprecated_api_warning(
"pyhf.simplemodels.hepdata_like",
"pyhf.simplemodels.uncorrelated_background",
"0.6.2",
"0.7.0",
)
return uncorrelated_background(signal_data, bkg_data, bkg_uncerts, batch_size)
16 changes: 0 additions & 16 deletions tests/test_simplemodels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import warnings

import pytest
import pyhf

Expand Down Expand Up @@ -76,17 +74,3 @@ def test_uncorrelated_background_default_backend(default_backend):
'uncorr_bkguncrt[1]',
]
assert model.config.suggested_init() == [1.0, 1.0, 1.0]


# TODO: Remove when pyhf.simplemodels.hepdata_like is removed in pyhf v0.7.0
def test_deprecated_apis():
with warnings.catch_warnings(record=True) as _warning:
# Cause all warnings to always be triggered
warnings.simplefilter("always")
pyhf.simplemodels.hepdata_like([12.0, 11.0], [50.0, 52.0], [3.0, 7.0])
assert len(_warning) == 1
assert issubclass(_warning[-1].category, DeprecationWarning)
assert (
"pyhf.simplemodels.hepdata_like is deprecated in favor of pyhf.simplemodels.uncorrelated_background"
in str(_warning[-1].message)
)