Skip to main content

Pythonic interface to the HepMC3 C++ library licensed under LGPL-v3.

Project description

A Pythonic wrapper for the HepMC3 C++ library.

https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg https://badge.fury.io/py/pyhepmc.svg https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg?branch=main https://zenodo.org/badge/DOI/10.5281/zenodo.7013498.svg

pyhepmc was formerly known as pyhepmc-ng. The development of pyhepmc-ng continues in the pyhepmc package.

HepMC3 has its own Python bindings. Why should you use these?

pyhepmc is easy to install

The command pip install pyhepmc just works on all common platforms. Since we publish binary wheels, you don’t need to compile anything. Since we include the HepMC3 library, you don’t need to install it separately either.

However, building from source is also easy. External software is not required. Just download the repository with git clone --recursive and run pip install -v -e ..

pyhepmc is Pythonic, Numpy-friendy, and Jupyter notebook-friendly

pyhepmc is a hand-crafted mapping of C++ code to Python, see documentation for details, while the official HepMC3 bindings are generated by a script. The pyhepmc API has been optimised for safety, usability, and efficiency by a human expert, something that an automatic tool cannot provide. pyhepmc brings these unique features:

  • Python idioms are supported where appropriate.

  • Simple IO with pyhepmc.open.

  • An alternative Numpy API accelerates event processing up to 70x compared to the standard API.

  • The public API is fully documented with Python docstrings.

  • Objects are inspectable in Jupyter notebooks (have useful repr strings).

  • Events render as graphs in Jupyter notebooks (see next item).

pyhepmc supports visualizations powered by graphviz

pyhepmc can optionally visualize events, using the mature graphviz library as a backend.

docs/_static/pyhepmc.svg

pyhepmc is actively maintained

pyhepmc is part of the Scikit-HEP project, which aims to provide all tools needed by particle physicists to do data analysis in Python. It is developed in close collaboration with the HepMC3 project.

pyhepmc is thoroughly unit tested

We have close to 100% coverage for the Python API.

Documentation

Documentation is available here, and includes some examples (Jupyter notebooks). Furthermore, you can use Python’s help() browser to learn about the API. The documentation is generated from Python docstrings, which are translated from the HepMC3 library, which is documented here.

License

The pyhepmc code is covered by the BSD 3-clause license, but its main functionality comes from bundled software which is released under different licenses. The HepMC3 library is licensed under LGPL-v3 and bundles other software which is released under different licenses. See the files LICENSE and LICENSE_bundled in the source directory for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhepmc-2.14.0rc2.tar.gz (398.2 kB view details)

Uploaded Source

Built Distributions

pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (577.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (595.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

File details

Details for the file pyhepmc-2.14.0rc2.tar.gz.

File metadata

  • Download URL: pyhepmc-2.14.0rc2.tar.gz
  • Upload date:
  • Size: 398.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for pyhepmc-2.14.0rc2.tar.gz
Algorithm Hash digest
SHA256 223fcee1a39fdb21e6838fc2b077925f26d9a5b04e29d051fb1dd8b3707b65b7
MD5 dbdde3f838f2a51667a27f78b8893dbb
BLAKE2b-256 b9fbe36ecefafb6d403cb990cdb739ef9a63cd921f8b7ac0c9b773389f5d46e1

See more details on using hashes here.

File details

Details for the file pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 8398a9de646d86c9c67f0558ff922917981a4111f6b90079b5604e3e22293d0f
MD5 66f9cb62a26ff75ac94391e25263a13b
BLAKE2b-256 80c5cff6d7f62f9dc8dc19a811ab7ec764a3796fa0c0b285659d3524f460a620

See more details on using hashes here.

File details

Details for the file pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for pyhepmc-2.14.0rc2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 63c2449ea83d76a05bb81b5bdc857860a28f3d1883b43bf94483dc6beffb3c94
MD5 c70bf2370359355db0365cb563c4d74c
BLAKE2b-256 811b2db32b63139eb17902181c6aab9c3a09d07bd847f091b2c566a006401543

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page