Skip to content

Commit 925577e

Browse files
committed
Complete rework of tutorial.
1) Renamed and reworked example scripts. 2) Complete rewrite of tutorial readme. 3) Sphinx documentation incorporates readme as separate pages. 4) Added images for tutorial. 5) Minor changes to other parts of documentation. 6) Changed Sphinx theme to nature in conf.py, because I like it better. 7) Updated prep for new example scripts.
1 parent 235db34 commit 925577e

67 files changed

Lines changed: 10863 additions & 3061 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.rst

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
#########################
2-
diffpy.srmise
2+
SrMise
33
#########################
44

5-
Tool for unbiased peak extraction from atomic pair distribution functions.
5+
`DiffPy project <http://www.diffpy.org>`_ tool for unbiased peak extraction from
6+
atomic pair distribution functions.
67

7-
The diffpy.srmise package is an implementation of the `ParSCAPE algorithm
8+
SrMise is an implementation of the `ParSCAPE algorithm
89
<https://dx.doi.org/10.1107/S2053273315005276>`_ for peak extraction from
910
atomic pair distribution functions (PDFs). It is designed to function even
1011
when *a priori* knowledge of the physical sample is limited, utilizing the
1112
Akaike Information Criterion (AIC) to estimate whether peaks are
1213
statistically justified relative to alternate models. Three basic use cases
13-
are anticipated for diffpy.srmise. The first is peak fitting a user-supplied
14+
are anticipated for SrMise. The first is peak fitting a user-supplied
1415
collections of peaks. The second is peak extraction from a PDF with no (or
1516
only partial) user-supplied peaks. The third is an AIC-driven multimodeling
16-
analysis where the output of multiple diffpy.srmise trials are ranked.
17+
analysis where the output of multiple SrMise trials are ranked.
1718

1819
The framework for peak extraction defines peak-like clusters within the data,
1920
extracts a single peak within each cluster, and iteratively combines nearby
2021
clusters while performing a recursive search on the residual to identify
2122
occluded peaks. Eventually this results in a single global cluster
2223
containing many peaks fit over all the data. Over- and underfitting are
23-
discouraged by use of the AIC when adding or removing (during a pruning step)
24+
discouraged by use of the AIC when adding or, during a pruning step, removing
2425
peaks. Termination effects, which can lead to physically spurious peaks in
2526
the PDF, are incorporated in the mathematical peak model and the pruning step
2627
attempts to remove peaks which are fit better as termination ripples due to
2728
another peak.
2829

29-
Where possible, diffpy.srmise provides physically reasonable default values
30+
Where possible, SrMise provides physically reasonable default values
3031
for extraction parameters. However, the PDF baseline should be estimated by
3132
the user before extraction, or by performing provisional peak extraction with
3233
varying baseline parameters. The package defines a linear (crystalline)
3334
baseline, arbitrary polynomial baseline, a spherical nanoparticle baseline,
3435
and an arbitrary baseline interpolated from a list of user-supplied values.
3536
In addition, PDFs with accurate experimentally-determined uncertainties are
3637
necessary to provide the most reliable results, but historically such PDFs
37-
are rare. In the absence of accurate uncertainties an ad hoc uncertainty
38+
are rare. In the absence of accurate uncertainties an *ad hoc* uncertainty
3839
must be specified.
3940

40-
For more information about the diffpy.srmise library, see the users manual at
41+
For more information about SrMise, see the users manual at
4142
http://diffpy.github.io/diffpy.srmise.
4243

4344
Getting Started
@@ -79,20 +80,19 @@ sure to download the 32-bit versions of these packages.
7980
* `SciPy <http://sourceforge.net/projects/scipy/files/scipy/>`_
8081
* `matplotlib <http://matplotlib.org/downloads.html>`_
8182

82-
After installing Python and the required packages, we can install SrMise.
83-
The simplest way to obtain diffpy.srmise on Windows systems
84-
is using ``pip`` to download and install the latest release from the
85-
`Python Package Index <https://pypi.python.org>`_ (PyPI). To do so, open a
86-
command window by running ``cmd`` from the Start Menu's application search box
87-
(Windows 7/8/10) or Run command (Windows Vista and earlier). Verify that the
83+
After installing Python and the required packages, the simplest way to obtain
84+
SrMise is using ``pip`` to download and install the latest release from the
85+
`Python Package Index <https://pypi.python.org>`_ (PyPI). Open a command window
86+
by running ``cmd`` from the Start Menu's application search box (Windows 7/8/10)
87+
or Run command (Windows Vista and earlier). Verify that the
8888
``pip`` program is installed by running ::
8989

