Skip to content

Atraxus/rayx-python

 
 

Repository files navigation

rayx-python

Python bindings for RAYX, the ray tracing engine for synchrotron optics.

Installation

pip install rayx

Note: Standard installations use a pre-built wheel because the package includes a compiled C++ extension. The supported development source-build workflow is described below.

Requirements

For development builds (not needed for the pip install above):

  • uv — package/environment manager used for development builds. Install guide
  • Python — 3.12 is recommended Download
  • HDF5 — required by rayx-core for compilation. Install via your system package manager (e.g. apt install libhdf5-dev on Debian/Ubuntu, brew install hdf5 on macOS). See the HDF5 docs if you need a different install method.
  • NVIDIA GPU driver — only required for CUDA-accelerated builds. Verify with nvidia-smi. Download
  • CUDA Toolkit — only required for CUDA-accelerated builds. Verify with nvcc --version. Download

If the toolkit is installed but nvcc isn't found, its bin directory is missing from PATH:

export PATH=/usr/local/cuda/bin:$PATH

Make it permanent by adding that line to ~/.bashrc (or ~/.zshrc) and reloading.

Development

Use an editable install for development; it builds the native extension and makes the Python wrapper importable from its normal package location. uv build creates a distributable wheel.

git submodule update --init --recursive
uv sync --locked
uv pip install --no-build-isolation -e .

Re-run the editable-install command after changing the native bindings. The persistent build/<wheel-tag> directory and non-isolated development toolchain retain CMake's build cache, so Ninja recompiles only affected targets in parallel.

Python-only changes are available to the next Python process. After changing C++ or nanobind code, re-run the editable-install command above, then restart the Python process or test run; extension modules cannot be safely replaced in an already-running interpreter.

After the editable install has configured the build directory, cmake --build build/<wheel-tag> -j remains available for a compile-only check. Re-run the editable-install command to also copy the rebuilt extension into the active Python environment.

A tools/bootstrap.sh helper script is also available, wrapping the steps above with CUDA on/off prompting.

Running tests

Tests require the editable install:

uv run pytest tests

Releases

Release artifacts are built, tested, and published only by the wheel CI workflow. It installs every produced wheel outside the checkout and runs the full test suite before publication; do not publish a workstation-built wheel.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 71.6%
  • Python 18.8%
  • Shell 5.7%
  • CMake 3.3%
  • Dockerfile 0.6%