Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 21, 2023
1 parent 1803673 commit ec4c25c
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions tests/test_lhe_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

TEST_FILE_LHE_v1 = skhep_testdata.data_path("pylhe-testfile-pr29.lhe")
TEST_FILE_LHE_v3 = skhep_testdata.data_path("pylhe-testlhef3.lhe")
TEST_FILE_LHE_INITRWGT_WEIGHTS = skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-hvq.lhe")
TEST_FILE_LHE_RWGT_WGT= skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-W.lhe")
TEST_FILES_LHE_POWHEG = [skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-%s.lhe"%(proc)) for proc in ["Z", "W", "Zj", "trijet","directphoton", "hvq"]]
TEST_FILE_LHE_INITRWGT_WEIGHTS = skhep_testdata.data_path(
"pylhe-testfile-powheg-box-v2-hvq.lhe"
)
TEST_FILE_LHE_RWGT_WGT = skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-W.lhe")
TEST_FILES_LHE_POWHEG = [
skhep_testdata.data_path("pylhe-testfile-powheg-box-v2-%s.lhe" % (proc))
for proc in ["Z", "W", "Zj", "trijet", "directphoton", "hvq"]
]


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -138,7 +143,7 @@ def test_read_lhe_with_attributes_v3():
assert isinstance(e, LHEEvent)


@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG)
@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG)
def test_read_lhe_powheg(file):
"""
Test method read_lhe() on a LesHouchesEvents POWHEG file.
Expand All @@ -149,7 +154,8 @@ def test_read_lhe_powheg(file):
for e in events:
assert isinstance(e, LHEEvent)

@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG)

@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG)
def test_read_lhe_with_attributes_powheg(file):
"""
Test method read_lhe_with_attributes() on a LesHouchesEvents POWHEG file.
Expand All @@ -160,7 +166,8 @@ def test_read_lhe_with_attributes_powheg(file):
for e in events:
assert isinstance(e, LHEEvent)

@pytest.mark.parametrize('file', TEST_FILES_LHE_POWHEG)

@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG)
def test_read_lhe_powheg(file):
"""
Test method read_lhe() on a LesHouchesEvents POWHEG file.
Expand All @@ -171,26 +178,27 @@ def test_read_lhe_powheg(file):
for e in events:
assert isinstance(e, LHEEvent)


def test_read_lhe_initrwgt_weights_v3():
"""
"""
""" """
events = pylhe.read_lhe_with_attributes(TEST_FILE_LHE_INITRWGT_WEIGHTS)

assert events
for e in events:
assert isinstance(e, LHEEvent)
assert len(e.weights) > 0


def test_read_lhe_rwgt_wgt_v3():
"""
"""
""" """
events = pylhe.read_lhe_with_attributes(TEST_FILE_LHE_RWGT_WGT)

assert events
for e in events:
assert isinstance(e, LHEEvent)
assert len(e.weights) > 0


def test_issue_102():
"""
Test a file containing lines starting with "#aMCatNLO".
Expand Down

0 comments on commit ec4c25c

Please sign in to comment.