Skip to content

Commit b131d7f

Browse files
authored
Merge pull request #169 from Sparks29032/doc_update
Documentation update
2 parents cf08bf0 + 8cd3629 commit b131d7f

File tree

7 files changed

+49
-26
lines changed

7 files changed

+49
-26
lines changed

doc/source/api/diffpy.utils.parsers.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ diffpy.utils.parsers package
1111
Submodules
1212
----------
1313

14-
diffpy.utils.parsers.resample module
15-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
diffpy.utils.parsers.serialization module
15+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616

17-
.. automodule:: diffpy.utils.parsers.resample
17+
.. automodule:: diffpy.utils.parsers.serialization
1818
:members:
1919
:undoc-members:
2020
:show-inheritance:
@@ -34,11 +34,3 @@ diffpy.utils.parsers.custom_exceptions module
3434
:members:
3535
:undoc-members:
3636
:show-inheritance:
37-
38-
diffpy.utils.parsers.serialization module
39-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40-
41-
.. automodule:: diffpy.utils.parsers.serialization
42-
:members:
43-
:undoc-members:
44-
:show-inheritance:

doc/source/api/diffpy.utils.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ diffpy.utils.tools module
2828
:members:
2929
:undoc-members:
3030
:show-inheritance:
31+
32+
diffpy.utils.resampler module
33+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
35+
.. automodule:: diffpy.utils.resampler
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:

doc/source/api/diffpy.utils.scattering_objects.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ diffpy.utils.scattering_objects package
1111
Submodules
1212
----------
1313

14-
diffpy.utils.scattering_objects.user_config module
15-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
diffpy.utils.scattering_objects.diffraction_objects module
15+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616

17-
.. automodule:: diffpy.utils.scattering_objects.user_config
17+
.. automodule:: diffpy.utils.scattering_objects.diffraction_objects
1818
:members:
1919
:undoc-members:
2020
:show-inheritance:
2121

22-
diffpy.utils.scattering_objects.diffraction_objects module
23-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22+
diffpy.utils.scattering_objects.user_config module
23+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

25-
.. automodule:: diffpy.utils.scattering_objects.diffraction_objects
25+
.. automodule:: diffpy.utils.scattering_objects.user_config
2626
:members:
2727
:undoc-members:
2828
:show-inheritance:

doc/source/examples/parsersexample.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit
1414
2) To get the data table, we will use the ``loadData`` function. The default behavior of this
1515
function is to find and extract a data table from a file.::
1616

17-
from diffpy.utils.parsers import loadData
17+
from diffpy.utils.parsers.loaddata import loadData
1818
data_table = loadData('<PATH to data.txt>')
1919

2020
While this will work with most datasets, on our ``data.txt`` file, we got a ``ValueError``. The reason for this is
@@ -53,7 +53,7 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit
5353
4) Rather than working with separate ``data_table`` and ``hdata`` objects, it may be easier to combine them into a single
5454
dictionary. We can do so using the ``serialize_data`` function. ::
5555

56-
from diffpy.utils.parsers import serialize_data
56+
from diffpy.utils.parsers.loaddata import serialize_data
5757
file_data = serialize_data('<PATH to data.txt', hdata, data_table)
5858
# File data is a dictionary with a single key
5959
# The key is the file name (in our case, 'data.txt')
@@ -84,7 +84,7 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit
8484
The returned value, ``parsed_file_data``, is the dictionary we just added to ``serialfile.json``.
8585
To extract the data from the serial file, we use ``deserialize_data``. ::
8686

87-
from diffpy.utils.parsers import deserialize_data
87+
from diffpy.utils.parsers.serialization import deserialize_data
8888
parsed_file_data = deserialize_data('<PATH to serialdata.json>')
8989

9090
6) Finally, ``serialize_data`` allows us to store data from multiple text file in a single serial file. For one last bit

doc/source/examples/resampleexample.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ given enough datapoints.
1515
<https://global.oup.com/academic/product/atomic-pair-distribution-function-analysis-9780198885801?cc=us&lang=en&>`_.
1616
::
1717

18-
from diffpy.utils.parsers import loadData
18+
from diffpy.utils.parsers.loaddata import loadData
1919
nickel_datatable = loadData('<PATH to Nickel.gr>')
2020
nitarget_datatable = loadData('<PATH to NiTarget.gr>')
2121

2222
Each data table has two columns: first is the grid and second is the function value.
2323
To extract the columns, we can utilize the serialize function ... ::
2424

25-
from diffpy.utils.parsers import serialize_data
25+
from diffpy.utils.parsers.serialization import serialize_data
2626
nickel_data = serialize_data('Nickel.gr', {}, nickel_datatable, dt_colnames=['grid', 'func'])
2727
nickel_grid = nickel_data['Nickel.gr']['grid']
2828
nickel_func = nickel_data['Nickel.gr']['func']
@@ -54,7 +54,7 @@ given enough datapoints.
5454

5555
... and use the diffpy.utils ``wsinterp`` function to resample on this grid.::
5656

57-
from diffpy.utils.parsers import wsinterp
57+
from diffpy.utils.resampler import wsinterp
5858
nickel_resample = wsinterp(grid, nickel_grid, nickel_func)
5959
target_resample = wsinterp(grid, target_grid, target_func)
6060

doc/source/utilities/parsersutility.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Parsers Utility
55

66
The ``diffpy.utils.parsers`` module allows users to easily and robustly load file data into a Python project.
77

8-
- ``loadData()``: Find and load a data table/block from a text file. This seems to work for most datafiles
8+
- ``loaddata.loadData()``: Find and load a data table/block from a text file. This seems to work for most datafiles
99
including those generated by diffpy programs. Running only ``numpy.loadtxt`` will result in errors
1010
for most these files as there is often excess data or parameters stored above the data block.
1111
Users can instead choose to load all the parameters of the form ``<param_name> = <param_value>`` into a dictionary
@@ -14,10 +14,10 @@ The ``diffpy.utils.parsers`` module allows users to easily and robustly load fil
1414
The program identifies data blocks as the first matrix block with a constant number of columns.
1515
A user can tune the minimum number of rows this matrix block must have.
1616

17-
- ``deserialize_data()``: Load data from a serial file format into a Python dictionary. Currently, the only supported
17+
- ``serialization.deserialize_data()``: Load data from a serial file format into a Python dictionary. Currently, the only supported
1818
serial format is ``.json``.
1919

20-
- ``serialize_data()``: Serialize the data generated by ``loadData()`` into a serial file format. Currently, the only
20+
- ``serialization.serialize_data()``: Serialize the data generated by ``loadData()`` into a serial file format. Currently, the only
2121
supported serial format is ``.json``.
2222

2323
For a more in-depth tutorial for how to use these parser utilities, click :ref:`here <Parsers Example>`.

news/doc-update.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* Paths in our documentation reflect changes made in code.
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

0 commit comments

Comments
 (0)