Skip to content

Commit a6da076

Browse files
committed
DOC: minor formatting fixes
1.) consistently use double backticks 2.) consistently use a single space after periods
1 parent 353393d commit a6da076

8 files changed

Lines changed: 180 additions & 177 deletions

File tree

pywt/_dwt.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def dwt_max_level(data_len, filter_len):
2626
data_len : int
2727
Input data length.
2828
filter_len : int, str or Wavelet
29-
The wavelet filter length. Alternatively, the name of a discrete
29+
The wavelet filter length. Alternatively, the name of a discrete
3030
wavelet or a Wavelet object can be specified.
3131
3232
Returns
@@ -38,8 +38,8 @@ def dwt_max_level(data_len, filter_len):
3838
-----
3939
The rational for the choice of levels is the maximum level where at least
4040
one coefficient in the output is uncorrupted by edge effects caused by
41-
signal extension. Put another way, decomposition stops when the signal
42-
becomes shorter than the FIR filter length for a given wavelet. This
41+
signal extension. Put another way, decomposition stops when the signal
42+
becomes shorter than the FIR filter length for a given wavelet. This
4343
corresponds to:
4444
4545
.. max_level = floor(log2(data_len/(filter_len - 1)))
@@ -66,7 +66,7 @@ def dwt_max_level(data_len, filter_len):
6666
filter_len = Wavelet(filter_len).dec_len
6767
else:
6868
raise ValueError(
69-
("'{}', is not a recognized discrete wavelet. A list of "
69+
("'{}', is not a recognized discrete wavelet. A list of "
7070
"supported wavelet names can be obtained via "
7171
"pywt.wavelist(kind='discrete')").format(filter_len))
7272
elif not (isinstance(filter_len, Number) and filter_len % 1 == 0):
@@ -198,11 +198,11 @@ def idwt(cA, cD, wavelet, mode='symmetric', axis=-1):
198198
Parameters
199199
----------
200200
cA : array_like or None
201-
Approximation coefficients. If None, will be set to array of zeros
202-
with same shape as `cD`.
201+
Approximation coefficients. If None, will be set to array of zeros
202+
with same shape as ``cD``.
203203
cD : array_like or None
204-
Detail coefficients. If None, will be set to array of zeros
205-
with same shape as `cA`.
204+
Detail coefficients. If None, will be set to array of zeros
205+
with same shape as ``cA``.
206206
wavelet : Wavelet object or name
207207
Wavelet to use
208208
mode : str, optional (default: 'symmetric')
@@ -224,9 +224,9 @@ def idwt(cA, cD, wavelet, mode='symmetric', axis=-1):
224224
>>> pywt.idwt(cA, cD, 'db2', 'smooth')
225225
array([ 1., 2., 3., 4., 5., 6.])
226226
227-
One of the neat features of `idwt` is that one of the ``cA`` and ``cD``
228-
arguments can be set to None. In that situation the reconstruction will be
229-
performed using only the other one. Mathematically speaking, this is
227+
One of the neat features of ``idwt`` is that one of the ``cA`` and ``cD``
228+
arguments can be set to None. In that situation the reconstruction will be
229+
performed using only the other one. Mathematically speaking, this is
230230
equivalent to passing a zero-filled array as one of the arguments.
231231
232232
>>> (cA, cD) = pywt.dwt([1,2,3,4,5,6], 'db2', 'smooth')
@@ -300,7 +300,7 @@ def downcoef(part, data, wavelet, mode='symmetric', level=1):
300300
301301
Partial Discrete Wavelet Transform data decomposition.
302302
303-
Similar to `pywt.dwt`, but computes only one set of coefficients.
303+
Similar to ``dwt``, but computes only one set of coefficients.
304304
Useful when you need only approximation or only details at the given level.
305305
306306
Parameters
@@ -316,9 +316,9 @@ def downcoef(part, data, wavelet, mode='symmetric', level=1):
316316
wavelet : Wavelet object or name
317317
Wavelet to use
318318
mode : str, optional
319-
Signal extension mode, see `Modes`. Default is 'symmetric'.
319+
Signal extension mode, see ``Modes``. Default is 'symmetric'.
320320
level : int, optional
321-
Decomposition level. Default is 1.
321+
Decomposition level. Default is 1.
322322
323323
Returns
324324
-------
@@ -362,7 +362,7 @@ def upcoef(part, coeffs, wavelet, level=1, take=0):
362362
wavelet : Wavelet object or name
363363
Wavelet to use
364364
level : int, optional
365-
Multilevel reconstruction level. Default is 1.
365+
Multilevel reconstruction level. Default is 1.
366366
take : int, optional
367367
Take central part of length equal to 'take' from the result.
368368
Default is 0.

pywt/_extensions/_pywt.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class _DeprecatedMODES(_Modes):
148148
every time MODES is used.
149149
150150
N.B. have to use __getattribute__ as well as __getattr__
151-
to ensure warning on e.g. `MODES.symmetric`.
151+
to ensure warning on e.g. ``MODES.symmetric``.
152152
"""
153153
if not attr.startswith('_'):
154154
warnings.warn(_DeprecatedMODES.msg, DeprecationWarning)
@@ -200,7 +200,7 @@ def wavelist(family=None, kind='all'):
200200
201201
kind : {'all', 'continuous', 'discrete'}, optional
202202
Whether to return only wavelet names of discrete or continuous
203-
wavelets, or all wavelets. Default is ``'all'``.
203+
wavelets, or all wavelets. Default is ``'all'``.
204204
Ignored if ``family`` is specified.
205205
206206
Returns
@@ -309,7 +309,7 @@ def DiscreteContinuousWavelet(name=u"", object filter_bank=None):
309309
a valid name from the wavelist() list.
310310
To create a custom wavelet object, filter_bank parameter must
311311
be specified. It can be either a list of four filters or an object
312-
that a `filter_bank` attribute which returns a list of four
312+
that a ``filter_bank`` attribute which returns a list of four
313313
filters - just like the Wavelet instance itself.
314314
315315
For a ContinuousWavelet, filter_bank cannot be used and must remain unset.
@@ -337,7 +337,7 @@ cdef public class Wavelet [type WaveletType, object WaveletObject]:
337337
a valid name from the wavelist() list.
338338
To create a custom wavelet object, filter_bank parameter must
339339
be specified. It can be either a list of four filters or an object
340-
that a `filter_bank` attribute which returns a list of four
340+
that a ``filter_bank`` attribute which returns a list of four
341341
filters - just like the Wavelet instance itself.
342342
343343
"""
@@ -360,7 +360,7 @@ cdef public class Wavelet [type WaveletType, object WaveletObject]:
360360
if self.w is NULL:
361361
if self.name in wavelist(kind='continuous'):
362362
raise ValueError("The `Wavelet` class is for discrete "
363-
"wavelets, %s is a continuous wavelet. Use "
363+
"wavelets, %s is a continuous wavelet. Use "
364364
"pywt.ContinuousWavelet instead" % self.name)
365365
else:
366366
raise ValueError("Invalid wavelet name '%s'." % self.name)
@@ -548,8 +548,8 @@ cdef public class Wavelet [type WaveletType, object WaveletObject]:
548548
"""
549549
wavefun(self, level=8)
550550
551-
Calculates approximations of scaling function (`phi`) and wavelet
552-
function (`psi`) on xgrid (`x`) at a given level of refinement.
551+
Calculates approximations of scaling function (``phi``) and wavelet
552+
function (``psi``) on xgrid (``x``) at a given level of refinement.
553553
554554
Parameters
555555
----------
@@ -700,7 +700,7 @@ cdef public class ContinuousWavelet [type ContinuousWaveletType, object Continuo
700700
if base_name == 'fbsp':
701701
msg = (
702702
"Wavelets of family {0}, without parameters "
703-
"specified in the name are deprecated. The name "
703+
"specified in the name are deprecated. The name "
704704
"should take the form {0}M-B-C where M is the spline "
705705
"order and B, C are floats representing the bandwidth "
706706
"frequency and center frequency, respectively "
@@ -1030,7 +1030,7 @@ cpdef np.dtype _check_dtype(data):
10301030
# half-precision input converted to single precision
10311031
dt = np.dtype('float32')
10321032
elif dt == np.complex256:
1033-
# complex256 is not supported. run at reduced precision
1033+
# complex256 is not supported. run at reduced precision
10341034
dt = np.dtype('complex128')
10351035
else:
10361036
# integer input was always accepted; convert to float64

pywt/_functions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def integrate_wavelet(wavelet, precision=8):
6464
Parameters
6565
----------
6666
wavelet : Wavelet instance or str
67-
Wavelet to integrate. If a string, should be the name of a wavelet.
67+
Wavelet to integrate. If a string, should be the name of a wavelet.
6868
precision : int, optional
6969
Precision that will be used for wavelet function
7070
approximation computed with the wavefun(level=precision)
@@ -126,7 +126,7 @@ def central_frequency(wavelet, precision=8):
126126
Parameters
127127
----------
128128
wavelet : Wavelet instance, str or tuple
129-
Wavelet to integrate. If a string, should be the name of a wavelet.
129+
Wavelet to integrate. If a string, should be the name of a wavelet.
130130
precision : int, optional
131131
Precision that will be used for wavelet function
132132
approximation computed with the wavefun(level=precision)
@@ -166,11 +166,11 @@ def scale2frequency(wavelet, scale, precision=8):
166166
Parameters
167167
----------
168168
wavelet : Wavelet instance or str
169-
Wavelet to integrate. If a string, should be the name of a wavelet.
169+
Wavelet to integrate. If a string, should be the name of a wavelet.
170170
scale : scalar
171171
precision : int, optional
172172
Precision that will be used for wavelet function approximation computed
173-
with ``wavelet.wavefun(level=precision)``. Default is 8.
173+
with ``wavelet.wavefun(level=precision)``. Default is 8.
174174
175175
Returns
176176
-------
@@ -184,7 +184,7 @@ def qmf(filt):
184184
"""
185185
Returns the Quadrature Mirror Filter(QMF).
186186
187-
The magnitude response of QMF is mirror image about `pi/2` of that of the
187+
The magnitude response of QMF is mirror image about ``pi/2`` of that of the
188188
input filter.
189189
190190
Parameters

pywt/_multidim.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def dwt2(data, wavelet, mode='symmetric', axes=(-2, -1)):
3030
data : array_like
3131
2D array with input data
3232
wavelet : Wavelet object or name string, or 2-tuple of wavelets
33-
Wavelet to use. This can also be a tuple containing a wavelet to
33+
Wavelet to use. This can also be a tuple containing a wavelet to
3434
apply along each axis in ``axes``.
3535
mode : str or 2-tuple of strings, optional
36-
Signal extension mode, see Modes (default: 'symmetric'). This can
36+
Signal extension mode, see Modes (default: 'symmetric'). This can
3737
also be a tuple of modes specifying the mode to use on each axis in
3838
``axes``.
3939
axes : 2-tuple of ints, optional
@@ -44,7 +44,7 @@ def dwt2(data, wavelet, mode='symmetric', axes=(-2, -1)):
4444
-------
4545
(cA, (cH, cV, cD)) : tuple
4646
Approximation, horizontal detail, vertical detail and diagonal
47-
detail coefficients respectively. Horizontal refers to array axis 0
47+
detail coefficients respectively. Horizontal refers to array axis 0
4848
(or ``axes[0]`` for user-specified ``axes``).
4949
5050
Examples
@@ -84,13 +84,13 @@ def idwt2(coeffs, wavelet, mode='symmetric', axes=(-2, -1)):
8484
----------
8585
coeffs : tuple
8686
(cA, (cH, cV, cD)) A tuple with approximation coefficients and three
87-
details coefficients 2D arrays like from `dwt2`. If any of these
87+
details coefficients 2D arrays like from `dwt2`. If any of these
8888
components are set to ``None``, it will be treated as zeros.
8989
wavelet : Wavelet object or name string, or 2-tuple of wavelets
90-
Wavelet to use. This can also be a tuple containing a wavelet to
90+
Wavelet to use. This can also be a tuple containing a wavelet to
9191
apply along each axis in ``axes``.
9292
mode : str or 2-tuple of strings, optional
93-
Signal extension mode, see Modes (default: 'symmetric'). This can
93+
Signal extension mode, see Modes (default: 'symmetric'). This can
9494
also be a tuple of modes specifying the mode to use on each axis in
9595
``axes``.
9696
axes : 2-tuple of ints, optional
@@ -127,11 +127,11 @@ def dwtn(data, wavelet, mode='symmetric', axes=None):
127127
data : array_like
128128
n-dimensional array with input data.
129129
wavelet : Wavelet object or name string, or tuple of wavelets
130-
Wavelet to use. This can also be a tuple containing a wavelet to
130+
Wavelet to use. This can also be a tuple containing a wavelet to
131131
apply along each axis in ``axes``.
132132
mode : str or tuple of string, optional
133133
Signal extension mode used in the decomposition,
134-
see Modes (default: 'symmetric'). This can also be a tuple of modes
134+
see Modes (default: 'symmetric'). This can also be a tuple of modes
135135
specifying the mode to use on each axis in ``axes``.
136136
axes : sequence of ints, optional
137137
Axes over which to compute the DWT. Repeated elements mean the DWT will
@@ -229,11 +229,11 @@ def idwtn(coeffs, wavelet, mode='symmetric', axes=None):
229229
Dictionary as in output of ``dwtn``. Missing or ``None`` items
230230
will be treated as zeros.
231231
wavelet : Wavelet object or name string, or tuple of wavelets
232-
Wavelet to use. This can also be a tuple containing a wavelet to
232+
Wavelet to use. This can also be a tuple containing a wavelet to
233233
apply along each axis in ``axes``.
234234
mode : str or list of string, optional
235235
Signal extension mode used in the decomposition,
236-
see Modes (default: 'symmetric'). This can also be a tuple of modes
236+
see Modes (default: 'symmetric'). This can also be a tuple of modes
237237
specifying the mode to use on each axis in ``axes``.
238238
axes : sequence of ints, optional
239239
Axes over which to compute the IDWT. Repeated elements mean the IDWT

0 commit comments

Comments
 (0)