numba-xraylib
Use xraylib in numba nopython functions.
Installation
pip install numba-xraylib
Usage
Simply install numba-xraylib in your environment to use xraylib and xraylib_np in nopython mode:
import xraylib
import xraylib_np
from numba import njit
import numpy as np
@njit
def AtomicWeight(Z):
return xraylib.AtomicWeight(Z), xraylib_np.AtomicWeight(np.array([Z]))
print(AtomicWeight(1)) # (1.01, array([1.01]))
Currently, functions that have non-numeric returns are unsupported. If you know how to pass strings from numba to c please let me know.
Metadata
Release files for numba-xraylib 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| numba_xraylib-0.2.1.tar.gz | 13.2 MB | Details |
Release files / numba_xraylib-0.2.1.tar.gz
| Download URL | numba_xraylib-0.2.1.tar.gz |
|---|---|
| Size | 13.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
433f36411c4f9b085f50bcefa8d152a479f51e4be2dba88f2b9ea498d82dd01d
|
|
BLAKE2b-256 checksum How to use checksums |
e262e1911b20055016e3cfe23e1a2da32811bc30f9d72c576b5f729d5e4ace3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|