Skip to content

Commit 45dc183

Browse files
committed
Intuitive installation instructions
1 parent 4083e7d commit 45dc183

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

README.rst

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,46 @@ The functions in diffpy.utils.wx module require
3333

3434
* ``wxPython`` - GUI toolkit for the Python language
3535

36-
We recommend to use `Miniconda Python <https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
37-
as it allows to install the software dependencies together with
38-
diffpy.utils. For other Python distributions it is necessary to install
39-
the required software separately. As an example, on Ubuntu Linux the
40-
required software can be installed with ::
41-
42-
sudo apt-get install python-setuptools python-numpy
43-
4436

4537
INSTALLATION
4638
------------------------------------------------------------------------
4739

48-
The preferred method is to use Miniconda (or, less preferred, Anaconda) Python
49-
and install from the "conda-forge" channel of Conda packages ::
40+
The preferred method is to use `Miniconda Python
41+
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
42+
and install from the "conda-forge" channel of Conda packages.
43+
44+
To add "conda-forge" to the conda channels, run the following in a terminal. ::
5045

5146
conda config --add channels conda-forge
52-
conda install diffpy.utils
5347

54-
Another option is to use ``pip`` to download and install the
55-
latest release from `Python Package Index <https://pypi.python.org>`_ ::
48+
We want to install our packages in a suitable conda environment.
49+
The following creates and activates a new environment named ``utils`` ::
50+
51+
conda create -n utils python=3
52+
conda activate utils
5653

54+
Then, to fully install ``diffpy.utils`` in our active environment, run ::
55+
56+
conda install diffpy.utils
57+
58+
Another option is to use ``pip`` to download and install the latest release from
59+
`Python Package Index <https://pypi.python.org>`_.
60+
To install using ``pip`` into your ``utils`` environment, we will also have to install dependencies ::
61+
62+
pip install numpy
5763
pip install diffpy.utils
5864

59-
If you prefer to install from sources, obtain the source archive and
60-
run ::
65+
If you prefer to install from sources, obtain the source archive and run ::
6166

6267
python setup.py install
6368

64-
You may need to use ``sudo`` with system Python as it attempts to
65-
install to standard system directories. If sudo is not available, check
66-
the usage info from ``python setup.py install --help`` for options to
67-
install to user-writable locations. The installation integrity can be
68-
verified by changing to the HOME directory and running ::
69+
You may need to use ``sudo`` with system Python as it attempts to install to standard system directories.
70+
If sudo is not available, check the usage info from ``python setup.py install --help`` for options to
71+
install to user-writable locations.
72+
73+
To check the installation integrity, install pytest. If the following code passes all checks, the install worked! ::
6974

75+
pip install pytest
7076
python -m diffpy.utils.tests.run
7177

7278

doc/manual/source/examples/resampleexample.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,18 @@ given enough datapoints.
5858
nickel_resample = wsinterp(grid, nickel_grid, nickel_func)
5959
target_resample = wsinterp(grid, target_grid, target_func)
6060

61-
We can now plot the difference to see that these two functions are in fact equal.:
61+
We can now plot the difference to see that these two functions are quite similar.:
6262

63+
plt.plot(grid, target_resample)
64+
plt.plot(grid, nickel_resample)
6365
plt.plot(grid, target_resample - nickel_resample)
6466

6567
This is the desired result as the data in ``Nickel.gr`` is every tenth data point in ``NiTarget.gr``.
6668
This also shows us that ``wsinterp`` can help us reconstruct a function from incomplete data.
6769

68-
4) In order for our function reconstruction to be perfect, we require that (a) the function is a Fourier transform of a
69-
band-limited dataset and (b) the original grid has enough equally-spaced datapoints based on the Nyquist sampling
70-
theorem.
70+
4) In order for our function reconstruction to be perfect up to a truncation error, we require that (a) the function is
71+
a Fourier transform of a band-limited dataset and (b) the original grid has enough equally-spaced datapoints based on
72+
the Nyquist sampling theorem.
7173

7274
* If our function :math:`F(r)` is of the form :math:`F(r) = \int_0^{qmax} f(q)e^{-iqr}dq` where :math:`qmax` is
7375
the bandlimit, then for a grid spanning :math:`r \in [rmin, rmax]`, the Nyquist sampling theorem tells us we

doc/manual/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ https://github.com/diffpy/diffpy.utils/graphs/contributors.
3434
Installation
3535
======================================
3636

37-
See the `README <https://github.com/diffpy/diffpy.utils#requirements>`_
37+
See the `README <https://github.com/diffpy/diffpy.utils#installation>`_
3838
file included with the distribution.
3939

4040
======================================

0 commit comments

Comments
 (0)