跳转到主要内容

一个用于从Les Houches事件文件中获取结构化数据的小型包

项目描述

pylhe: Python LHE接口

pylhe logo

GitHub Project DOI Scikit-HEP

PyPI version Conda-forge version Supported Python versions

GitHub Actions Status Code Coverage pre-commit.ci status Code style: black

轻量级的Python接口,用于读取Les Houches事件(LHE)文件

安装

要从PyPI安装pylhe,您可以这样做:

python -m pip install pylhe

可视化功能需要外部依赖项Graphviz

开始使用

以下示例提供了一个简单的概述。完整功能可以通过pylhe模块提供的函数进行检查。

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)

引用

引用pylhe的首选BibTeX条目是

@software{pylhe,
  author = {Lukas Heinrich and Matthew Feickert and Eduardo Rodrigues},
  title = "{pylhe: v0.9.0}",
  version = {v0.9.0},
  doi = {10.5281/zenodo.1217031},
  url = {https://github.com/scikit-hep/pylhe},
}

贡献者

我们在此感谢使此项目成为可能的贡献者(表情符号键

Matthew Feickert
Matthew Feickert

🚧 🎨 💻 📖
Lukas
Lukas

🚧 🎨 💻 📖
Eduardo Rodrigues
Eduardo Rodrigues

🚧 💻 📖
Johannes Schumann
Johannes Schumann

💻
Henry Schreiner
Henry Schreiner

💻
ariaradick
ariaradick

💻
Junghwan John Goh
Junghwan John Goh

💻
fuenfundachtzig
fuenfundachtzig

💻
Shantanu Gontia
Shantanu Gontia

💻
Tom Eichlersmith
Tom Eichlersmith

💻
Alexander Puck Neuwirth
Alexander Puck Neuwirth

💻

此项目遵循所有贡献者规范。

项目详情


下载文件

下载适合您平台的文件。如果您不确定要选择哪个,请了解更多关于安装软件包的信息。

源代码发行版

pylhe-0.9.0.tar.gz (17.3 kB 查看哈希)

上传时间 源代码

构建发行版

pylhe-0.9.0-py3-none-any.whl (13.4 kB 查看哈希)

上传时间 Python 3

由以下组织支持

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误日志StatusPageStatusPage状态页面