Skip to content

Commit 139e61c

Browse files
committed
deploy: 913d824
1 parent 0621474 commit 139e61c

40 files changed

+360
-243
lines changed

Diff for: .buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 502ea467bdc9264ac0f9be42e14db075
3+
config: 453a8ea489635fd95ce5b1b3af83bc8d
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

Diff for: _modules/diffpy/utils/diffraction_objects.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.diffraction_objects &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.diffraction_objects &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/parsers/custom_exceptions.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.parsers.custom_exceptions &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.parsers.custom_exceptions &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/parsers/loaddata.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.parsers.loaddata &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.parsers.loaddata &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/parsers/serialization.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.parsers.serialization &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.parsers.serialization &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/resampler.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.resampler &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.resampler &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/tools.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.tools &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.tools &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/transforms.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.transforms &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.transforms &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../_static/js/theme.js"></script>

Diff for: _modules/diffpy/utils/validators.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>diffpy.utils.validators &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>diffpy.utils.validators &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../../../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../../../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../../../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../../../_static/js/theme.js"></script>

Diff for: _modules/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Overview: module code &mdash; diffpy.utils 3.6.0rc3 documentation</title>
8+
<title>Overview: module code &mdash; diffpy.utils 3.6.0rc4 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
1010
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../_static/documentation_options.js?v=1db8a07e"></script>
15+
<script src="../_static/documentation_options.js?v=f59be1ce"></script>
1616
<script src="../_static/doctools.js?v=9bcbadda"></script>
1717
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../_static/js/theme.js"></script>

Diff for: _sources/examples/examples.rst.txt

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

99
.. toctree::
10-
parsers_example
10+
diffraction_objects_example
11+
transforms_example
1112
resample_example
13+
parsers_example
1214
tools_example
13-
transforms_example
14-
diffraction_objects_example

Diff for: _sources/examples/parsers_example.rst.txt

+56-26
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,65 @@ This example will demonstrate how diffpy.utils lets us easily process and serial
99
Using the parsers module, we can load file data into simple and easy-to-work-with Python objects.
1010

1111
1) To begin, unzip :download:`parser_data<./example_data/parser_data.zip>` and take a look at ``data.txt``.
12-
Our goal will be to extract and serialize the data table as well as the parameters listed in the header of this file.
12+
This is a fairly standard format for 1D powder diffraction data.
13+
Our goal will be to extract the data, and the parameters listed in the header, from this file and
14+
load it into our program.
1315

1416
2) To get the data table, we will use the ``loadData`` function. The default behavior of this
15-
function is to find and extract a data table from a file.::
17+
function is to find and extract a data table from a file.
18+
19+
.. code-block:: python
1620
1721
from diffpy.utils.parsers.loaddata import loadData
1822
data_table = loadData('<PATH to data.txt>')
1923
20-
While this will work with most datasets, on our ``data.txt`` file, we got a ``ValueError``. The reason for this is
21-
due to the comments ``$ Phase Transition Near This Temperature Range`` and ``--> Note Significant Jump in Rw <--``
22-
embedded within the dataset. To fix this, try using the ``comments`` parameter. ::
24+
While this will work with most datasets, on our ``data.txt`` file, we got a ``ValueError``. The reason for this is
25+
due to the comments ``$ Phase Transition Near This Temperature Range`` and ``--> Note Significant Jump in Rw <--``
26+
embedded within the dataset. To fix this, try using the ``comments`` parameter.
27+
28+
.. code-block:: python
2329
2430
data_table = loadData('<PATH to data.txt>', comments=['$', '-->'])
2531
26-
This parameter tells ``loadData`` that any lines beginning with ``$`` and ``-->`` are just comments and
27-
more entries in our data table may follow.
32+
This parameter tells ``loadData`` that any lines beginning with ``$`` and ``-->`` are just comments and
33+
more entries in our data table may follow.
2834

29-
Here are a few other parameters to test out:
35+
Here are a few other parameters to test out:
3036

