Next-generation Python interface to the HepMC3 C++ library
A Python wrapper for the HepMC3 C++ library.
Another wrapper is pyhepmc. Why should you use this one?
pyhepmc-ng is easy to install
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
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
openfunction is provided for reading and writing HepMC files
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.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyhepmc_ng-0.4.3.tar.gz (220.4 kB)||File type Source||Python version None||Upload date||Hashes View|