REVIEW 2 major objections 5 minor 56 references
pylhe: A Lightweight Python interface to Les Houches Event files
T0 review · 2 major / 5 minor · reviewed 2026-08-03 · deepseek-v4-flash
Pith's one-line read pylhe is a lightweight pure-Python library that reads and writes Les Houches Event files, including version 3.0 features and the HDF5-based LHEH5 format.
desk verdict A genuinely useful, clearly written software paper that leaves its load-bearing streaming claim unverifiable in the text—deserving a real referee who can check the code. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The central mechanism is the event iterator: a generator that parses and yields one LHE event at a time from either an XML-based .lhe file or an LHEH5 file, backed by a shared set of Python data structures for the run block, particles, and weights. The iterator carries the load-bearing promise of memory efficiency, since a caller never holds more than a single parsed event at once. Around it sit the parser for the whitespace-separated <init> and <event> blocks, an HDF5 backend for LHEH5, and conversion routines that reuse the same data structures.
What would settle it
Monitor peak RSS while reading a multi-gigabyte LHE file: if memory grows with file size instead of plateauing near the size of a single event, the streaming claim fails. Inspecting the source to confirm the XML parser used is a streaming parser (iterparse) rather than a whole-file parse would also settle it.
Extended reading notes
Core claim
The discovery is that a pure-Python implementation can provide the full functionality of LHE 3.0 together with the newer LHEH5 representation in a small, dependency-light package. Internally, events are parsed from the XML structure of the LHE file, and the library uses shared Python data structures for run information and particles so that the same object model works for text and HDF5 sources. A pythonic iterator yields one event at a time, which the paper argues makes memory-efficient processing of arbitrarily large event samples possible. The library further exposes conversion between text, compressed text, and HDF5 formats, and output to columnar data structures for vectorized analyses.
Load-bearing premise
The load-bearing premise is that the library actually streams events one at a time rather than loading the entire file into memory, so memory use stays flat; the paper asserts this but gives no benchmark or implementation detail to confirm it.
Editorial extensions
If this is right
- Files of arbitrary size can be processed without loading all events into memory, enabling large Monte Carlo samples to be read in Python.
- LHE 3.0 features such as multiple weights and weight groups are fully available, so Python workflows no longer need a separate C++/Fortran interface to access them.
- The same code path handles .lhe, .lhe.gz, and LHEH5 files, making format conversion straightforward.
- Columnar output gives machine-learning and vectorized analysis pipelines a direct route from generator output to training data.
Reading between the lines
- A testable consequence the paper leaves implicit is that peak memory should be roughly constant (proportional to one event) regardless of file size; a benchmark on multi-gigabyte files would directly confirm or deny the central usability claim.
- The authors do not report parsing speed or benchmarks; a natural extension would be comparing throughput against whole-file parsing and against other language interfaces.
- If LHEH5 adoption grows, pylhe could become the de facto Python bridge for HDF5 event storage, a role no other maintained library currently fills.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript describes pylhe, a pure-Python library for reading and writing Les Houches Event (LHE) files. It claims support for .lhe and .lhe.gz files, full LHE 3.0 features (multiple weights, scales, generator metadata), and the HDF5-based LHEH5 format, with a pythonic iterator designed for memory-efficient streaming. It also mentions integration with Awkward Array via to_awkward() and lists several HEP papers that cite pylhe. The paper provides context, a comparison with LHE libraries in other languages, and a statement of research impact, but contains no code examples, API demonstration, tests, or benchmarks.
Significance. If the central claims are correct, pylhe is a genuinely useful contribution to the Python HEP ecosystem: a lightweight, pure-Python LHE reader/writer would fill a long-standing gap, support LHE 3.0 metadata, and ease integration with modern columnar and machine-learning workflows. The list of external publications using pylhe is strong evidence of demand and adoption. However, the main technical claim—memory-efficient streaming of arbitrarily large files—is asserted without implementation evidence or measurement, and the 'complete LHE 3.0' claim is not backed by a conformance suite. These are fixable omissions, but they are load-bearing for the paper's stated value proposition.
major comments (2)
- [Software design] The central claim of memory-efficient streaming is unsupported. The paper states that 'pylhe uses xml.etree.ElementTree to parse the XML structure' and that it processes 'arbitrarily large LHE files by streaming events one at a time.' ElementTree has two very different parsing modes: ET.parse() builds a full in-memory tree, while ET.iterparse() is incremental. Even with iterparse, memory grows if parsed element subtrees are not cleared (e.g., elem.clear()). The manuscript does not say which mode is used, provides no code snippet, and reports no memory benchmark. If the implementation uses parse(), the 'arbitrarily large' claim fails. This needs to be resolved by describing the actual code path and/or by a simple memory-vs-file-size benchmark.
- [Summary and Software design] The claim that pylhe 'completely implements' LHE 3.0 is not evidenced by any conformance, round-trip, or unit test. The paper lists the supported tags, but gives no example of parsed output and no demonstration that these tags are correctly parsed and written back. Similarly, the statement that LHEH5 improves read/write performance and reduces file sizes is an empirical claim with no supporting data. For a software paper, a minimal test suite or a reference to a repository with tests is essential to substantiate these functional claims.
minor comments (5)
- [Statement of need] The text contains 'HER WIG' and 'HER WIG 6' in two places; the generator is conventionally written 'HERWIG'.
- [References] Several DOIs are malformed, for example Andersen et al. (2014), Butterworth et al. (2010), and Moretti et al. (2001) contain duplicated 'https://doi.org/ https://doi.org/...' strings. These should be cleaned up.
- [Software design] The statement that 'lxml did not provide a significant speed up' is unquantified. A single sentence with a rough timing comparison would make this credible, or the statement should be softened.
- [General] The manuscript contains no usage example or installation instruction. Since one of the stated advantages is 'easy to use' and 'pythonic', a minimal code block showing how to iterate over a file and access a few attributes would greatly help readers assess the interface.
- [State of the field] The statement that competing Python libraries have 'less adoption' is asserted without evidence. Either provide a metric (e.g., GitHub stars, downloads) or rephrase as a qualitative observation.
Circularity Check
No circularity found: software paper with no derivation chain; the streaming concern is a verification gap, not a circular step.
full rationale
This is a software paper, not a derivation or modeling paper. There are no equations, fitted parameters, or predicted quantities whose derivation could reduce to inputs by construction. The central claims are implementation and support claims: pylhe reads/writes LHE and LHEH5 files, supports LHE 3.0 features, and streams events through a Python iterator. These are stated capabilities of an open-source library, not results derived from fitted data or from a self-citation chain. The LHE and LHEH5 specifications cited (Alwall et al. 2007, Andersen et al. 2014, Bothmann et al. 2024, Höche et al. 2019) are external format definitions that the software implements; using them as inputs is not circular. The research-impact section cites external papers that used pylhe as adoption evidence; one of those (Kofler et al. 2025) includes a current author, but this is not load-bearing for any functional result — it is usage/marketing evidence. The skeptic's concern that the memory-efficient streaming claim for arbitrarily large files is unverified because the paper does not state whether xml.etree.ElementTree.parse or iterparse is used, and provides no benchmarks, is a legitimate verification or correctness risk. However, an unsubstantiated capability claim is not a circular argument: it does not make the claimed capability equivalent to its input by construction. Under the hard rules, no specific reduction can be quoted, so the circularity score is 0.
Assumptions & free parameters
assumptions (3)
- domain assumption The LHE 3.0 specification (Andersen et al. 2014) is authoritative and the implementation can fully capture all its features.
- domain assumption HDF5 via h5py provides a faithful round-trip of LHE event information.
- domain assumption xml.etree.ElementTree parses LHE files correctly and the chosen parsing mode (iterparse or parse) supports the claimed memory-efficient streaming.
Cite this review
Pith. "Pith review of pylhe: A Lightweight Python interface to Les Houches Event files." pith.science (2026). https://pith.science/paper/UEAJDDIV
@misc{pith2026260729352,
author = {Pith},
title = {Pith review of: pylhe: A Lightweight Python interface to Les Houches Event files},
year = {2026},
howpublished = {\url{https://pith.science/paper/UEAJDDIV}},
note = {Machine review of arXiv:2607.29352}
}
read the original abstract
Les Houches Event files are a standard format for Monte Carlo event generators in high-energy physics. pylhe is a lightweight pure-Python library for reading and writing LHE event data. It supports .lhe and compressed .lhe.gz files, implements the widely used LHE 3.0 features including multiple event weights and generator metadata, and also supports the recent HDF5-based LHEH5 format. By exposing events through a pythonic iterator and shared data structures, pylhe enables memory-efficient processing of large event samples without loading entire files into memory. The library also supports format conversion and integration with modern analysis workflows, including columnar analysis with Awkward Array and downstream machine-learning applications.
Reference graph
Works this paper leans on
-
[1]
Albert, A. (2021). Lhereader. GitHub. https://github.com/AndreasAlbert/lhereader
2021
-
[2]
Alioli, S., Nason, P., Oleari, C., & Re, E. (2010). A general framework for implementing NLO calculations in shower Monte Carlo programs: the POWHEG BOX . JHEP, 06, 043. https://doi.org/10.1007/JHEP06(2010)043
-
[3]
Alwall, J., Frederix, R., Frixione, S., Hirschi, V., Maltoni, F., Mattelaer, O., Shao, H.-S., Stelzer, T., Torrielli, P., & Zaro, M. (2014). The automated computation of tree-level and next-to-leading order differential cross sections, and their matching to parton shower simulations . JHEP, 07, 079. https://doi.org/10.1007/JHEP07(2014)079
-
[4]
Alwall, J., & others. (2007). A Standard format for Les Houches event files . Comput. Phys. Commun., 176, 300--304. https://doi.org/10.1016/j.cpc.2006.11.010
-
[5]
Andersen, J. R., & others. (2014). Les Houches 2013: Physics at TeV Colliders: Standard Model Working Group Report . https://doi.org/https://doi.org/10.48550/arXiv.1405.1067
-
[6]
Anisha, Atkinson, O., Bhardwaj, A., Englert, C., Naskar, W., & Stylianou, P. (2023). BSM reach of four-top production at the LHC . Phys. Rev. D, 108(3), 035001. https://doi.org/10.1103/PhysRevD.108.035001
-
[7]
Bahr, M., & others. (2008). Herwig++ Physics and Manual . Eur. Phys. J. C, 58, 639--707. https://doi.org/10.1140/epjc/s10052-008-0798-9
-
[8]
Bellm, J., & others. (2016). Herwig 7.0/Herwig++ 3.0 release note . Eur. Phys. J. C, 76(4), 196. https://doi.org/10.1140/epjc/s10052-016-4018-8
Show all 56 references
-
[9]
Bellm, J., & others. (2020). Herwig 7.2 release note . Eur. Phys. J. C, 80(5), 452. https://doi.org/10.1140/epjc/s10052-020-8011-x
2020 doi
-
[10]
Beresford, L., Clawson, S., & Liu, J. (2024). Strategy to measure tau g-2 via photon fusion in LHC proton collisions . Phys. Rev. D, 110(9), 092016. https://doi.org/10.1103/PhysRevD.110.092016
2024 doi
-
[11]
Beresford, L., & Liu, J. (2019). Search Strategy for Sleptons and Dark Matter Using the LHC as a Photon Collider . Phys. Rev. Lett., 123(14), 141801. https://doi.org/10.1103/PhysRevLett.123.141801
2019 doi
-
[12]
Bewick, G., & others. (2024). Herwig 7.3 release note . Eur. Phys. J. C, 84(10), 1053. https://doi.org/10.1140/epjc/s10052-024-13211-9
2024 doi
-
[13]
M., Gutschow, C., Lonnblad, L., Procter, T., Richardson, P., & Yeh, Y
Bierlich, C., Buckley, A., Butterworth, J. M., Gutschow, C., Lonnblad, L., Procter, T., Richardson, P., & Yeh, Y. (2024). Robust independent validation of experiment and theory: Rivet version 4 release note . SciPost Phys. Codeb., 36, 1. https://doi.org/10.21468/SciPostPhysCodeb.36
2024 doi
-
[14]
Bierlich, C., & others. (2020). Robust Independent Validation of Experiment and Theory: Rivet version 3 . SciPost Phys., 8, 026. https://doi.org/10.21468/SciPostPhys.8.2.026
2020 doi
-
[15]
Bierlich, C., & others. (2022). A comprehensive guide to the physics and usage of PYTHIA 8.3 . SciPost Phys. Codeb., 2022, 8. https://doi.org/10.21468/SciPostPhysCodeb.8
2022 doi
-
[16]
Binet, S., Wieck, B., Blyth, D., Busato, E., Ughetto, M., & Waller, P. (2017). Go-HEP: Libraries for high energy physics analyses in go. Journal of Open Source Software, 2(17), 372. https://doi.org/10.21105/joss.00372
2017 doi
-
[17]
Biswas, D. (2017). Lhereader. GitHub. https://github.com/diptaparna/lhereader
2017
-
[18]
(2001, September)
Boos, E., & others. (2001, September). Generic User Process Interface for Event Generators . 2nd Les Houches Workshop on Physics at TeV Colliders . https://arxiv.org/abs/hep-ph/0109068
2001 arXiv
-
[19]
Bothmann, E., Childers, T., Gütschow, C., Höche, S., Hovland, P., Isaacson, J., Knobbe, M., & Latham, R. (2024). Efficient precision simulation of processes with many-jet final states at the LHC . Phys. Rev. D, 109(1), 014013. https://doi.org/10.1103/PhysRevD.109.014013
2024 doi
-
[20]
Bothmann, E., & others. (2019). Event Generation with Sherpa 2.2 . SciPost Phys., 7(3), 034. https://doi.org/10.21468/SciPostPhys.7.3.034
2019 doi
-
[21]
Brehmer, J., Dawson, S., Homiller, S., Kling, F., & Plehn, T. (2019). Benchmarking simplified template cross sections in \(WH\) production . JHEP, 11, 034. https://doi.org/10.1007/JHEP11(2019)034
2019 doi
-
[22]
Brehmer, J., Kling, F., Espejo, I., & Cranmer, K. (2020). MadMiner: Machine learning-based inference for particle physics . Comput. Softw. Big Sci., 4(1), 3. https://doi.org/10.1007/s41781-020-0035-2
2020 doi
-
[23]
Buckley, A., Butterworth, J., Grellscheid, D., Hoeth, H., Lonnblad, L., Monk, J., Schulz, H., & Siegert, F. (2013). Rivet user manual . Comput. Phys. Commun., 184, 2803--2819. https://doi.org/10.1016/j.cpc.2013.05.021
2013 doi
- [24]
-
[25]
J., Soffer, A., & Wang, Z
Cheung, K., Kim, Y., Kwon, Y., Ouseph, C. J., Soffer, A., & Wang, Z. S. (2024). Probing dark photons from a light scalar at Belle II . JHEP, 05, 094. https://doi.org/10.1007/JHEP05(2024)094
2024 doi
-
[26]
Collette, A. (2013). Python and HDF5: Unlocking scientific data (p. 152). O'Reilly Media, Inc. ISBN: 9781491945001
2013
-
[27]
G., Marchesini, G., Moretti, S., Odagiri, K., Richardson, P., Seymour, M
Corcella, G., Knowles, I. G., Marchesini, G., Moretti, S., Odagiri, K., Richardson, P., Seymour, M. H., & Webber, B. R. (2001). HERWIG 6: An Event generator for hadron emission reactions with interfering gluons (including supersymmetric processes) . JHEP, 01, 010. https://doi....
2001 doi
-
[28]
Dembinski, H., Rodrigues, E., & Fedynitch, A. (2022). Scikit-hep/pyhepmc: v2.1.1 (Version v2.1.1). Zenodo. https://doi.org/10.5281/zenodo.7013498
2022 doi
-
[29]
Dobbs, M., & Hansen, J. B. (2001). The HepMC C++ Monte Carlo event record for High Energy Physics . Comput. Phys. Commun., 134, 41--46. https://doi.org/10.1016/S0010-4655(00)00189-2
2001 doi
-
[30]
Feuerstake, F., Fuchs, E., Robens, T., & Winterbottom, D. (2025). Interference effects in resonant di-Higgs production at the LHC in the Higgs singlet extension . JHEP, 04, 094. https://doi.org/10.1007/JHEP04(2025)094
2025 doi
-
[31]
Fischer, K., & Ling, J. (2023). LHEF.jl. GitHub. https://github.com/JuliaHEP/LHEF.jl
2023
-
[32]
Frixione, S., Nason, P., & Oleari, C. (2007). Matching NLO QCD computations with Parton Shower simulations: the POWHEG method . JHEP, 11, 070. https://doi.org/10.1088/1126-6708/2007/11/070
2007 doi
-
[33]
Fukuda, H. (2018). Lhe-rs. GitHub. https://github.com/hajifkd/lhe-rs
2018
-
[34]
Gleisberg, T., Hoeche, Stefan., Krauss, F., Schonherr, M., Schumann, S., Siegert, F., & Winter, J. (2009). Event generation with SHERPA 1.1 . JHEP, 02, 007. https://doi.org/10.1088/1126-6708/2009/02/007
2009 doi
-
[35]
Höche, S., Prestel, S., & Schulz, H. (2019). Simulation of Vector Boson Plus Many Jet Final States at the High Luminosity LHC . Phys. Rev. D, 100(1), 014024. https://doi.org/10.1103/PhysRevD.100.014024
2019 doi
-
[36]
J., Kling, F., Tuckler, D., & Zhang, Y
Kelly, K. J., Kling, F., Tuckler, D., & Zhang, Y. (2022). Probing neutrino-portal dark matter at the Forward Physics Facility . Phys. Rev. D, 105(7), 075026. https://doi.org/10.1103/PhysRevD.105.075026
2022 doi
-
[37]
Kilian, W., Ohl, T., & Reuter, J. (2011). WHIZARD: Simulating Multi-Particle Processes at LHC and ILC . Eur. Phys. J. C, 71, 1742. https://doi.org/10.1140/epjc/s10052-011-1742-y
2011 doi
-
[38]
Kling, F. (2020). Probing light gauge bosons in tau neutrino experiments . Phys. Rev. D, 102(1), 015007. https://doi.org/10.1103/PhysRevD.102.015007
2020 doi
-
[39]
Kling, F., Kuo, J.-L., Trojanowski, S., & Tsai, Y.-D. (2023). FLArE up dark sectors with EM form factors at the LHC forward physics facility . Nucl. Phys. B, 987, 116103. https://doi.org/10.1016/j.nuclphysb.2023.116103
2023
-
[40]
Kling, F., & Trojanowski, S. (2020). Looking forward to test the KOTO anomaly with FASER . Phys. Rev. D, 102(1), 015032. https://doi.org/10.1103/PhysRevD.102.015032
2020 doi
-
[41]
Kofler, A., Stimper, V., Mikhasenko, M., Kagan, M., & Heinrich, L. (2025). Flow annealed importance sampling bootstrap meets differentiable particle physics . Mach. Learn. Sci. Tech., 6(2), 025061. https://doi.org/10.1088/2632-2153/addbc1
2025 doi
-
[42]
Lawrence, S. (2019). Lhe.hs. GitHub. https://github.com/bytbox/lhe.hs
2019
-
[43]
Maier, A. (2024a). Event-file-reader. GitHub. https://github.com/a-maier/event-file-reader
-
[44]
Maier, A. (2024b). Lhef. GitHub. https://github.com/a-maier/lhef
- [45]
-
[46]
Nason, P. (2004). A New method for combining NLO QCD with shower Monte Carlo algorithms . JHEP, 11, 040. https://doi.org/10.1088/1126-6708/2004/11/040
2004 doi
-
[47]
Pivarski, J., Osborne, I., Ifrim, I., Schreiner, H., Hollands, A., Biswas, A., Das, P., Roy Choudhury, S., Smith, N., Goyal, M., Fackeldey, P., & Krommydas, I. (2018). Awkward Array . https://doi.org/10.5281/zenodo.4341376
2018 doi
-
[48]
Sjostrand, T., Mrenna, S., & Skands, P. Z. (2006). PYTHIA 6.4 Physics and Manual . JHEP, 05, 026. https://doi.org/10.1088/1126-6708/2006/05/026
2006 doi
-
[49]
Sjostrand, T., Mrenna, S., & Skands, P. Z. (2008). A Brief Introduction to PYTHIA 8.1 . Comput. Phys. Commun., 178, 852--867. https://doi.org/10.1016/j.cpc.2008.01.036
2008 doi
-
[50]
R., Corke, R., Desai, N., Ilten, P., Mrenna, S., Prestel, S., Rasmussen, C
Sjöstrand, T., Ask, S., Christiansen, J. R., Corke, R., Desai, N., Ilten, P., Mrenna, S., Prestel, S., Rasmussen, C. O., & Skands, P. Z. (2015). An introduction to PYTHIA 8.2 . Comput. Phys. Commun., 191, 159--177. https://doi.org/10.1016/j.cpc.2015.01.024
2015 doi
-
[51]
Stylianou, P., & Weiglein, G. (2024). Constraints on the trilinear and quartic Higgs couplings from triple Higgs production at the LHC and beyond . Eur. Phys. J. C, 84(4), 366. https://doi.org/10.1140/epjc/s10052-024-12722-9
2024 doi
-
[52]
The HDF Group. (1998). HDF5 -- hierarchical data format version 5 . https://www.hdfgroup.org/HDF5/
1998
-
[53]
Verbytskyi, A., Buckley, A., Grellscheid, D., Konstantinov, D., William Monk, J., Lönnblad, L., Przedzinski, T., & Pokorski, W. (2020). HepMC3 Event Record Library for Monte Carlo Event Generators . J. Phys. Conf. Ser., 1525(1), 012017. https://doi.org/10.1088/1742-6596/1525/1/012017
2020 doi
-
[54]
Weber, T. (2018). Lhef-rs. GitHub. https://github.com/tweber12/lhef-rs
2018
-
[55]
Zhou, H., & Liu, N. (2022). Probing compressed higgsinos with forward protons at the LHC . JHEP, 10, 092. https://doi.org/10.1007/JHEP10(2022)092
2022 doi
-
[56]
Zhou, H., & Liu, N. (2025). Search for nearly degenerate higgsinos via photon fusion with the semileptonic channel at the LHC . Nucl. Phys. B, 1010, 116752. https://doi.org/10.1016/j.nuclphysb.2024.116752 CSLReferences document
2025
Reviewed August 3, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.