Skip to content

Change install sources #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build Documentation

on:
push:
branches:
- main
release:

jobs:
Expand Down
59 changes: 27 additions & 32 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,54 +19,49 @@ function over a new grid.
For more information about the diffpy.utils library, see the users manual at
http://diffpy.github.io/diffpy.utils.


REQUIREMENTS
INSTALLATION
------------------------------------------------------------------------

The diffpy.utils package requires Python 3.7 or later or 2.7 and
the following software:

* ``setuptools`` - tools for installing Python packages
* ``NumPy`` - library for scientific computing with Python
The preferred method is to use `Miniconda Python
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
and install from the "conda-forge" channel of Conda packages.

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

* ``wxPython`` - GUI toolkit for the Python language
conda config --add channels conda-forge

We recommend to use `Anaconda Python <https://www.anaconda.com/download>`_
as it allows to install the software dependencies together with
diffpy.utils. For other Python distributions it is necessary to install
the required software separately. As an example, on Ubuntu Linux the
required software can be installed with ::
We want to install our packages in a suitable conda environment.
The following creates and activates a new environment named ``diffpy-utils`` ::

sudo apt-get install python-setuptools python-numpy
conda create -n diffpy-utils python=3
conda activate diffpy-utils

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

INSTALLATION
------------------------------------------------------------------------
conda install diffpy.utils

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

conda config --add channels diffpy
conda install diffpy.utils
pip install numpy
pip install diffpy.utils

Another option is to use ``easy_install`` to download and install the
latest release from `Python Package Index <https://pypi.python.org>`_ ::
For those planning to use functions in the ``diffpy.utils.wx`` module, you will also need to install ``wxPython''.
Both of the following lines will install this package. ::

easy_install diffpy.utils
conda install wxPython
pip install wxPython

If you prefer to install from sources, obtain the source archive and
run ::
If you prefer to install from sources, after installing the dependencies, obtain the source archive from
`GitHub<https://github.com/diffpy/diffpy.utils/>`_. Once installed, ``cd`` into your ``diffpy.utils`` directory
and run the following ::

python setup.py install
pip install -e .

You may need to use ``sudo`` with system Python as it attempts to
install to standard system directories. If sudo is not available, check
the usage info from ``python setup.py install --help`` for options to
install to user-writable locations. The installation integrity can be
verified by changing to the HOME directory and running ::
To check the installation integrity, if the following passes all checks, you are good! ::

pip install pytest
python -m diffpy.utils.tests.run


Expand Down
10 changes: 6 additions & 4 deletions doc/manual/source/examples/resampleexample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ given enough datapoints.
nickel_resample = wsinterp(grid, nickel_grid, nickel_func)
target_resample = wsinterp(grid, target_grid, target_func)

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

plt.plot(grid, target_resample)
plt.plot(grid, nickel_resample)
plt.plot(grid, target_resample - nickel_resample)

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

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

* 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
the bandlimit, then for a grid spanning :math:`r \in [rmin, rmax]`, the Nyquist sampling theorem tells us we
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ https://github.com/diffpy/diffpy.utils/graphs/contributors.
Installation
======================================

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

======================================
Expand Down