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.0a2.tar.gz (149.1 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.0a2-py3-none-any.whl (156.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: raypyng-2.0.0a2.tar.gz
  • Upload date:
  • Size: 149.1 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.0a2.tar.gz
Algorithm Hash digest
SHA256 9e3001da7ad47ce00df67d05e65a8521a8738b002dfa36c386616925c589c30c
MD5 993cb37061aaf2f81500ad2d79343de6
BLAKE2b-256 0002614aea7ed74981ef60bddd1b808e7aaef5e6e04eccbc96fcccfed0d9f697

See more details on using hashes here.

File details

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

File metadata

  • Download URL: raypyng-2.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 156.5 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.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2600b80f8e61387f1128e233439e1ca435d9f60814a07c4269d1439c025a28
MD5 acb710de828f285ff04ca1fec0e6cd5f
BLAKE2b-256 1dc67fe48d83210287cff268597060ea3f0b4dc459a261824eeb70d7b58a0a4a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0a2 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