Skip to main content

X-ray grating simulations

Project description

grax

grax is an independent Python package for diffraction-grating simulations in X-ray optics, inspired by RETICOLO v9 and extended with higher-level workflows for practical studies.

Documentation

Full user and API documentation is published online.

  • User guide and tutorials: see the project documentation site
  • API reference: see the API section in the documentation site

For local docs builds from this repository, use:

tools/build_docs.sh --html

Installation

graxpy supports Python 3.12 and 3.13 only.

python -m pip install graxpy

PyPI project page: https://pypi.org/project/graxpy/0.1.0/

For local editable installs:

python -m pip install -e .

Local web app

Install the package and web extra, then start the local server:

python -m pip install -e ".[web]"
grax-web

Then open http://127.0.0.1:5050. Use the home page to create and save gratings, then open the plot page to combine saved runs and select the diffraction orders to overlay. Plot previews, saved comparison pages, and run-progress plots are interactive Plotly figures in the browser.

Start on a different port when needed:

grax-web --port 8000

You can also override the bind address:

grax-web --host 0.0.0.0 --port 8000

When developing the web app locally, restart grax-web after changing run-state or UI logic so the browser sees the updated server behavior.

Local data is stored in .grax-web/ by default:

  • saved gratings: .grax-web/saved_gratings/
  • run results: .grax-web/runs/
  • combined plots: .grax-web/plots/
  • grating previews: .grax-web/previews/

Each saved run lives in .grax-web/runs/<run_id>/ and includes:

  • manifest.json
  • summary.csv
  • all_orders.csv
  • selected_efficiency.json

Use Plots to combine saved runs and choose which diffraction orders to overlay for each run. Interactive plots can still be exported as PNG files through the built-in folder browser. Use Manage runs to rename runs or bulk delete them.

Repository at a glance

  • src/grax/: core package source code
  • examples/: runnable examples
  • docs/: documentation sources

Attribution

grax is inspired by RETICOLO v9. This project is an independent Python implementation and is not an official RETICOLO distribution. RETICOLO is not bundled as part of the public graxpy package distribution.

License

Copyright (C) [2026] [Helmholtz-Berlin fur Materialen und Energie GmbH (HZB)]

Licensed under the European Union Public License (EUPL), Version 1.2.

You may not use this work except in compliance with the License.

A copy of the License is available at: https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12

Project details


Download files

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

Source Distribution

graxpy-0.3.1.tar.gz (170.8 kB view details)

Uploaded Source

Built Distribution

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

graxpy-0.3.1-py3-none-any.whl (146.2 kB view details)

Uploaded Python 3

File details

Details for the file graxpy-0.3.1.tar.gz.

File metadata

  • Download URL: graxpy-0.3.1.tar.gz
  • Upload date:
  • Size: 170.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.13

File hashes

Hashes for graxpy-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7830e665fa3f3b936a32fddcb8f48aff018ead6b390ca56f79775467cd4cf68f
MD5 e57a84cd38569c3900759d0a5c78f86d
BLAKE2b-256 481af8bd98ab627540d60a121703c81919e50e09a262c0b861b1a324c85219ab

See more details on using hashes here.

File details

Details for the file graxpy-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: graxpy-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 146.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.13

File hashes

Hashes for graxpy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f78d0987d2ca6bea45cc309a993e1f835f1f160edd0a17f1c886b77b31fc6dd
MD5 922b9d719a68ccbc224d4656553fd52f
BLAKE2b-256 d4ca35aadf96a8cf14e4880b09bf5148300479347202fde21d040a12512f2b9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page