Skip to main content

Reflectorch

PyTorch NumPy SciPy Matplotlib YAML Hugging Face

Python version CI workflow status Repos size DOI

Documentation Page

Reflectorch is a machine learning Python package for the analysis of X-ray and neutron reflectometry data, written by Vladimir Starostin & Valentin Munteanu at the University of Tübingen. It provides functionality for the fast simulation of reflectometry curves on the GPU, customizable setup of the physical parameterization model and neural network architecture via YAML configuration files, and prior-aware training of neural networks as described in our paper Neural network analysis of neutron and X-ray reflectivity data incorporating prior knowledge.

Installation

Reflectorch can be installed from PyPi via pip:

pip install reflectorch

Alternatively, one can clone the entire Github repository and install the package in editable mode:

git clone https://github.com/schreiber-lab/reflectorch.git
pip install -e .

For development purposes, the package can be installed together with the optional dependencies for building the distribution, testing and documentation:

git clone https://github.com/schreiber-lab/reflectorch.git
pip install -e .[tests,docs,build]

Users with Nvidia GPUs need to additionally install Pytorch with CUDA support corresponding to their hardware and operating system according to the instructions from the Pytorch website

Get started

Documentation Page The full documentation of the package, containing tutorials and the API reference, was built with Jupyter Book and Sphinx and it is hosted at the address: https://schreiber-lab.github.io/reflectorch/.

Interactive Notebook We provide an interactive Google Colab notebook for exploring the basic functionality of the package: Explore reflectorch in Colab

Hugging Face Pretrained models (network weights and their corresponding configuration files) are hosted on Hugging Face. Two repositories are currently available:

Repository Description
valentinsingularity/reflectivity Research repository containing a large variety of XRR and NR models.
reflectorch-ILL Curated repository of selected, validated NR models.

Contributing

If you'd like to contribute to the package, please see our Contributing Guidelines for details.

Citation

If you find our work useful in your research, please cite as follows:

@Article{Munteanu2025, 
doi = {10.21105/joss.08169}, 
url = {https://doi.org/10.21105/joss.08169}, 
year = {2025}, 
publisher = {The Open Journal}, 
volume = {10}, 
number = {115}, 
pages = {8169}, 
author = {Munteanu, Valentin and Starostin, Vladimir and Hinderhofer, Alexander and Gerlach, Alexander and Lapkin, Dmitry and Schreiber, Frank}, 
title = {reflectorch: a deep learning package for X-ray and neutron reflectometry}, 
journal = {Journal of Open Source Software} }
@Article{Munteanu2024,
  author    = {Munteanu, Valentin and Starostin, Vladimir and Greco, Alessandro and Pithan, Linus and Gerlach, Alexander and Hinderhofer, Alexander and Kowarik, Stefan and Schreiber, Frank},
  journal   = {Journal of Applied Crystallography},
  title     = {Neural network analysis of neutron and X-ray reflectivity data incorporating prior knowledge},
  year      = {2024},
  issn      = {1600-5767},
  month     = mar,
  number    = {2},
  volume    = {57},
  doi       = {10.1107/s1600576724002115},
  publisher = {International Union of Crystallography (IUCr)},
}

Metadata

Release files for reflectorch 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reflectorch 1.5.1
File Size Uploaded
reflectorch-1.5.1.tar.gz 350.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reflectorch 1.5.1
File Interpreter ABI Platform
reflectorch-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 510.3 kB

Release files / reflectorch-1.5.1.tar.gz

Download URL reflectorch-1.5.1.tar.gz
Size 350.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b059844fc8fd2585227d82aef0e241af648e7af1964e3669690ed8f5a0c94fc6
BLAKE2b-256 checksum
How to use checksums
0a6becb0dfc3d7489c13ad428d22834157ced1009ec26320a7c4e7a3ca7ea6b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 11, 2025.

Transparency log

Release files / reflectorch-1.5.1-py3-none-any.whl

Download URL reflectorch-1.5.1-py3-none-any.whl
Size 159.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c6ff9e6f05121354eab9e6465be692e47231969ef779fc322b724696cc0b530
BLAKE2b-256 checksum
How to use checksums
dde734ad7466e76e8e93675d56e2a43fa8439344cd511512986b1e8a4861644b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 11, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.5.1 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release 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