Skip to content

Commit e4341c2

Browse files
committed
deploy: e6a93b7
1 parent a07c2cf commit e4341c2

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

_modules/diffpy/utils/parsers/loaddata.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ <h1>Source code for diffpy.utils.parsers.loaddata</h1><div class="highlight"><pr
107107
<span class="sd"> filename</span>
108108
<span class="sd"> Name of the file we want to load data from.</span>
109109
<span class="sd"> minrows: int</span>
110-
<span class="sd"> Minimum number of rows in the first data block. All rows must have the same number of floating point values.</span>
110+
<span class="sd"> Minimum number of rows in the first data block. All rows must have the same number of floating</span>
111+
<span class="sd"> point values.</span>
111112
<span class="sd"> headers: bool</span>
112113
<span class="sd"> when False (defualt), the function returns a numpy array of the data in the data block.</span>
113-
<span class="sd"> When True, the function instead returns a dictionary of parameters and their corresponding values parsed from</span>
114+
<span class="sd"> When True, the function instead returns a dictionary of parameters and their corresponding</span>
115+
<span class="sd"> values parsed from</span>
114116
<span class="sd"> header (information prior the data block). See hdel and hignore for options to help with parsing header</span>
115117
<span class="sd"> information.</span>
116118
<span class="sd"> hdel: str</span>
@@ -367,7 +369,7 @@ <h1>Source code for diffpy.utils.parsers.loaddata</h1><div class="highlight"><pr
367369
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">w</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_words</span><span class="p">):</span>
368370
<span class="k">try</span><span class="p">:</span>
369371
<span class="n">values</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">w</span><span class="p">)</span>
370-
<span class="k">except</span><span class="p">:</span>
372+
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
371373
<span class="n">lw</span><span class="o">.</span><span class="n">ok</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
372374
<span class="c1"># prune lines that have a non-float values:</span>
373375
<span class="n">lw</span><span class="o">.</span><span class="n">values</span> <span class="o">=</span> <span class="n">values</span>
@@ -426,7 +428,7 @@ <h1>Source code for diffpy.utils.parsers.loaddata</h1><div class="highlight"><pr
426428
<span class="k">try</span><span class="p">:</span>
427429
<span class="nb">float</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
428430
<span class="k">return</span> <span class="kc">True</span>
429-
<span class="k">except</span><span class="p">:</span>
431+
<span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
430432
<span class="k">pass</span>
431433
<span class="k">return</span> <span class="kc">False</span></div>
432434

_modules/diffpy/utils/parsers/resample.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ <h1>Source code for diffpy.utils.parsers.resample</h1><div class="highlight"><pr
103103
<span class="k">def</span> <span class="nf">wsinterp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">xp</span><span class="p">,</span> <span class="n">fp</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
104104
<span class="w"> </span><span class="sd">&quot;&quot;&quot;One-dimensional Whittaker-Shannon interpolation.</span>
105105

106-
<span class="sd"> This uses the Whittaker-Shannon interpolation formula to interpolate the value of fp (array), which is defined over</span>
106+
<span class="sd"> This uses the Whittaker-Shannon interpolation formula to interpolate the value of fp (array),</span>
107+
<span class="sd"> which is defined over</span>
107108
<span class="sd"> xp (array), at x (array or float).</span>
108109

109110
<span class="sd"> Parameters</span>
@@ -115,7 +116,8 @@ <h1>Source code for diffpy.utils.parsers.resample</h1><div class="highlight"><pr
115116
<span class="sd"> fp: ndarray</span>
116117
<span class="sd"> Function to be interpolated.</span>
117118
<span class="sd"> left: float</span>
118-
<span class="sd"> If given, set fp for x &lt; xp[0] to left. Otherwise, if left is None (default) or not given, set fp for x &lt; xp[0]</span>
119+
<span class="sd"> If given, set fp for x &lt; xp[0] to left. Otherwise, if left is None (default) or not given,</span>
120+
<span class="sd"> set fp for x &lt; xp[0]</span>
119121
<span class="sd"> to fp evaluated at xp[-1].</span>
120122
<span class="sd"> right: float</span>
121123
<span class="sd"> If given, set fp for x &gt; xp[-1] to right. Otherwise, if right is None (default) or not given, set fp for</span>
@@ -196,7 +198,7 @@ <h1>Source code for diffpy.utils.parsers.resample</h1><div class="highlight"><pr
196198
<span class="c1"># spad = numpy.concatenate([s,spad])</span>
197199
<span class="c1"># rnew = numpy.arange(0, rpad[-1], dr)</span>
198200
<span class="c1"># snew = numpy.zeros_like(rnew)</span>
199-
<span class="c1">## Accomodate for the fact that r[0] might not be 0</span>
201+
<span class="c1"># Accomodate for the fact that r[0] might not be 0</span>
200202
<span class="c1"># u = (rnew-r[0]) / dr0</span>
201203
<span class="c1"># for n in range(len(spad)):</span>
202204
<span class="c1"># snew += spad[n] * numpy.sinc(u - n)</span>