9090
pip --version
9191

9292
If this command is not found, download and run
9393
`get-pip.py <https://bootstrap.pypa.io/get-pip.py>`_, which will install both it
94-
and setuptools. For example, if your Windows user name is ``MyName`` and you
95-
download the file to the desktop, you would run the following from the command
94+
and setuptools. For example, if the file were downloaded to the desktop, a
95+
Windows user named ``MyName`` should run the following from the command
9696
line: ::
9797

9898
cd C:\Users\MyName\Desktop
@@ -124,7 +124,7 @@ is using ``pip`` to download and install the latest release from
124124

125125
sudo pip install diffpy.srmise
126126

127-
If you prefer to install from sources, download them from the
127+
Those who prefer to install from sources may download them from the
128128
`GitHub <https://github.com/diffpy/diffpy.srmise/releases>`__ or
129129
`PyPI <https://pypi.python.org/pypi/diffpy.srmise>`__ pages for SrMise.
130130
Uncompress them to a directory, and from that directory run ::
@@ -158,7 +158,7 @@ is using ``pip`` to download and install the latest release from the
158158

159159
sudo pip install diffpy.srmise
160160

161-
If you prefer to install from sources, download them from the
161+
Those who prefer to install from sources may download them from the
162162
`GitHub <https://github.com/diffpy/diffpy.srmise/releases>`__ or
163163
`PyPI <https://pypi.python.org/pypi/diffpy.srmise>`__ pages for SrMise.
164164
Uncompress them to a directory, and from that directory run ::
@@ -196,8 +196,8 @@ The source code of *pdfdataset.py* was derived from diffpy.pdfgui.
196196
CONTACTS
197197
========
198198

199-
For more information on diffpy.srmise please visit the project web-page
199+
For more information on SrMise please visit the DiffPy project web-page
200200

201-
http://www.diffpy.org
201+
http://www.diffpy.org/
202202

203203
or email Prof. Simon Billinge at sb2896@columbia.edu.

devutils/prep.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,27 @@ def rm(directory, filerestr):
8181
sys.path.append(lib_path)
8282

8383
# Delete existing files that don't necessarily have a fixed name.
84-
rm("../doc/examples/output", r"C60_multimodel.*\.pwa")
84+
rm("../doc/examples/output", r"known_dG.*\.pwa")
85+
rm("../doc/examples/output", r"unknown_dG.*\.pwa")
8586

8687
### Testing examples
8788
examples = Test()
88-
import Ag_singlepeak, Ag_multiplepeaks, TiO2_parameterdetail, TiO2_initialpeaks, C60_multimodelextraction, C60_multimodelanalysis
89-
examples.test(Ag_singlepeak.run, plot=False)
90-
examples.test(Ag_multiplepeaks.run, plot=False)
91-
examples.test(TiO2_parameterdetail.run, plot=False)
92-
examples.test(TiO2_initialpeaks.run, plot=False)
93-
examples.test(C60_multimodelextraction.run, plot=False)
94-
examples.test(C60_multimodelanalysis.run, plot=False)
89+
test_names = ["extract_single_peak",
90+
"parameter_summary",
91+
"fit_initial",
92+
"query_results",
93+
"multimodel_known_dG1",
94+
"multimodel_known_dG2",
95+
"multimodel_unknown_dG1",
96+
"multimodel_unknown_dG2"]
97+
98+
test_modules = []
99+
for test in test_names:
100+
test_modules.append(__import__(test))
101+
102+
for test in test_modules:
103+
examples.test(test.run, plot=False)
104+
95105
examples.report()
96106

97107
### Convert output of example files to Unix-style endlines for sdist.

doc/examples/C60_multimodelanalysis.py

Lines changed: 0 additions & 155 deletions
This file was deleted.

0 commit comments

Comments
 (0)