Skip to content

Commit 7ec6441

Browse files
authoredNov 20, 2023
Merge pull request #39 from Sparks29032/change_install
Change install sources
2 parents c178dfa + ade2613 commit 7ec6441

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed
 

Diff for: ‎.github/workflows/docs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Build Documentation
22

33
on:
4+
push:
5+
branches:
6+
- main
47
release:
58

69
jobs:

Diff for: ‎README.rst

+27-32
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,49 @@ function over a new grid.
1919
For more information about the diffpy.utils library, see the users manual at
2020
http://diffpy.github.io/diffpy.utils.
2121

22-
23-
REQUIREMENTS
22+
INSTALLATION
2423
------------------------------------------------------------------------
2524

26-
The diffpy.utils package requires Python 3.7 or later or 2.7 and
27-
the following software:
28-
29-
* ``setuptools`` - tools for installing Python packages
30-
* ``NumPy`` - library for scientific computing with Python
25+
The preferred method is to use `Miniconda Python
26+
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
27+
and install from the "conda-forge" channel of Conda packages.
3128

32-
The functions in diffpy.utils.wx module require
29+
To add "conda-forge" to the conda channels, run the following in a terminal. ::
3330

34-
* ``wxPython`` - GUI toolkit for the Python language
31+
conda config --add channels conda-forge
3532

36-
We recommend to use `Anaconda Python <https://www.anaconda.com/download>`_
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 ::
33+
We want to install our packages in a suitable conda environment.
34+
The following creates and activates a new environment named ``diffpy-utils`` ::
4135

42-
sudo apt-get install python-setuptools python-numpy
36+
conda create -n diffpy-utils python=3
37+
conda activate diffpy-utils
4338

39+
Then, to fully install ``diffpy.utils`` in our active environment, run ::
4440

45-
INSTALLATION
46-
------------------------------------------------------------------------
41+
conda install diffpy.utils
4742

48-
The preferred method is to use Anaconda Python and install from the
49-
"diffpy" channel of Anaconda packages ::
43+
Another option is to use ``pip`` to download and install the latest release from
44+
`Python Package Index <https://pypi.python.org>`_.
45+
To install using ``pip`` into your ``diffpy-utils`` environment, we will also have to install dependencies ::
5046

51-
conda config --add channels diffpy
52-
conda install diffpy.utils
47+
pip install numpy
48+
pip install diffpy.utils
5349

54-
Another option is to use ``easy_install`` to download and install the
55-
latest release from `Python Package Index <https://pypi.python.org>`_ ::
50+
For those planning to use functions in the ``diffpy.utils.wx`` module, you will also need to install ``wxPython''.
51+
Both of the following lines will install this package. ::
5652
57-
easy_install diffpy.utils
53+
conda install wxPython
54+
pip install wxPython
5855
59-
If you prefer to install from sources, obtain the source archive and
60-
run ::
56+
If you prefer to install from sources, after installing the dependencies, obtain the source archive from
57+
`GitHub<https://github.com/diffpy/diffpy.utils/>`_. Once installed, ``cd`` into your ``diffpy.utils`` directory
58+
and run the following ::
6159

62-
python setup.py install
60+
pip install -e .
6361

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 ::
62+
To check the installation integrity, if the following passes all checks, you are good! ::
6963

64+
pip install pytest
7065
python -m diffpy.utils.tests.run
7166

7267

Diff for: ‎doc/manual/source/examples/resampleexample.rst

+6-4
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

Diff for: ‎doc/manual/source/index.rst

+1-1
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)
Please sign in to comment.