api/diffpy.utils.parsers.html

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,20 @@ <h3>Parameters<a class="headerlink" href="#parameters" title="Link to this headi
138138
This seems to work for most of the datafiles including those generated by diffpy programs.</p>
139139
<section id="id1">
140140
<h3>Parameters<a class="headerlink" href="#id1" title="Link to this heading"></a></h3>
141-
<dl class="simple">
141+
<dl>
142142
<dt>filename</dt><dd><p>Name of the file we want to load data from.</p>
143143
</dd>
144-
<dt>minrows: int</dt><dd><p>Minimum number of rows in the first data block. All rows must have the same number of floating point values.</p>
144+
<dt>minrows: int</dt><dd><dl class="simple">
145+
<dt>Minimum number of rows in the first data block. All rows must have the same number of floating</dt><dd><p>point values.</p>
146+
</dd>
147+
</dl>
148+
</dd>
149+
<dt>headers: bool</dt><dd><dl>
150+
<dt>when False (defualt), the function returns a numpy array of the data in the data block.</dt><dd><dl class="simple">
151+
<dt>When True, the function instead returns a dictionary of parameters and their corresponding</dt><dd><p>values parsed from</p>
145152
</dd>
146-
<dt>headers: bool</dt><dd><dl class="simple">
147-
<dt>when False (defualt), the function returns a numpy array of the data in the data block.</dt><dd><p>When True, the function instead returns a dictionary of parameters and their corresponding values parsed from
148-
header (information prior the data block). See hdel and hignore for options to help with parsing header
153+
</dl>
154+
<p>header (information prior the data block). See hdel and hignore for options to help with parsing header
149155
information.</p>
150156
</dd>
151157
</dl>
@@ -282,19 +288,25 @@ <h3>Returns<a class="headerlink" href="#id7" title="Link to this heading"></a
282288
<dt class="sig sig-object py" id="diffpy.utils.parsers.resample.wsinterp">
283289
<span class="sig-prename descclassname"><span class="pre">diffpy.utils.parsers.resample.</span></span><span class="sig-name descname"><span class="pre">wsinterp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fp</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">left</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">right</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/diffpy/utils/parsers/resample.html#wsinterp"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#diffpy.utils.parsers.resample.wsinterp" title="Link to this definition"></a></dt>
284290
<dd><p>One-dimensional Whittaker-Shannon interpolation.</p>
285-
<p>This uses the Whittaker-Shannon interpolation formula to interpolate the value of fp (array), which is defined over
286-
xp (array), at x (array or float).</p>
291+
<dl class="simple">
292+
<dt>This uses the Whittaker-Shannon interpolation formula to interpolate the value of fp (array),</dt><dd><p>which is defined over</p>
293+
</dd>
294+
</dl>
295+
<p>xp (array), at x (array or float).</p>
287296
<section id="id8">
288297
<h3>Parameters<a class="headerlink" href="#id8" title="Link to this heading"></a></h3>
289-
<dl class="simple">
298+
<dl>
290299
<dt>x: ndarray</dt><dd><p>Desired range for interpolation.</p>
291300
</dd>
292301
<dt>xp: ndarray</dt><dd><p>Defined range for fp.</p>
293302
</dd>
294303
<dt>fp: ndarray</dt><dd><p>Function to be interpolated.</p>
295304
</dd>
296-
<dt>left: float</dt><dd><p>If given, set fp for x &lt; xp[0] to left. Otherwise, if left is None (default) or not given, set fp for x &lt; xp[0]
297-
to fp evaluated at xp[-1].</p>
305+
<dt>left: float</dt><dd><dl class="simple">
306+
<dt>If given, set fp for x &lt; xp[0] to left. Otherwise, if left is None (default) or not given,</dt><dd><p>set fp for x &lt; xp[0]</p>
307+
</dd>
308+
</dl>
309+
<p>to fp evaluated at xp[-1].</p>
298310
</dd>
299311
<dt>right: float</dt><dd><p>If given, set fp for x &gt; xp[-1] to right. Otherwise, if right is None (default) or not given, set fp for
300312
x &gt; xp[-1] to fp evaluated at xp[-1].</p>

0 commit comments

Comments
 (0)