Skip to content

Commit 04f3577

Browse files
APN-Puckypre-commit-ci[bot]eduardo-rodrigues
authored
docs: tested/supported MCEGs and drop Python 3.8 support (#298)
* add tested/supported MCEGs * bump testdata dep * drop python3.8 since scikit-hep-testdata does not support it anymore * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remvoe more python 3.8 * Test read generator files * Update README.md Co-authored-by: Eduardo Rodrigues <[email protected]> * fix: missing rename from powheg -> generators in tests * fix: no madgraph5 version prefix 5 since it is in the name * Update README.md --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eduardo Rodrigues <[email protected]>
1 parent 0bc728b commit 04f3577

File tree

5 files changed

+47
-11
lines changed

5 files changed

+47
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
os: [ubuntu-latest]
27-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
27+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2828

2929
steps:
3030
- uses: actions/checkout@v4

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717

1818
Small and thin Python interface to read [Les Houches Event (LHE)](https://inspirehep.net/record/725284) files
1919

20+
21+
## Tested Monte Carlo Generators' LHE output
22+
23+
| Generator | Tested Versions |
24+
|------------------------------------------------|-----------------------|
25+
| [MadGraph5](https://launchpad.net/mg5amcnlo) | 2.0.0, 2.2.1, 3.5.8 |
26+
| [POWHEG-BOX-V2](http://powhegbox.mib.infn.it/) | r4027 |
27+
| [Pythia](https://pythia.org/) | 6.413, 8.3.14 |
28+
| [Sherpa](https://sherpa-team.gitlab.io/) | 3.0.1 |
29+
| [Whizard](https://whizard.hepforge.org/) | 3.1.4 |
30+
31+
Note: test files are provided via the [scikit-hep-testdata](https://github.com/scikit-hep/scikit-hep-testdata) package. Please open an issue of create directly a PR for the inclusion of new files for testing.
2032
## Install
2133

2234
To install `pylhe` from PyPI you can just do

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dynamic = ["version"]
1111
description = "A small package to get structured data out of Les Houches Event files"
1212
readme = "README.md"
1313
license = { text = "Apache-2.0" } # SPDX short identifier
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.9"
1515
authors = [
1616
{ name = "Lukas Heinrich", email = "[email protected]" },
1717
{ name = "Matthew Feickert", email = "[email protected]" },
@@ -30,7 +30,6 @@ classifiers = [
3030
"License :: OSI Approved :: Apache Software License",
3131
"Programming Language :: Python :: 3",
3232
"Programming Language :: Python :: 3 :: Only",
33-
"Programming Language :: Python :: 3.8",
3433
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
@@ -54,7 +53,7 @@ test = [
5453
"pydocstyle",
5554
"pytest-cov>=2.5.1",
5655
"pytest>=6.0",
57-
"scikit-hep-testdata>=0.4.36",
56+
"scikit-hep-testdata>=0.5.5",
5857
]
5958
develop = [
6059
"pylhe[lint,test]",

src/pylhe/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import gzip
22
import io
33
import xml.etree.ElementTree as ET
4-
from typing import Iterable, Optional
4+
from collections.abc import Iterable
5+
from typing import Optional
56

67
import graphviz
78
from particle import latex_to_html_name

tests/test_lhe_reader.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
skhep_testdata.data_path(f"pylhe-testfile-powheg-box-v2-{proc}.lhe")
2121
for proc in ["Z", "W", "Zj", "trijet", "directphoton", "hvq"]
2222
]
23+
TEST_FILES_LHE_MADGRAPH = [
24+
skhep_testdata.data_path("pylhe-testfile-madgraph-2.0.0-wbj.lhe"),
25+
skhep_testdata.data_path("pylhe-testfile-madgraph-2.2.1-Z-ckkwl.lhe.gz"),
26+
skhep_testdata.data_path("pylhe-testfile-madgraph-2.2.1-Z-fxfx.lhe.gz"),
27+
skhep_testdata.data_path("pylhe-testfile-madgraph-2.2.1-Z-mlm.lhe.gz"),
28+
skhep_testdata.data_path("pylhe-testfile-madgraph5-3.5.8-pp_to_jj.lhe.gz"),
29+
]
30+
TEST_FILES_LHE_PYTHIA = [
31+
skhep_testdata.data_path("pylhe-testfile-pythia-6.413-ttbar.lhe"),
32+
skhep_testdata.data_path("pylhe-testfile-pythia-8.3.14-weakbosons.lhe"),
33+
]
34+
TEST_FILES_LHE_SHERPA = [
35+
skhep_testdata.data_path("pylhe-testfile-sherpa-3.0.1-eejjj.lhe"),
36+
]
37+
TEST_FILES_LHE_WHIZARD = [
38+
skhep_testdata.data_path("pylhe-testfile-whizard-3.1.4-eeWW.lhe"),
39+
]
40+
TEST_FILES_LHE_GENERATORS = [
41+
*TEST_FILES_LHE_MADGRAPH,
42+
*TEST_FILES_LHE_POWHEG,
43+
*TEST_FILES_LHE_PYTHIA,
44+
*TEST_FILES_LHE_SHERPA,
45+
*TEST_FILES_LHE_WHIZARD,
46+
]
2347

2448

2549
@pytest.fixture(scope="session")
@@ -141,10 +165,10 @@ def test_read_lhe_with_attributes_v3():
141165
assert isinstance(e, LHEEvent)
142166

143167

144-
@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG)
145-
def test_read_lhe_powheg(file):
168+
@pytest.mark.parametrize("file", TEST_FILES_LHE_GENERATORS)
169+
def test_read_lhe_generator(file):
146170
"""
147-
Test method read_lhe() on several types of LesHouchesEvents POWHEG files.
171+
Test method read_lhe() on several types of LesHouchesEvents generator files.
148172
"""
149173
events = pylhe.read_lhe(file)
150174

@@ -153,10 +177,10 @@ def test_read_lhe_powheg(file):
153177
assert isinstance(e, LHEEvent)
154178

155179

156-
@pytest.mark.parametrize("file", TEST_FILES_LHE_POWHEG)
157-
def test_read_lhe_with_attributes_powheg(file):
180+
@pytest.mark.parametrize("file", TEST_FILES_LHE_GENERATORS)
181+
def test_read_lhe_with_attributes_generator(file):
158182
"""
159-
Test method read_lhe_with_attributes() on several types of LesHouchesEvents POWHEG files.
183+
Test method read_lhe_with_attributes() on several types of LesHouchesEvents generator files.
160184
"""
161185
events = pylhe.read_lhe_with_attributes(file)
162186

0 commit comments

Comments
 (0)