Skip to content

Commit 5bca3ea

Browse files
Merge branch 'main' into do-docs
2 parents a2b7850 + 2ccd7d6 commit 5bca3ea

11 files changed

+26
-18
lines changed

Diff for: doc/source/examples/examples.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Examples
77
Landing page for diffpy.utils examples.
88

99
.. toctree::
10-
parsersexample
11-
resampleexample
12-
toolsexample
10+
parsers_example
11+
resample_example
12+
tools_example
13+
transforms_example

Diff for: doc/source/examples/parsersexample.rst renamed to doc/source/examples/parsers_example.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Parsers Example
88
This example will demonstrate how diffpy.utils lets us easily process and serialize files.
99
Using the parsers module, we can load file data into simple and easy-to-work-with Python objects.
1010

11-
1) To begin, unzip :download:`parserdata<./exampledata/parserdata.zip>` and take a look at ``data.txt``.
11+
1) To begin, unzip :download:`parser_data<./example_data/parser_data.zip>` and take a look at ``data.txt``.
1212
Our goal will be to extract and serialize the data table as well as the parameters listed in the header of this file.
1313

1414
2) To get the data table, we will use the ``loadData`` function. The default behavior of this

Diff for: doc/source/examples/resampleexample.rst renamed to doc/source/examples/resample_example.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Specifically, we will resample the grid of one function to match another for us
1010
Then we will show how this resampling method lets us create a perfect reconstruction of certain functions
1111
given enough datapoints.
1212

13-
1) To start, unzip :download:`parserdata<./exampledata/parserdata.zip>`. Then, load the data table from ``Nickel.gr``
13+
1) To start, unzip :download:`parser_data<./example_data/parser_data.zip>`. Then, load the data table from ``Nickel.gr``
1414
and ``NiTarget.gr``. These datasets are based on data from `Atomic Pair Distribution Function Analysis: A Primer
1515
<https://global.oup.com/academic/product/atomic-pair-distribution-function-analysis-9780198885801?cc=us&lang=en&>`_.
1616
::
File renamed without changes.

Diff for: doc/source/examples/transformsexample.rst renamed to doc/source/examples/transforms_example.rst

+15-9
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,50 @@ This example will demonstrate how to use the functions in the
1010

1111
1) Converting from ``q`` to ``2theta`` or ``d``:
1212
If you have a 1D ``q``-array, you can use the ``q_to_tth`` and ``q_to_d`` functions
13-
to convert it to ``2theta`` or ``d``. ::
13+
to convert it to ``2theta`` or ``d``.
14+
15+
.. code-block:: python
1416
1517
# Example: convert q to 2theta
16-
from diffpy.utils.transformers import q_to_tth
18+
from diffpy.utils.transforms import q_to_tth
1719
wavelength = 0.71
1820
q = np.array([0, 0.2, 0.4, 0.6, 0.8, 1])
1921
tth = q_to_tth(q, wavelength)
2022
2123
# Example: convert q to d
22-
from diffpy.utils.transformers import q_to_d
24+
from diffpy.utils.transforms import q_to_d
2325
q = np.array([0, 0.2, 0.4, 0.6, 0.8, 1])
2426
d = q_to_d(q)
2527
2628
(2) Converting from ``2theta`` to ``q`` or ``d``:
27-
For a 1D ``2theta`` array, you can convert it to ``q`` or ``d`` in a similar way. ::
29+
For a 1D ``2theta`` array, you can convert it to ``q`` or ``d`` in a similar way.
30+
31+
.. code-block:: python
2832
2933
# Example: convert 2theta to q
30-
from diffpy.utils.transformers import tth_to_q
34+
from diffpy.utils.transforms import tth_to_q
3135
wavelength = 0.71
3236
tth = np.array([0, 30, 60, 90, 120, 180])
3337
q = tth_to_q(tth, wavelength)
3438
3539
# Example: convert 2theta to d
36-
from diffpy.utils.transformers import tth_to_d
40+
from diffpy.utils.transforms import tth_to_d
3741
wavelength = 0.71
3842
tth = np.array([0, 30, 60, 90, 120, 180])
3943
d = tth_to_d(tth, wavelength)
4044
4145
(3) Converting from ``d`` to ``q`` or ``2theta``:
42-
For a 1D ``d`` array, you can convert it to ``q`` or ``2theta``. ::
46+
For a 1D ``d`` array, you can convert it to ``q`` or ``2theta``.
47+
48+
.. code-block:: python
4349
4450
# Example: convert d to q
45-
from diffpy.utils.transformers import tth_to_q
51+
from diffpy.utils.transforms import d_to_q
4652
d = np.array([1.0, 0.8, 0.6, 0.4, 0.2])
4753
q = d_to_q(d)
4854
4955
# Example: convert d to 2theta
50-
from diffpy.utils.transformers import d_to_tth
56+
from diffpy.utils.transforms import d_to_tth
5157
wavelength = 0.71
5258
d = np.array([1.0, 0.8, 0.6, 0.4, 0.2])
5359
tth = d_to_tth(d, wavelength)
File renamed without changes.

Diff for: doc/source/utilities/resampleutility.rst renamed to doc/source/utilities/resample_utility.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Resample Utility
44
================
55

6-
- ``wsinterp()``: Allows users easily reample a PDF onto another grid.
6+
- ``wsinterp()``: Allows users easily resample a PDF onto another grid.
77
This makes use of the Whittaker-Shannon interpolation formula.
88
To see the theory behind how this interpolation works and how to use
99
it in practice, click :ref:`here <Resample Example>`.
File renamed without changes.

Diff for: doc/source/utilities/utilities.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Check the :ref:`examples<Examples>` provided for how to use these.
1010
.. contents::
1111
:depth: 2
1212

13-
.. include:: parsersutility.rst
14-
.. include:: resampleutility.rst
15-
.. include:: toolsutility.rst
13+
.. include:: parsers_utility.rst
14+
.. include:: resample_utility.rst
15+
.. include:: tools_utility.rst
16+
.. include:: transforms_utility.rst

0 commit comments

Comments
 (0)