Python bindings for the NEST noble element simulation
Project description
nestpy
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.
Installing from PyPI
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.
Installing from source
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 .
Installing with custom NEST code
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:
- Fork the official NEST repository into your own public/private one.
- Make whatever changes to your fork and maintain them with commits.
- Download or fork nestpy and change the NEST entry in the .gitmodules files to point to your custom fork of NEST.
[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
Usage
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.
Support
- Bugs: Please report bugs to the issue tracker on Github such that we can keep track of them and eventually fix them. Please explain how to reproduce the issue (including code) and which system you are running on.
- Help: Help can be provided also via the issue tracker by tagging your issue with 'question'
- Contributing: Please fork this repository then make a pull request. In this pull request, explain the details of your change and include tests.
Technical implementation
This package is a pybind11 wrapper of NEST that uses GitHub Workflows to build binaries using the manylinux Docker image from this page.
- Help from Henry Schreiner, which included a great binding tutorial
- Implementation also based on this
- Implementation of GitHub test and build actions was made possible by Joran Angevaare.
See AUTHORS.md for information on the developers.
Citation
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.
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.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nestpy-2.0.6.tar.gz.
File metadata
- Download URL: nestpy-2.0.6.tar.gz
- Upload date:
- Size: 8.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e1df6c06a57c339e88c3814fefe58222ebc81bbdcd0e85a5f9313b9758875f7
|
|
| MD5 |
acdecb2abf19a7391d2833ed7974413f
|
|
| BLAKE2b-256 |
c7a5fdfbb4548e4d158ccdc4d229def8bf5de27ed58c9c1b6b25b34f55b86a94
|
File details
Details for the file nestpy-2.0.6-cp311-cp311-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp311-cp311-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66aa6e39b1ab0e0fcf32b35e4d9518f7a3b946d53b87321f8b77c2ec3f12f058
|
|
| MD5 |
7a448f01b9ca68c2808ea07db5859f94
|
|
| BLAKE2b-256 |
763f28c9985661855a7fa7dbd03435b3d9a606810068cd05c58443b6a50e12da
|
File details
Details for the file nestpy-2.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 350.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afe9375d4329687942c155d09bbfcb5943741fee98de77de829528ccfd821f26
|
|
| MD5 |
a8f779ff9bb80a76d3cdb5ba17575429
|
|
| BLAKE2b-256 |
089d66ae2e24e5d79b23439103b2b9dcec0806d93437e0f828547404639180e5
|
File details
Details for the file nestpy-2.0.6-cp310-cp310-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp310-cp310-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3e0caf3d6fd9af8656de95357cfe6bbe46b044e750373fdc901156f5eeb38c9
|
|
| MD5 |
b2f4be69eb606d52497614b69b0fed92
|
|
| BLAKE2b-256 |
efd7de9ff81193b0b9b7a28e9180d6ce99566477c3fdbfd8abc87ff86424d274
|
File details
Details for the file nestpy-2.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 349.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6186b88db506a991424601d9e158fef45c9d53bbbde8d67c5f00463f730b95dd
|
|
| MD5 |
fe2dff788b8655ee106e85476affc4d8
|
|
| BLAKE2b-256 |
49704fda045e5ecd3aaf5d8ddd1740b2065b1b7ca853e136fd61b5f901feeaa0
|
File details
Details for the file nestpy-2.0.6-cp39-cp39-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp39-cp39-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fce1604de34aa0c2533d7cf2c93f01d46c729a056b3a6b572b52a3504a6baf6
|
|
| MD5 |
51e56055a4ebafb30b4c1096d5e5a31c
|
|
| BLAKE2b-256 |
c813a24acf36048dcc7e34653f2b55ce7a0f3d01512d55b5a73b0c313ceb028f
|
File details
Details for the file nestpy-2.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 349.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ed7e525f6a359269d8587ea5ddfd81269afdd754044d0c154036c325f985c74
|
|
| MD5 |
b0724d68b72e1dcee2cf6719a5ab98e4
|
|
| BLAKE2b-256 |
b8716f3f712470bd757402ed67e8fadbd08012358f81343a9a76efbf5d429534
|
File details
Details for the file nestpy-2.0.6-cp38-cp38-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp38-cp38-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb690b75212f76f06ae5b712b72a8fd255fdbfb036fd35f77fb013903279d960
|
|
| MD5 |
8cc4a5f81894cd0846ac2f41f772d558
|
|
| BLAKE2b-256 |
d8cbf78eace67c5c5ca3aeec152d1a17c502baf875bf71bdf58a7ba4c4e5c690
|
File details
Details for the file nestpy-2.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nestpy-2.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 349.4 kB
- Tags: CPython 3.8, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd9f44a83d62be3209a8c83c91f883226d4ba0e5f1c0c6318ad5ee140af4df6f
|
|
| MD5 |
d7214f98eafac543303e0cec661b4763
|
|
| BLAKE2b-256 |
a5b9b04fbd59138db00af4c11592d800bd8492298055762928abcf9a854401c6
|