|
1 |
| -================= |
2 |
| -diffpy.labpdfproc |
3 |
| -================= |
| 1 | +|Icon| `diffpy.labpdfproc <https://diffpy.github.io/diffpy.labpdfproc>`_ |
| 2 | +========================================================= |
4 | 3 |
|
5 |
| -.. image:: https://github.com/diffpy/diffpy.labpdfproc/actions/workflows/testing.yml/badge.svg |
6 |
| - :target: https://github.com/diffpy/diffpy.labpdfproc/actions/workflows/testing.yml |
| 4 | +.. |Icon| image:: https://avatars.githubusercontent.com/diffpy |
| 5 | + :target: https://diffpy.github.io/diffpy.labpdfproc |
| 6 | + :height: 100px |
7 | 7 |
|
| 8 | +|PyPi| |Forge| |PythonVersion| |PR| |
8 | 9 |
|
9 |
| -.. image:: https://img.shields.io/pypi/v/diffpy.labpdfproc.svg |
10 |
| - :target: https://pypi.python.org/pypi/diffpy.labpdfproc |
| 10 | +|CI| |Codecov| |Black| |Tracking| |
11 | 11 |
|
| 12 | +.. |Black| image:: https://img.shields.io/badge/code_style-black-black |
| 13 | + :target: https://github.com/psf/black |
12 | 14 |
|
13 |
| -An app for preprocessing data from laboratory x-ray diffractometers before using PDFgetX3 to obtain PDFs |
| 15 | +.. |CI| image:: https://github.com/diffpy/diffpy.labpdfproc/actions/workflows/main.yml/badge.svg |
| 16 | + :target: https://github.com/diffpy/diffpy.labpdfproc/actions/workflows/main.yml |
14 | 17 |
|
15 |
| -* Free software: 3-clause BSD license |
16 |
| -* Documentation: (COMING SOON!) https://sbillinge.github.io/diffpy.labpdfproc. |
| 18 | +.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.labpdfproc/branch/main/graph/badge.svg |
| 19 | + :target: https://codecov.io/gh/diffpy/diffpy.labpdfproc |
17 | 20 |
|
18 |
| -Background |
19 |
| ----------- |
| 21 | +.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.labpdfproc |
| 22 | + :target: https://anaconda.org/conda-forge/diffpy.labpdfproc |
20 | 23 |
|
21 |
| -PDFgetX3 has revolutionized how PDF methods can be applied to solve nanostructure problems. However, the program was designed for use with Rapid Acquisition PDF (RAPDF) data from synchrotron sources. A key approximation inherent in the use of PDFgetX3 for RAPDF data is that absorption effects are negligible. This is typically not the case for laboratory x-ray diffractometers, where absorption effects can be significant. |
| 24 | +.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff |
22 | 25 |
|
23 |
| -This app is designed to preprocess data from laboratory x-ray diffractometers before using PDFgetX3 to obtain PDFs. The app currently carries out an absorption correction assuming a parallel beam capillary geometry which is the most common geometry for lab PDF measurements. |
| 26 | +.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.labpdfproc |
| 27 | + :target: https://pypi.org/project/diffpy.labpdfproc/ |
24 | 28 |
|
25 |
| -The theory is described in the following paper: |
| 29 | +.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.labpdfproc |
| 30 | + :target: https://pypi.org/project/diffpy.labpdfproc/ |
26 | 31 |
|
27 |
| -An ad hoc Absorption Correction for Reliable |
28 |
| -Pair-Distribution Functions from Low Energy x-ray Sources |
29 |
| -Yucong Chen, Till Schertenleib, Andrew Yang, Pascal Schouwink, |
30 |
| -Wendy L. Queen and Simon J. L. Billinge, in preparation. |
| 32 | +.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue |
| 33 | + :target: https://github.com/diffpy/diffpy.labpdfproc/issues |
31 | 34 |
|
32 |
| -The related experimental data acquisition protocols are described in the following paper: |
| 35 | +Tools for processing x-ray powder diffraction data from laboratory sources |
33 | 36 |
|
34 |
| -Protocols for Obtaining Reliable PDFs from Laboratory |
35 |
| -x-ray Sources Using PDFgetX3, |
36 |
| -Till Schertenleib, Daniel Schmuckler, Yucong Chen, Geng Bang Jin, |
37 |
| -Wendy L. Queen and Simon J. L. Billinge, in preparation. |
| 37 | +* LONGER DESCRIPTION HERE |
38 | 38 |
|
39 |
| -Installation |
40 |
| ------------- |
| 39 | +For more information about the diffpy.labpdfproc library, please consult our `online documentation <https://diffpy.github.io/diffpy.labpdfproc>`_. |
| 40 | + |
| 41 | +Citation |
| 42 | +-------- |
41 | 43 |
|
42 |
| -The package is available on conda-forge and on pypi. Assuming you are using conda/mamba (we recommend using miniconda), create a virtual environment and install the package as follows: |
| 44 | +If you use diffpy.labpdfproc in a scientific publication, we would like you to cite this package as |
43 | 45 |
|
44 |
| -.. code-block:: python |
| 46 | + diffpy.labpdfproc Package, https://github.com/diffpy/diffpy.labpdfproc |
45 | 47 |
|
46 |
| - mamba create -n labpdfproc python=3.12 |
47 |
| - mamba activate labpdfproc |
48 |
| - cd path/to/diffpy.labpdfproc |
49 |
| - mamba install -c conda-forge diffpy.labpdfproc |
| 48 | +Installation |
| 49 | +------------ |
50 | 50 |
|
51 |
| -The code may also be installed from pipy using pip. This is not recommended as the package has not been tested on all platforms. |
| 51 | +The preferred method is to use `Miniconda Python |
| 52 | +<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_ |
| 53 | +and install from the "conda-forge" channel of Conda packages. |
52 | 54 |
|
53 |
| -Usage |
54 |
| ------ |
| 55 | +To add "conda-forge" to the conda channels, run the following in a terminal. :: |
55 | 56 |
|
56 |
| -Navigate to the directory that contains 1D diffraction patterns that you would like to process. Activate the conda environment (`conda activate labpdfproc`) that contains the package and run the following command: |
| 57 | + conda config --add channels conda-forge |
57 | 58 |
|
58 |
| -.. code-block:: python |
| 59 | +We want to install our packages in a suitable conda environment. |
| 60 | +The following creates and activates a new environment named ``diffpy.labpdfproc_env`` :: |
59 | 61 |
|
60 |
| - labpdfproc <muD> -i <path/to/inputfile.txt> --anode-type Mo |
| 62 | + conda create -n diffpy.labpdfproc_env python=3 |
| 63 | + conda activate diffpy.labpdfproc_env |
61 | 64 |
|
| 65 | +Then, to fully install ``diffpy.labpdfproc`` in our active environment, run :: |
62 | 66 |
|
63 |
| -Here replace <muD> with the value of muD for your sample and <path/to/inputfile.txt> with the path and filename of your input file. For example, if the uncorrected data case isc alled zro2_mo.xy and is in the current directory and it has a muD of 2.5 then the commands would be |
| 67 | + conda install diffpy.labpdfproc |
64 | 68 |
|
65 |
| -.. code-block:: python |
| 69 | +Another option is to use ``pip`` to download and install the latest release from |
| 70 | +`Python Package Index <https://pypi.python.org>`_. |
| 71 | +To install using ``pip`` into your ``diffpy.labpdfproc_env`` environment, we will also have to install dependencies :: |
66 | 72 |
|
67 |
| - labpdfproc 2.5 -i zro2_mo.xy --anode-type Mo |
| 73 | + pip install -r https://raw.githubusercontent.com/diffpy/diffpy.labpdfproc/main/requirements/run.txt |
68 | 74 |
|
69 |
| -Please type |
70 |
| -.. code-block:: python |
| 75 | +and then install the package :: |
71 | 76 |
|
72 |
| - labpdfproc --help |
| 77 | + pip install diffpy.labpdfproc |
73 | 78 |
|
74 |
| -for more information on the available options. |
| 79 | +If you prefer to install from sources, after installing the dependencies, obtain the source archive from |
| 80 | +`GitHub <https://github.com/diffpy/diffpy.labpdfproc/>`_. Once installed, ``cd`` into your ``diffpy.labpdfproc`` directory |
| 81 | +and run the following :: |
75 | 82 |
|
| 83 | + pip install . |
76 | 84 |
|
77 |
| -Getting Started |
78 |
| ---------------- |
| 85 | +Support and Contribute |
| 86 | +---------------------- |
79 | 87 |
|
80 |
| -An example input file can be found in the docs/examples directory in the distribtuion (you should find it in your miniconda envs locateion). The file is called zro2_mo.xy. |
| 88 | +`Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.labpdfproc. Please join the diffpy.labpdfproc users community by joining the Google group. The diffpy.labpdfproc project welcomes your expertise and enthusiasm! |
81 | 89 |
|
82 |
| -1. Copy this file to a new scratch directory |
83 |
| -2. Navigate to that directory in a terminal |
84 |
| -3. Activate the conda environment that contains the package |
85 |
| -4. Run the command (see above) |
| 90 | +If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.labpdfproc/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.labpdfproc/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_. |
86 | 91 |
|
87 |
| -An example output is also present in the example data and you can compare your output to this file. The example was processed with a muD of 2.5, though for experimentation you can try processing data with different muD values. |
| 92 | +Feel free to fork the project and contribute. To install diffpy.labpdfproc |
| 93 | +in a development mode, with its sources being directly used by Python |
| 94 | +rather than copied to a package directory, use the following in the root |
| 95 | +directory :: |
88 | 96 |
|
89 |
| -Contributing |
90 |
| ------------- |
91 |
| -We welcome contributors from the community. Please consider posting issues, and taking issues and posting PRs. |
| 97 | + pip install -e . |
92 | 98 |
|
93 | 99 | To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
|
94 | 100 | hooks.
|
95 | 101 |
|
96 |
| -1. modify the permissions to executable on the bash script called `prevent_commit_to_main.sh` in this directory: `chmod +x prevent_commit_to_main.sh` |
97 |
| -2. install pre-commit in your working environment `conda install pre-commit` |
98 |
| -3. initialize pre-commit (one time only) `pre-commit install` |
| 102 | +1. Install pre-commit in your working environment by running ``conda install pre-commit``. |
| 103 | + |
| 104 | +2. Initialize pre-commit (one time only) ``pre-commit install``. |
99 | 105 |
|
100 | 106 | Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
|
101 | 107 | If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
|
102 |
| -pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before |
103 |
| -trying to commit again |
| 108 | +pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before |
| 109 | +trying to commit again. |
| 110 | + |
| 111 | +Improvements and fixes are always appreciated. |
| 112 | + |
| 113 | +Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.labpdfproc/blob/main/CODE_OF_CONDUCT.rst>`_. |
| 114 | + |
| 115 | +Contact |
| 116 | +------- |
| 117 | + |
| 118 | +For more information on diffpy.labpdfproc please visit the project ` web-page < https://diffpy.github.io/>`_ or email Prof. Simon Billinge at [email protected]. |
0 commit comments