Skip to main content

Pythonic interface to the HepMC3 C++ library.

Project description

pyhepmc

A Pythonic wrapper for the HepMC3 C++ library.

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

PyPI version Coverage Scikit-HEP

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

pyhepmc is easy to install

The command pip install pyhepmc should work on all Python versions >= 3.6 and all common architectures, since we publish binary wheels.

Building from source is also easy. External software is not required, pyhepmc comes with the source of both pybind11 for the bindings and HepMC3.

pyhepmc is actively developed

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 also gets official support from the HepMC3 project.

pyhepmc is unit tested

Everything in pyhepmc is unit tested.

pyhepmc is Pythonic

pyhepmc is a hand-crafted mapping of C++ code to Python. It supports Python idioms where appropriate.

  • C++ methods which act like properties are represented as properties, e.g. GenParticle::set_status and GenParticle::status are mapped to a single GenParticle.status field in Python
  • Tuples and lists are implicitly convertible to FourVectors
  • Vectors of objects on the C++ side are mapped to Python lists
  • ReaderAscii and WriterAscii support the context manager protocol
  • A convenient open function is provided for reading and writing HepMC files

Documentation

pyhepmc currently has no separate documentation, but it mirrors the C++ interface of the HepMC3 library, which is documented here: http://hepmc.web.cern.ch/hepmc.

License

pyhepmc is covered by the BSD 3-clause license, see the LICENSE file for details. This license only applies to the pyhepmc code. The connected external libraries HepMC3 and pybind11 are covered by other licenses, as described in their respective LICENSE files.

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.1.1.tar.gz (293.3 kB view hashes)

Uploaded Source

Built Distributions

pyhepmc-2.1.1-cp310-cp310-win_amd64.whl (345.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyhepmc-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyhepmc-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl (386.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyhepmc-2.1.1-cp310-cp310-macosx_10_9_universal2.whl (737.2 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.1.1-cp39-cp39-win_amd64.whl (345.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyhepmc-2.1.1-cp39-cp39-win32.whl (287.1 kB view hashes)

Uploaded CPython 3.9 Windows x86

pyhepmc-2.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (400.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

pyhepmc-2.1.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (419.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

pyhepmc-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl (386.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyhepmc-2.1.1-cp39-cp39-macosx_10_9_universal2.whl (737.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.1.1-cp38-cp38-win_amd64.whl (345.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyhepmc-2.1.1-cp38-cp38-win32.whl (287.1 kB view hashes)

Uploaded CPython 3.8 Windows x86

pyhepmc-2.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (400.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pyhepmc-2.1.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (419.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

pyhepmc-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl (386.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyhepmc-2.1.1-cp38-cp38-macosx_10_9_universal2.whl (737.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

pyhepmc-2.1.1-cp37-cp37m-win_amd64.whl (343.7 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyhepmc-2.1.1-cp37-cp37m-win32.whl (289.9 kB view hashes)

Uploaded CPython 3.7m Windows x86

pyhepmc-2.1.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (402.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pyhepmc-2.1.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (422.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

pyhepmc-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (379.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

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