Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

raypyng

raypyng is a Python interface for RAY-UI, the ray-tracing software developed at Helmholtz-Zentrum Berlin for synchrotron beamlines and X-ray optics.

It loads a beamline saved from RAY-UI as an .rml file, scans beamline parameters, runs traces in parallel, and post-processes the exported rays.

Highlights

  • Works on Linux, macOS, and Windows.
  • Drives RAY-UI from Python through a simple simulation API.
  • Supports parameter scans and parallel execution.
  • Can post-process raw exported rays directly in raypyng.
  • Includes automated unit, smoke, platform, and functional tests.
  • Offers experimental rayx backend support.

Installation

raypyng requires:

  1. RAY-UI installed on your machine.
  2. Python 3.10 or newer.

Install the Python package with:

python3 -m pip install --upgrade raypyng

For local development in this repository:

./tools/bootstrap.sh

On Windows PowerShell:

.\tools\bootstrap_windows.ps1
.\.venv\Scripts\Activate.ps1

Notes:

  • On Linux, xvfb is needed for headless RAY-UI execution.
  • On macOS and Windows, xvfb is not needed.
  • On Windows and macOS, put sim.run(...) under if __name__ == "__main__": when using multiprocessing.

Quickstart

import numpy as np
from raypyng import Simulate

if __name__ == "__main__":
    sim = Simulate("rml/dipole_beamline.rml", hide=True)
    beamline = sim.rml.beamline

    sim.params = [
        {beamline.Dipole.photonEnergy: np.arange(200, 2001, 200)},
    ]
    sim.exports = [{beamline.DetectorAtFocus: ["RawRaysOutgoing"]}]
    sim.simulation_name = "quickstart"
    sim.analyze = False
    sim.raypyng_analysis = True

    sim.run(multiprocessing="auto", force=True)

This writes the simulation output into a RAYPy_Simulation_quickstart folder.

Experimental rayx support

raypyng can also use rayx as an experimental backend:

pip install "raypyng[rayx]"

The integration is still unstable and should be cross-checked against RAY-UI, especially for beamlines with diffraction gratings.

Tests

The repository includes four kinds of automated tests:

  • unit
  • smoke
  • platform
  • functional

See tests/test.md for setup and run commands.

Documentation

Versioning

raypyng follows classic semantic versioning:

  • MAJOR for incompatible or substantial user-facing changes
  • MINOR for backward-compatible new features
  • PATCH for backward-compatible bug fixes and smaller corrections

Contact

For questions about use rights or licensing, contact Simone Vadilonga: simone.vadilonga@helmholtz-berlin.de

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raypyng-2.0.0a3.tar.gz (149.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raypyng-2.0.0a3-py3-none-any.whl (156.7 kB view details)

Uploaded Python 3

File details

Details for the file raypyng-2.0.0a3.tar.gz.

File metadata

  • Download URL: raypyng-2.0.0a3.tar.gz
  • Upload date:
  • Size: 149.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for raypyng-2.0.0a3.tar.gz
Algorithm Hash digest
SHA256 fbe61848857315e1505c18a774d9d067dd475deee547fb28d5408cb25116fd9e
MD5 74000174fdfe331bf8e44e46e1edcd02
BLAKE2b-256 3235ac1eb649a9bbc3ef1e6c0f6e9465d93782b138f1c07eb8f64c00413d4aca

See more details on using hashes here.

File details

Details for the file raypyng-2.0.0a3-py3-none-any.whl.

File metadata

  • Download URL: raypyng-2.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 156.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for raypyng-2.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 a511aa7d5c1453736778cea78bc1e7499f7ab321c694c925c5d0a7c4fef88ce0
MD5 61e5adcda319e9eed5b06810a167015f
BLAKE2b-256 beb05e0028de06b020b2ddf7094cf09831f1e7f8a14e827e55de7ec0839a2a47

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0a3 This release

2 files

1.4.6

2 files

1.4.5

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.53

2 files

1.3.52

2 files

1.3.51

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.914

2 files

1.2.913

2 files

1.2.912

2 files

1.2.911

2 files

1.2.910

2 files

1.2.900

2 files

1.2.892

2 files

1.2.891

2 files

1.2.89

2 files

1.2.88

2 files

1.2.87

2 files

1.2.86

2 files

1.2.85

2 files

1.2.84

2 files

1.2.83

2 files

1.2.82

2 files

1.2.81

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page