diff --git a/src/pylhe/__init__.py b/src/pylhe/__init__.py index ce07aea3..3d74f583 100644 --- a/src/pylhe/__init__.py +++ b/src/pylhe/__init__.py @@ -7,7 +7,7 @@ from particle.exceptions import MatchingIDNotFound from pylhe._version import version as __version__ -from pylhe.awkward import register_awkward, to_awkward +from pylhe.awkward import to_awkward __all__ = [ "__version__", @@ -22,7 +22,6 @@ "read_lhe_init", "read_lhe_with_attributes", "read_num_events", - "register_awkward", "to_awkward", ] diff --git a/src/pylhe/awkward.py b/src/pylhe/awkward.py index 419f8984..c52a6276 100644 --- a/src/pylhe/awkward.py +++ b/src/pylhe/awkward.py @@ -1,31 +1,13 @@ import awkward as ak import vector -__all__ = ["register_awkward", "to_awkward"] +__all__ = ["to_awkward"] def __dir__(): return __all__ -def register_awkward(): - """ - .. deprecated:: 0.6.0 - Remove use of :func:`~pylhe.awkward.register_awkward` as registration - is automatic. - .. warning:: :func:`~pylhe.awkward.register_awkward` will be removed in - ``pylhe`` ``v0.8.0``. - """ - import warnings - - warnings.warn( - "pylhe.awkward.register_awkward is deprecated as of pylhe v0.6.0 and will be removed in pylhe v0.8.0." - + " Please remove use of pylhe.awkward.register_awkward in favor of automatic registration.", - category=DeprecationWarning, - stacklevel=2, # Raise to user level - ) - - def to_awkward(event_iterable): """Convert iterable of LHEEvent instances to Awkward-Array.""" diff --git a/tests/test_api.py b/tests/test_api.py index f193bb65..c95fac2a 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,5 +1,3 @@ -import pytest - import pylhe @@ -17,18 +15,12 @@ def test_top_level_api(): "read_lhe_init", "read_lhe_with_attributes", "read_num_events", - "register_awkward", "to_awkward", ] def test_awkward_api(): - assert dir(pylhe.awkward) == ["register_awkward", "to_awkward"] - - -def test_deprecated_api_warning(): - with pytest.warns(DeprecationWarning): - pylhe.register_awkward() + assert dir(pylhe.awkward) == ["to_awkward"] def test_load_version(): diff --git a/tests/test_awkward.py b/tests/test_awkward.py index 0c9bfd9e..c4cbaaa3 100644 --- a/tests/test_awkward.py +++ b/tests/test_awkward.py @@ -5,10 +5,6 @@ TEST_FILE = skhep_testdata.data_path("pylhe-testfile-pr29.lhe") -def test_register_awkward(): - pylhe.register_awkward() - - def test_to_awkward(): arr = pylhe.to_awkward(pylhe.read_lhe_with_attributes(TEST_FILE)) assert len(arr) == 791