From b7b746f624b7ae413858ef5f307bbbfc29aef1e8 Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Fri, 15 Jan 2021 14:07:05 -0500 Subject: [PATCH 1/3] Updated conda environment file + README --- README.md | 89 +++++++++++++------------------------------------ environment.yml | 36 +++++++------------- 2 files changed, 35 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index 983987f0..4badf492 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -| CI | Release | -|--------|---------| -| [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fneutrons%2Faddie%2Fbadge&style=plastic)](https://actions-badge.atrox.dev/neutrons/addie/goto) | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | -| | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/platforms.svg)](https://anaconda.org/addie-diffraction/addie) | +| CI | Release | Other | +|--------|---------|-------| +| [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fneutrons%2Faddie%2Fbadge&style=plastic)](https://actions-badge.atrox.dev/neutrons/addie/goto) | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT) | +| | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/platforms.svg)](https://anaconda.org/addie-diffraction/addie) | | -ADDIE -====== +# ADDIE **ADDIE** stands for **AD**vandced **DI**ffraction **E**nvironment, a data reduction application for total scattering powder diffraction data. @@ -14,14 +13,7 @@ This "reduction" entails taking raw neutron counts from detectors in the diffrac 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](https://docs.mantidproject.org/nightly/) is the [`mantid-total-scattering`](https://github.com/marshallmcdonnell/mantid_total_scattering) project. -Installation ------------- - -### Anaconda - -**Setup** - -Add channels with dependencies, create a conda environment with `python_version` set to either `2.7.14` or `3.6`, and activate the environment +## Installation ``` conda config --add channels conda-forge --add channels marshallmcdonnell --add channels mantid --add channels mantid/label/nightly @@ -29,34 +21,7 @@ conda create -n addie_env python=${python_version} source activate addie_env ``` -**Install (or Update)** - -``` -conda install -c addie-diffraction addie -``` - -If there are issues with `mantid-workbench` or `mantid-total-scattering` dependencies (broken, errors, etc.), then you can delete the environment and re-install `addie` in a new environment ("turn it off and back on again") - -Go here for how to delete an [environment](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#removing-an-environment) or use: - -``` -conda remove --name addie_env --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](https://github.com/mantidproject/conda-recipes/#gl-and-glu-libs) 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...` - -If you have an error that another version of Mantid is installed on the machine and being imported via `PYTHONPATH`, you can use the following as a workaround for CLI tool: - -``` -PYTHONPATH="" addie -``` - -# Usage (CLI reduction tool) +## Launch To launch ADDIE, run the following from the command line: @@ -70,30 +35,25 @@ MANTIDPATH=/path/to/mantid/build/bin PATH=$MANTIDPATH:$PATH PYTHONPATH=$MANTIDPA ``` -Development ------------- +## Development -### Building -Before doing the normal `python setup.py ...` things you must convert the -`designer/*.ui` files to `addie*.py`. This is done with -`python setup.py pyuic`. After that, all the normal -[setuptools](https://pythonhosted.org/setuptools/setuptools.html) magic applies. - -To run from source (step 1 only needs to be done if the `.ui` file changes): -```bash -$ addiedevel.sh +### Installation development environment using Conda ``` -If you are want to specify a different `mantidpython`, then add it as -a command line argument -```bash -$ addiedevel.sh /opt/mantid37/bin/mantidpython +conda env create +source activate addie +python setup.py install ``` -Similarly, there is a script for windows (experimental) -``` -addiedevel.bat -``` +**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](https://github.com/mantidproject/conda-recipes/#gl-and-glu-libs) 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...` + + +### Testing The test suite can be run using [pytest](https://docs.pytest.org/en/latest/) with the [pytest-qt](https://pytest-qt.readthedocs.io/en/latest/) plugin. @@ -102,8 +62,7 @@ $ pytest tests ``` -Developing using virtual environments -------------------------------------- +### Developing using a local Mantid install If you normally develop using `virtualenv` or friends, you can develop addie that way as well. After creating the virtual environment, run @@ -138,8 +97,7 @@ echo layout_pipenv > .envrc direnv allow ``` -Creating RPMs -------------- +## Creating RPMs 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 @@ -151,4 +109,3 @@ $ ./buildrpm [copr](https://copr.fedorainfracloud.org/coprs/peterfpeterson/addie/). -[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT) diff --git a/environment.yml b/environment.yml index d00ae906..1ab53744 100644 --- a/environment.yml +++ b/environment.yml @@ -1,26 +1,14 @@ name: addie +channels: +- conda-forge +- marshallmcdonnell +- mantid dependencies: -- cycler=0.10.0=py27_0 -- freetype=2.5.5=0 -- libpng=1.6.17=0 -- matplotlib=1.5.1=np111py27_0 -- mkl=11.3.1=0 -- numpy=1.11.0=py27_0 -- openssl=1.0.2g=0 -- periodictable==1.5.0 -- pip=8.1.1=py27_1 -- pyparsing=2.1.1=py27_0 -- pyqt=4.11.4=py27_1 -- python=2.7.11=0 -- python-dateutil=2.5.2=py27_0 -- pytz=2016.3=py27_0 -- qt=4.8.7=1 -- readline=6.2=2 -- setuptools=20.7.0=py27_0 -- sip=4.16.9=py27_0 -- six=1.10.0=py27_0 -- sqlite=3.9.2=0 -- tk=8.5.18=0 -- wheel=0.29.0=py27_0 -- zlib=1.2.8=0 - +- python=3.6 +- configparser +- mantid-total-scattering-python-wrapper +- mantid-workbench +- periodictable +- psutil +- setuptools +- simplejson From 39cf0963f6be7b048fec3992a433a48b2d76a254 Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Fri, 15 Jan 2021 14:09:23 -0500 Subject: [PATCH 2/3] Fix format for opengl error in README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4badf492..e0dc1916 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,10 @@ python setup.py install 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](https://github.com/mantidproject/conda-recipes/#gl-and-glu-libs) 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...` + +``` +ImportError: First import of "._api" failed with "libGL.so.1: cannot open shared object file... +``` ### Testing From fe918784d4206ba4c20536ad375dfce23954bcdb Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Fri, 15 Jan 2021 14:27:05 -0500 Subject: [PATCH 3/3] Adding uninstall instructions to README --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e0dc1916..42f4a432 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This "reduction" entails taking raw neutron counts from detectors in the diffrac 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](https://docs.mantidproject.org/nightly/) is the [`mantid-total-scattering`](https://github.com/marshallmcdonnell/mantid_total_scattering) project. -## Installation +## Install ``` conda config --add channels conda-forge --add channels marshallmcdonnell --add channels mantid --add channels mantid/label/nightly @@ -21,6 +21,13 @@ conda create -n addie_env python=${python_version} source activate addie_env ``` +## Uninstall + +``` +conda deactivate +conda remove -n addie_env --all +``` + ## Launch To launch ADDIE, run the following from the command line: @@ -44,6 +51,12 @@ conda env create source activate addie python setup.py install ``` +### Uninstall + +``` +conda deactivate +conda remove -n addie --all +``` **Notes**