small package to get structured data out of Les Houches Event files
Project description
pylhe: Python LHE interface
Small and thin Python interface to read Les Houches Event (LHE) files
Install
To install pylhe
from PyPI you can just do
python -m pip install pylhe
The visualization capabilities require the external dependency of Graphviz.
Get started
The example below provides a simple overview.
Full functionality can be inspected from the functions provided in the pylhe
module.
import itertools
# You can use LHE files from scikit-hep-testdata
from skhep_testdata import data_path
import pylhe
lhe_file = data_path("pylhe-testlhef3.lhe")
events = pylhe.read_lhe_with_attributes(lhe_file)
print(f"Number of events: {pylhe.read_num_events(lhe_file)}")
# Get event 1
event = next(itertools.islice(events, 1, 2))
# A DOT language graph of the event can be inspected as follows
print(event.graph.source)
# The graph is nicely displayed as SVG in Jupyter notebooks
event
# To save a DOT graph render the graph to a supported image format
# (refer to the Graphviz documentation for more)
event.graph.render(filename="test", format="png", cleanup=True)
event.graph.render(filename="test", format="pdf", cleanup=True)
Citation
The preferred BibTeX entry for citation of pylhe
is
@software{pylhe,
author = {Lukas Heinrich and Matthew Feickert and Eduardo Rodrigues},
title = "{pylhe: v0.5.1}",
version = {v0.5.1},
doi = {10.5281/zenodo.1217031},
url = {https://github.com/scikit-hep/pylhe},
}
Contributors
We hereby acknowledge the contributors that made this project possible (emoji key):
Matthew Feickert 🚧 🎨 💻 📖 |
Lukas 🚧 🎨 💻 📖 |
Eduardo Rodrigues 🚧 💻 📖 |
Johannes Schumann 💻 |
Henry Schreiner 💻 |
ariaradick 💻 |
Junghwan John Goh 💻 |
fuenfundachtzig 💻 |
Shantanu Gontia 💻 |
Tom Eichlersmith 💻 |
This project follows the all-contributors specification.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pylhe-0.5.1.tar.gz
.
File metadata
- Download URL: pylhe-0.5.1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9802208be1d0bac449354e77019d7952dfbd7b6f88e9025e14f3d85b1af9e6c6 |
|
MD5 | 7357769ff3294ea2fe41cb3accb4c5f2 |
|
BLAKE2b-256 | dcfc05ad5af3afc85d41320c3389f2a2ab20dfc534be724d6d92fd7a583dd7ff |
File details
Details for the file pylhe-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: pylhe-0.5.1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 726f6013a9e9dca63796e1f2bffb817b1a4c49741e415a21a5b0daf5ca8a3b46 |
|
MD5 | 5bb4074dc0c58e7338be39a3eb3ac80a |
|
BLAKE2b-256 | 00687f93a6dee355a7f04db492f1f82626f62382ca25741cd971246aaf9b2271 |