3137
* ``delimiter=','``: Look for a comma-separated data table. Useful for csv file types.
32-
However, since ``data.txt`` is whitespace separated, running ::
38+
However, since ``data.txt`` is whitespace separated, running
39+
40+
.. code-block:: python
3341
3442
loadData('<PATH to data.txt>', comments=['$', '-->'], delimiter=',')
3543
36-
returns an empty list.
44+
returns an empty list.
3745
* ``minrows=50``: Only look for data tables with at least 50 rows. Since our data table has much less than that many
38-
rows, running ::
46+
rows, running
47+
48+
.. code-block:: python
3949
4050
loadData('<PATH to data.txt>', comments=['$', '-->'], minrows=50)
4151
42-
returns an empty list.
52+
returns an empty list.
4353
* ``usecols=[0, 3]``: Only return the 0th and 3rd columns (zero-indexed) of the data table. For ``data.txt``, this
44-
corresponds to the temperature and rw columns. ::
54+
corresponds to the temperature and rw columns.
55+
56+
.. code-block:: python
4557
4658
loadData('<PATH to data.txt>', comments=['$', '-->'], usecols=[0, 3])
4759
4860
3) Next, to get the header information, we can again use ``loadData``,
49-
but this time with the ``headers`` parameter enabled. ::
61+
but this time with the ``headers`` parameter enabled.
62+
63+
.. code-block:: python
5064
5165
hdata = loadData('<PATH to data.txt>', comments=['$', '-->'], headers=True)
5266
5367
4) Rather than working with separate ``data_table`` and ``hdata`` objects, it may be easier to combine them into a single
54-
dictionary. We can do so using the ``serialize_data`` function. ::
68+
dictionary. We can do so using the ``serialize_data`` function.
69+
70+
.. code-block:: python
5571
5672
from diffpy.utils.parsers.loaddata import serialize_data
5773
file_data = serialize_data('<PATH to data.txt', hdata, data_table)
@@ -60,45 +76,59 @@ Using the parsers module, we can load file data into simple and easy-to-work-wit
6076
# The entry is a dictionary containing data from hdata and data_table
6177
data_dict = file_data['data.txt']
6278
63-
This dictionary ``data_dict`` contains all entries in ``hdata`` and an additional entry named
64-
``data table`` containing ``data_table``. ::
79+
This dictionary ``data_dict`` contains all entries in ``hdata`` and an additional entry named
80+
``data table`` containing ``data_table``.
81+
82+
.. code-block:: python
6583
6684
here_is_the_data_table = data_dict['data table']
6785
68-
There is also an option to name columns in the data table and save those columns as entries instead. ::
86+
There is also an option to name columns in the data table and save those columns as entries instead.
87+
88+
.. code-block:: python
6989
7090
data_table_column_names = ['temperature', 'scale', 'stretch', 'rw'] # names of the columns in data.txt
7191
file_data = serialize_data('<PATH to data.txt>', hdata, data_table, dt_colnames=data_table_column_names)
7292
data_dict = file_data['data.txt']
7393
74-
Now we can extract specific data table columns from the dictionary. ::
94+
Now we can extract specific data table columns from the dictionary.
7595

96+
.. code-block:: python
7697
data_table_temperature_column = data_dict['temperature']
7798
data_table_rw_column = data_dict['rw']
7899
79-
5) When we are done working with the data, we can store it on disc for later use. This can also be done using the
80-
``serialize_data`` function with an additional ``serial_file`` parameter.::
100+
5) When we are done working with the data, we can store it on disk for later use. This can also be done using the
101+
``serialize_data`` function with an additional ``serial_file`` parameter.
102+
103+
.. code-block:: python
81104
82105
parsed_file_data = serialize_data('<PATH to data.txt>', hdata, data_table, serial_file='<PATH to serialfile.json>')
83106
84107
The returned value, ``parsed_file_data``, is the dictionary we just added to ``serialfile.json``.
85-
To extract the data from the serial file, we use ``deserialize_data``. ::
108+
To extract the data from the serial file, we use ``deserialize_data``.
109+
110+
.. code-block:: python
86111
87112
from diffpy.utils.parsers.serialization import deserialize_data
88113
parsed_file_data = deserialize_data('<PATH to serialdata.json>')
89114
90-
6) Finally, ``serialize_data`` allows us to store data from multiple text file in a single serial file. For one last bit
91-
of practice, we will extract and add the data from ``moredata.txt`` into the same ``serialdata.json`` file.::
115+
6) Finally, ``serialize_data`` allows us to store data from multiple text files in a single serial file. For one last bit
116+
of practice, we will extract and add the data from ``moredata.txt`` into the same ``serialdata.json`` file.
117+
118+
.. code-block:: python
92119
93120
data_table = loadData('<PATH to moredata.txt>')
94121
hdata = loadData('<PATH to moredata.txt>', headers=True)
95122
serialize_data('<PATH to moredata.txt>', hdata, data_table, serial_file='<PATH to serialdata.json>')
96123
97-
The serial file ``serialfile.json`` should now contain two entries: ``data.txt`` and ``moredata.txt``.
98-
The data from each file can be accessed using ::
124+
The serial file ``serialfile.json`` should now contain two entries: ``data.txt`` and ``moredata.txt``.
125+
The data from each file can be accessed using
126+
127+
.. code-block:: python
99128
100129
serial_data = deserialize_data('<PATH to serialdata.json>')
101130
data_txt_data = serial_data['data.txt'] # Access data.txt data
102131
moredata_txt_data = serial_data['moredata.txt'] # Access moredata.txt data
103132
104133
For more information, check out the :ref:`documentation<Parsers Documentation>` of the ``parsers`` module.
134+
b

0 commit comments

Comments
 (0)