Visit the tutorials directory for tutorials on the nestpy calls, maintenance, and benchmark plots.
These are the Python bindings for the NEST library, which provides a direct wrapping of functionality. The library is now pythonic, so be weary of the separate naming conventions for functions/variables from the C++ library.
You do not have to have NEST already installed to use this package.
For 64-bit Linux or Mac systems, instally 'nestpy' should just require running:
pip install nestpy
You can then test that it works by running the example above.
Requirements: You must have CMake>=3.6 and a C++17 compatible compiler (GCC>=4.8) to build.
First, you must check out this repository then simply run the installer:
git clone https://github.com/NESTCollaboration/nestpy
cd nestpy
git submodule update --init --recursive
pip install .
Almost all NEST users will want to incorporate some custom code into their workflow, such as custom Detector files or TestSpectra. In order to incorporate that custom code into the nestpy installation, you'll have to copy the files you've edited into the lib/nest/ directory and rerun:
pip install .
In order to create a more efficient workflow, we suggest the user takes the following steps:
[submodule "lib/nest"]
path = lib/nest
url = https://github.com/NESTCollaboration/nest # change this to any custom fork of NEST if you want to use your own code!
[submodule "lib/gcem"]
path = lib/gcem
url = https://github.com/kthohr/gcem.git
[submodule "lib/pybind11"]
path = lib/pybind11
url = https://github.com/pybind/pybind11.git
Python bindings to the NEST library:
import nestpy
# This is same as C++ NEST with naming
nc = nestpy.NESTcalc(nestpy.VDetector())
interaction = nestpy.INTERACTION_TYPE(0) # NR
E = 10 # keV
print('For an %s keV %s' % (E, interaction))
# Get particle yields
y = nc.GetYields(interaction,
E)
print('The photon yield is:', y.PhotonYield)
print('With statistical fluctuations',
nc.GetQuanta(y).photons)
For more examples on possible calls, please see the tests and tutorials folders.
This package is a pybind11 wrapper of NEST that uses GitHub Workflows to build binaries using the manylinux Docker image from this page.
See AUTHORS.md for information on the developers.
When you use nestpy
, please say so in your slides or publications (for publications, see Zenodo link above). You can mention this in addition to how you cite NEST. This is important for us being able to get funding to support this project.