Skip to content

Commit f70acab

Browse files
committed
Finish utilities page
1 parent 6723abd commit f70acab

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

doc/source/utilities/parsersutility.rst

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

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

8-
1) `loadData()`:
8+
- ``loadData()``: Find and load a data table/block from a text file. This seems to work for most datafiles
9+
including those generated by diffpy programs. Running only ``numpy.loadtxt`` will result in errors
10+
for most these files as there is often excess data or parameters stored above the data block.
11+
Users can instead choose to load all the parameters of the form ``<param_name> = <param_value>`` into a dictionary
12+
with this function by setting the ``header`` parameter to ``True``.
913

10-
2) `serialize_data()`:
14+
The program identifies data blocks as the first matrix block with a constant number of columns.
15+
A user can tune the minimum number of rows this matrix block must have.
1116

12-
3) `deserialize_data()`:
17+
- ``deserialize_data()``: Load data from a serial file format into a Python dictionary. Currently, the only supported
18+
serial format is ``.json``.
19+
20+
- ``serialize_data()``: Serialize the data generated by ``loadData()`` into a serial file format. Currently, the only
21+
supported serial format is ``.json``.
1322

1423
For a more in-depth tutorial for how to use these parser utilities, click :ref:`here <Parsers Example>`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _Resample Utility:
2+
3+
Resample Utility
4+
================
5+
6+
- ``wsinterp()``: Allows users easily reample a PDF onto another grid.
7+
This makes use of the Whittaker-Shannon interpolation formula.
8+
To see the theory behind how this interpolation works and how to use
9+
it in practice, click :ref:`here <Resample Example>`.

doc/source/utilities/toolsutility.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ Tools Utility
55

66
The ``diffpy.utils.tools`` module provides tool functions for use with diffpy apps.
77

8-
1) ``get_user_info()``: This function is designed for managing and tracking username and email information.
8+
- ``get_user_info()``: This function is designed for managing and tracking username and email information.
99

10-
Developers can use this function to simplify the process of loading, merging, and saving information consistently and easily.
11-
Additionally, it saves the effort of re-entering information, and allows overriding current information by
12-
passing parameters.
10+
Developers can use this function to simplify the process of loading, merging, and saving information consistently and easily.
11+
Additionally, it saves the effort of re-entering information, and allows overriding current information by
12+
passing parameters.
1313

14-
2) ``get_package_info()``: This function loads package name and version information into a dictionary.
15-
It updates the package information under the key "package_info" in the format {"package_name": "version_number"},
16-
resulting in an entry in the passed metadata dictionary that looks like
17-
``{"package_info": {"package1": "version_number1", "package2": "version_number2"}`` if the function is called more than
18-
once.
14+
- ``get_package_info()``: This function loads package name and version information into a dictionary.
15+
It updates the package information under the key "package_info" in the format {"package_name": "version_number"},
16+
resulting in an entry in the passed metadata dictionary that looks like
17+
``{"package_info": {"package1": "version_number1", "package2": "version_number2"}`` if the function is called more than
18+
once.
1919

20-
Users can use these functions to track and manage versions of packages that can later be stored, for example, in an output
21-
file header.
20+
Users can use these functions to track and manage versions of packages that can later be stored, for example, in an output
21+
file header.
2222

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

doc/source/utilities/utilities.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Check the :ref:`examples<Examples>` provided for how to use these.
1111
:depth: 2
1212

1313
.. include:: parsersutility.rst
14+
.. include:: resampleutility.rst
1415
.. include:: toolsutility.rst

0 commit comments

Comments
 (0)