From 7fcce6d16f754d126af9371ee412d92af9e4c9d0 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 14 Nov 2023 13:31:12 -0500 Subject: [PATCH 1/6] Change install sources --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 00b73b0d..c8510224 100644 --- a/README.rst +++ b/README.rst @@ -48,13 +48,13 @@ INSTALLATION The preferred method is to use Anaconda Python and install from the "diffpy" channel of Anaconda packages :: - conda config --add channels diffpy + conda config --add channels conda-forge conda install diffpy.utils -Another option is to use ``easy_install`` to download and install the +Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_ :: - easy_install diffpy.utils + pip install diffpy.utils If you prefer to install from sources, obtain the source archive and run :: From 4083e7d26f031c0e4a05fade978358f6baa3b257 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 16 Nov 2023 17:41:42 -0500 Subject: [PATCH 2/6] Update to Miniconda --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index c8510224..99e40a8f 100644 --- a/README.rst +++ b/README.rst @@ -33,7 +33,7 @@ The functions in diffpy.utils.wx module require * ``wxPython`` - GUI toolkit for the Python language -We recommend to use `Anaconda Python `_ +We recommend to use `Miniconda Python `_ 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 @@ -45,8 +45,8 @@ required software can be installed with :: INSTALLATION ------------------------------------------------------------------------ -The preferred method is to use Anaconda Python and install from the -"diffpy" channel of Anaconda packages :: +The preferred method is to use Miniconda (or, less preferred, Anaconda) Python +and install from the "conda-forge" channel of Conda packages :: conda config --add channels conda-forge conda install diffpy.utils From 45dc183a4010f7acaf73694037196da2c46e8c72 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 16 Nov 2023 18:19:58 -0500 Subject: [PATCH 3/6] Intuitive installation instructions --- README.rst | 46 +++++++++++-------- .../source/examples/resampleexample.rst | 10 ++-- doc/manual/source/index.rst | 2 +- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/README.rst b/README.rst index 99e40a8f..8288ad6b 100644 --- a/README.rst +++ b/README.rst @@ -33,40 +33,46 @@ The functions in diffpy.utils.wx module require * ``wxPython`` - GUI toolkit for the Python language -We recommend to use `Miniconda Python `_ -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 :: - - sudo apt-get install python-setuptools python-numpy - INSTALLATION ------------------------------------------------------------------------ -The preferred method is to use Miniconda (or, less preferred, Anaconda) Python -and install from the "conda-forge" channel of Conda packages :: +The preferred method is to use `Miniconda Python +`_ +and install from the "conda-forge" channel of Conda packages. + +To add "conda-forge" to the conda channels, run the following in a terminal. :: conda config --add channels conda-forge - conda install diffpy.utils -Another option is to use ``pip`` to download and install the -latest release from `Python Package Index `_ :: +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``utils`` :: + + conda create -n utils python=3 + conda activate utils +Then, to fully install ``diffpy.utils`` in our active environment, run :: + + conda install diffpy.utils + +Another option is to use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``utils`` environment, we will also have to install dependencies :: + + pip install numpy pip install diffpy.utils -If you prefer to install from sources, obtain the source archive and -run :: +If you prefer to install from sources, obtain the source archive and run :: python setup.py install -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 :: +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. + +To check the installation integrity, install pytest. If the following code passes all checks, the install worked! :: + pip install pytest python -m diffpy.utils.tests.run diff --git a/doc/manual/source/examples/resampleexample.rst b/doc/manual/source/examples/resampleexample.rst index 1279740d..7b91c249 100644 --- a/doc/manual/source/examples/resampleexample.rst +++ b/doc/manual/source/examples/resampleexample.rst @@ -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 diff --git a/doc/manual/source/index.rst b/doc/manual/source/index.rst index ffa605cc..ccab47a2 100644 --- a/doc/manual/source/index.rst +++ b/doc/manual/source/index.rst @@ -34,7 +34,7 @@ https://github.com/diffpy/diffpy.utils/graphs/contributors. Installation ====================================== -See the `README `_ +See the `README `_ file included with the distribution. ====================================== From f3eca3cf5f5aa6771fdb21cc3b8e02d89a9fd7ec Mon Sep 17 00:00:00 2001 From: = Date: Thu, 16 Nov 2023 18:29:41 -0500 Subject: [PATCH 4/6] wxPython note --- README.rst | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index 8288ad6b..fcfcb319 100644 --- a/README.rst +++ b/README.rst @@ -19,21 +19,6 @@ 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 ------------------------------------------------------------------------- - -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 functions in diffpy.utils.wx module require - -* ``wxPython`` - GUI toolkit for the Python language - - INSTALLATION ------------------------------------------------------------------------ @@ -62,7 +47,13 @@ To install using ``pip`` into your ``utils`` environment, we will also have to i pip install numpy pip install diffpy.utils -If you prefer to install from sources, obtain the source archive and run :: +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. :: + + conda install wxPython + pip install wxPython + +If you prefer to install from sources, after installing the dependencies, obtain the source archive and run :: python setup.py install @@ -70,7 +61,7 @@ You may need to use ``sudo`` with system Python as it attempts to install to sta If sudo is not available, check the usage info from ``python setup.py install --help`` for options to install to user-writable locations. -To check the installation integrity, install pytest. If the following code passes all checks, the install worked! :: +To check the installation integrity if the following passes all checks, you are good! :: pip install pytest python -m diffpy.utils.tests.run From 94daed9c005dd8b5b7aea9a29cd7ebb11b18c0f3 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 16 Nov 2023 18:36:35 -0500 Subject: [PATCH 5/6] Rebuild documentation --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9602b64f..5d865623 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,6 +1,9 @@ name: Build Documentation on: + push: + branches: + - main release: jobs: From ade26134c53986226248c6c24a11b33bf569b793 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 16 Nov 2023 18:46:34 -0500 Subject: [PATCH 6/6] Final edits --- README.rst | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index fcfcb319..da70c652 100644 --- a/README.rst +++ b/README.rst @@ -31,10 +31,10 @@ To add "conda-forge" to the conda channels, run the following in a terminal. :: conda config --add channels conda-forge We want to install our packages in a suitable conda environment. -The following creates and activates a new environment named ``utils`` :: +The following creates and activates a new environment named ``diffpy-utils`` :: - conda create -n utils python=3 - conda activate utils + conda create -n diffpy-utils python=3 + conda activate diffpy-utils Then, to fully install ``diffpy.utils`` in our active environment, run :: @@ -42,7 +42,7 @@ Then, to fully install ``diffpy.utils`` in our active environment, run :: Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_. -To install using ``pip`` into your ``utils`` environment, we will also have to install dependencies :: +To install using ``pip`` into your ``diffpy-utils`` environment, we will also have to install dependencies :: pip install numpy pip install diffpy.utils @@ -53,15 +53,13 @@ Both of the following lines will install this package. :: conda install wxPython pip install wxPython -If you prefer to install from sources, after installing the dependencies, obtain the source archive and run :: +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub`_. 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. - -To check the installation integrity if the following passes all checks, you are good! :: +To check the installation integrity, if the following passes all checks, you are good! :: pip install pytest python -m diffpy.utils.tests.run