Skip to content

Commit b5b054d

Browse files
DOC: Fix indentation for some interactive examples
1 parent 8c63926 commit b5b054d

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

doc/source/ref/cwt.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ wavelet names compatible with ``cwt`` can be obtained by:
9292
.. try_examples::
9393
:button_text: Try it in your browser!
9494

95-
>>> import pywt
96-
>>> wavelist = pywt.wavelist(kind='continuous')
95+
>>> import pywt
96+
>>> wavelist = pywt.wavelist(kind='continuous')
9797

9898
Here is an overview of all available wavelets for ``cwt``. Note, that they can be
9999
customized by passing parameters such as ``center_frequency`` and ``bandwidth_frequency``
@@ -210,11 +210,11 @@ particular wavelet, one would analyze a signal using ``scales >= 2``.
210210
.. try_examples::
211211
:button_text: Try it in your browser!
212212

213-
>>> import numpy as np
214-
>>> import pywt
215-
>>> dt = 0.01 # 100 Hz sampling
216-
>>> frequencies = pywt.scale2frequency('cmor1.5-1.0', [1, 2, 3, 4]) / dt
217-
>>> frequencies
213+
>>> import numpy as np
214+
>>> import pywt
215+
>>> dt = 0.01 # 100 Hz sampling
216+
>>> frequencies = pywt.scale2frequency('cmor1.5-1.0', [1, 2, 3, 4]) / dt
217+
>>> frequencies
218218
array([ 100. , 50. , 33.33333333, 25. ])
219219

220220
The CWT in PyWavelets is applied to discrete data by convolution with samples
@@ -241,14 +241,14 @@ of frequency directly.
241241
.. try_examples::
242242
:button_text: Try it in your browser!
243243

244-
>>> import numpy as np
245-
>>> import pywt
246-
>>> dt = 0.01 # 100 Hz sampling
247-
>>> fs = 1 / dt
248-
>>> frequencies = np.array([100, 50, 33.33333333, 25]) / fs # normalize
249-
>>> scale = pywt.frequency2scale('cmor1.5-1.0', frequencies)
250-
>>> scale
251-
array([ 1., 2., 3., 4.])
244+
>>> import numpy as np
245+
>>> import pywt
246+
>>> dt = 0.01 # 100 Hz sampling
247+
>>> fs = 1 / dt
248+
>>> frequencies = np.array([100, 50, 33.33333333, 25]) / fs # normalize
249+
>>> scale = pywt.frequency2scale('cmor1.5-1.0', frequencies)
250+
>>> scale
251+
array([ 1., 2., 3., 4.])
252252

253253

254254
.. plot:: pyplots/cwt_scaling_demo.py

doc/source/ref/signal-extension-modes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ computations can be performed with the `periodization`_ mode:
9292
.. try_examples::
9393
:button_text: Try it in your browser!
9494

95-
>>> import pywt
96-
>>> print(pywt.Modes.modes)
97-
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect', 'antisymmetric', 'antireflect']
95+
>>> import pywt
96+
>>> print(pywt.Modes.modes)
97+
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect', 'antisymmetric', 'antireflect']
9898

9999
The following figure illustrates how a short signal (red) gets extended (black)
100100
outside of its original extent. Note that periodization first extends the

doc/source/ref/wavelets.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -241,25 +241,25 @@ The Wavelet object created in this way is a standard :class:`Wavelet` instance.
241241
The following example illustrates the way of creating custom Wavelet objects
242242
from plain Python lists of filter coefficients and a *filter bank-like* object.
243243

244-
**Example:**
245-
246-
.. try_examples::
247-
:button_text: Try it in your browser!
248-
249-
>>> import pywt, math
250-
>>> c = math.sqrt(2)/2
251-
>>> dec_lo, dec_hi, rec_lo, rec_hi = [c, c], [-c, c], [c, c], [c, -c]
252-
>>> filter_bank = [dec_lo, dec_hi, rec_lo, rec_hi]
253-
>>> myWavelet = pywt.Wavelet(name="myHaarWavelet", filter_bank=filter_bank)
254-
>>>
255-
>>> class HaarFilterBank(object):
256-
... @property
257-
... def filter_bank(self):
258-
... c = math.sqrt(2)/2
259-
... dec_lo, dec_hi, rec_lo, rec_hi = [c, c], [-c, c], [c, c], [c, -c]
260-
... return [dec_lo, dec_hi, rec_lo, rec_hi]
261-
>>> filter_bank = HaarFilterBank()
262-
>>> myOtherWavelet = pywt.Wavelet(name="myHaarWavelet", filter_bank=filter_bank)
244+
**Example:**
245+
246+
.. try_examples::
247+
:button_text: Try it in your browser!
248+
249+
>>> import pywt, math
250+
>>> c = math.sqrt(2)/2
251+
>>> dec_lo, dec_hi, rec_lo, rec_hi = [c, c], [-c, c], [c, c], [c, -c]
252+
>>> filter_bank = [dec_lo, dec_hi, rec_lo, rec_hi]
253+
>>> myWavelet = pywt.Wavelet(name="myHaarWavelet", filter_bank=filter_bank)
254+
>>>
255+
>>> class HaarFilterBank(object):
256+
... @property
257+
... def filter_bank(self):
258+
... c = math.sqrt(2)/2
259+
... dec_lo, dec_hi, rec_lo, rec_hi = [c, c], [-c, c], [c, c], [c, -c]
260+
... return [dec_lo, dec_hi, rec_lo, rec_hi]
261+
>>> filter_bank = HaarFilterBank()
262+
>>> myOtherWavelet = pywt.Wavelet(name="myHaarWavelet", filter_bank=filter_bank)
263263

264264

265265
.. _ContinuousWavelet:

0 commit comments

Comments
 (0)