Skip to main content
https://img.shields.io/pypi/v/reductus.svg https://img.shields.io/pypi/pyversions/reductus.svg https://travis-ci.org/reductus/reductus.svg?branch=master

This project provides tools for data reduction for neutron and xray scattering.

reflred

A python package for loading, modifying and saving reflectivity data sets.

ospecred

A python package for loading, modifying and saving off-specular reflectivity data sets.

sansred

A python package for loading, modifying and saving small-angle neutron scattering (SANS) data sets.

web_gui

RPC access to reduction libraries, with javascript frontend (stateless)

To load data from a local store in web reduction, go to menu->data->add source->local (must be running the server locally, with the local datastore enabled in config)

Installation and use

Method 1: pip install

pip install "reductus[all]"

Then start the server with:

reductus

For the very latest development version use the following:

pip install "git+https://github.com/reductus/reductus.git#egg=reductus[all]"

Method 2: Docker Compose

This is the easiest way to get started. Clone the repo, the change directories into the repository and run:

docker-compose build
docker-compose up -d

This will result in a trio of docker containers being spun up, one with a web server for the interface (‘web_gui’), one with the backend calculation RPC server (‘reductus’) and one with the Redis cache.

Files in ./web_gui/testdata/ will be mapped into the server at /data, for testing the local file handling. Changes to the python code can be incorporated into the containers by stopping them, then repeating the build and up commands above.

To stop:

docker-compose stop

To access the client, if using the new Docker beta navigate to http://localhost:8000/web_gui/web_reduction_filebrowser.html On Windows 7, if using docker-machine, you will have to get the IP of the default docker install and use that instead of localhost, e.g.

docker-machine ip default

In my case it was http://192.168.99.100:8000/webreduce/index.html

Method 3: Run from repo (development)

Clone the repo, then install in “editable” mode (might be a good idea to make a virtualenv first):

python -m pip install -e .
python -m pip install -r requirements.txt
web_gui/run.py

or without install (and with headless flag):

PYTHONPATH=. python -m web_gui.run -x

Browse to the URL indicated (probably http://localhost:8002/).

Change the server as needed then restart. The debug mode flag (-d) may make the restart unnecessary in some cases. Use headless (-x) to avoid starting a new browser tab each time. The development server is only accessible from localhost unless the “external” option is used (–external).

To debug external javascript packages (e.g., treejs or d3-science), you will need to clone the repo and link it into web_gui/webreduce/js, then update web_gui/webreduce/js/libraries.js to point to the local version rather than the version on the web.

Update times on the browser may be very slow, particularly when accessing the NCNR data source. To speed things up, copy configurations/default.py to configurations/config.py and modify it to use “force_IPV4”: True. You can also set “auto-reload newer files” to false (unchecked) in the web client. It is not a sticky setting at the moment, so it gets reset to checked every time you reload the client page. You can set the default as check_mtimes: false in web_gui/webreduce/js/menu.js.

Method 4: Run from repo (production)

After testing your fixes you can check that they work in the production server.

Install node.js and build javascript packages. This step is outlined in .github/workflows/client_build.yml. If you have changed an external javascript package you will need to update web_gui/webreduce/js/libraries_production.js with the path to the development version, much like you did for the development server.

cd web_gui/webreduce
npm install
rm -rf dist
npm run build
cd ../..

Then start the server with:

cd web_gui
python run.py

and visit the page http://localhost:8002/webreduce/dist/index.html

Metadata

Release files for reductus 1.0.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 reductus 1.0.1
File Size Uploaded Provenance
reductus-1.0.1.tar.gz 4.1 MB With provenance Details

Built distribution (wheel)

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

Total release size: 8.3 MB

Release files / reductus-1.0.1.tar.gz

Download URL reductus-1.0.1.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
2bcf74e78ac496040e0a2e286ae3cc41b97e6321f96ded5ba5fc8f58302732e0
BLAKE2b-256 checksum
How to use checksums
74b962d73e63f8135585598ded3f2af7faae8c50bed9553e5eb3e484a678e2c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Jan 30, 2025.

Transparency log

Release files / reductus-1.0.1-py3-none-any.whl

Download URL reductus-1.0.1-py3-none-any.whl
Size 4.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
294f9c3d2f294de644166c692291d87670e598f2dbcadbe4a4d11295de7013aa
BLAKE2b-256 checksum
How to use checksums
36d3bd58588f697f8924b4180898dedf71a1574f48cceb41ddd65adc9a8a3fc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Jan 30, 2025.

Transparency log

Security for reductus 1.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reductus-1.0.1.tar.gz

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 Jan 30, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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