Next-generation Python interface to the HepMC3 C++ library
Project description
A Python wrapper for the HepMC3 C++ library.
Another wrapper is pyhepmc. Why should you use this one?
pyhepmc-ng is easy to install
The command pip install pyhepmc-ng
just works! You only need a compiler that
supports C++11, everything else is handled by pip.
Under the hood, the bindings are build with the excellent
pybind11 library. External installations of pybind11 or HepMC3 are not required, pyhepmc-ng includes the lightweight source code of both libraries with the submodule feature of git
.
pyhepmc-ng is actively developed
pyhepmc-ng 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 also gets official support from the HepMC3 project.
pyhepmc-ng is unit tested
Everything in pyhepmc-ng is unit tested.
pyhepmc-ng is Pythonic
pyhepmc-ng 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-ng 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.
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.