CI | Release | Other |
---|---|---|
ADDIE stands for ADvandced DIffraction Environment, a data reduction application for total scattering powder diffraction data.
The name came about from being developed for the Diffraction Group at SNS located at ORNL (and previously known as the Advanced Diffraction Group).
This "reduction" entails taking raw neutron counts from detectors in the diffraction experiment and turning them into the reciprocal-space structure factor patterns, F(Q) or S(Q), and applying a Fourier Transform to real-space to give the pair distribution fuction, PDF.
ADDIE is a front-end GUI for total scattering that hopes to support
multiple diffractometers performing total scattering measurements.
The back-end that uses the
Mantid Framework
is the mantid-total-scattering
project.
Setup conda environment to install ADDIE into:
conda create -n addie-env
conda activate addie-env
Install ADDIE in the conda environment:
conda install -c neutrons addie
conda deactivate
conda remove -n addie_env --all
To launch ADDIE, run the following from the command line:
addie
If you need to specify the path to Mantid build, use:
MANTIDPATH=/path/to/mantid/build/bin PATH=$MANTIDPATH:$PATH PYTHONPATH=$MANTIDPATH:$PATH addie
conda env create
conda activate addie
pip install -e .
This will use the configuration in the environment.yml
file for setting up the
addie
conda environment. If one needs to change the conda environment name,
simply edit the addie
to something else in the environment.yml
file.
An alternative way to set up a dev environment for ADDIE is to follow the steps below,
conda config --add channels conda-forge
conda create -n addie_env
conda activate addie_env
pip install -e .
conda install mantidworkbench -c mantid/label/nightly
conda install -q -y -c neutrons mantid-total-scattering-python-wrapper
pip install https://oncat.ornl.gov/packages/pyoncat-1.5.1-py3-none-any.whl
Then suppose one is located in the main directory of the ADDIE repo, executing the following command will start up ADDIE,
python addie/main.py
conda deactivate
conda remove -n addie --all
Notes
If you have an error (see below for example) related to the libGL
library,
you may not have it installed for the Mantid Framework to work.
See instructions
here
for installing the necessary libraries for different OS
Example error:
ImportError: First import of "._api" failed with "libGL.so.1: cannot open shared object file...
The test suite can be run using pytest with the pytest-qt plugin.
$ pytest tests
If you normally develop using virtualenv
or friends, you can develop
addie that way as well. After creating the virtual environment, run
<MANTIDBUILDDIR>/bin/AddPythonPath.py
which will add a file, mantid.pth
to your environment with the
location of mantid. Then you need to setup for development:
python setup.py develop
will put the rest of addie into your environment so you only need to
edit files and type addie
.
As an extra reference, use direnv
to manange your virtual environments. For a python2 virtual
environment the .envrc
file should contain
layout python2 -- --system-site-packages
so the system wide packages installed for mantid are found.
or with pipenv
(which will use Pipfile),
first setup the directory and then add the .envrc
file:
cd addie
pipenv --two
echo layout_pipenv > .envrc
direnv allow
Python generated srpm
are not as flexible as they should be. To
generate one that is run buildrpm
and look for the files in the
dist
directory.
$ ./buildrpm
The rpm
s are available on
copr.