diff --git a/doc/source/regression/dwt-idwt.md b/doc/source/regression/dwt-idwt.md index 28d1c7f1..2396ce46 100644 --- a/doc/source/regression/dwt-idwt.md +++ b/doc/source/regression/dwt-idwt.md @@ -91,6 +91,7 @@ function: # for documentation tests --> + ```{code-cell} int(pywt.dwt_coeff_len(data_len=len(x), filter_len=w.dec_len, mode='symmetric')) ``` @@ -143,10 +144,9 @@ print(pywt.idwt(cA, cD, 'sym3', 'periodization')) ### Passing `None` instead of coefficients data to {func}`idwt` Now, we showcase some tips & tricks. Passing `None` as one of the coefficient -arrays parameters is similar to passing a *zero-filled* array. The results are +arrays parameters is similar to passing a _zero-filled_ array. The results are simply the same: - ```{code-cell} print(pywt.idwt([1,2,0,1], None, 'db2', 'symmetric')) ``` diff --git a/doc/source/regression/gotchas.md b/doc/source/regression/gotchas.md index 63736f7c..738d4d14 100644 --- a/doc/source/regression/gotchas.md +++ b/doc/source/regression/gotchas.md @@ -41,17 +41,18 @@ The results are: ```{code-cell} numpy.all(numpy.isnan(cA)) ``` - + ```{code-cell} numpy.all(numpy.isnan(cD)) ``` - + ```{code-cell} rec = pywt.idwt(cA, cD, wavelet, mode) numpy.all(numpy.isnan(rec)) ``` + diff --git a/doc/source/regression/multilevel.md b/doc/source/regression/multilevel.md index c42cd883..5ec5f336 100644 --- a/doc/source/regression/multilevel.md +++ b/doc/source/regression/multilevel.md @@ -94,8 +94,6 @@ cA2 cD2 ``` - - ```{code-cell} [(cA2, cD2)] = pywt.swt(cA1, db1, level=1, start_level=1) ``` diff --git a/doc/source/regression/wavelet.md b/doc/source/regression/wavelet.md index 8740e3ea..b533ecb3 100644 --- a/doc/source/regression/wavelet.md +++ b/doc/source/regression/wavelet.md @@ -27,7 +27,7 @@ kernelspec: ## Wavelet families and builtin Wavelets names {class}`Wavelet` objects are really a handy carriers of a bunch of DWT-specific -data like *quadrature mirror filters* and some general properties associated +data like _quadrature mirror filters_ and some general properties associated with them. At first let's go through the methods of creating a {class}`Wavelet` object. @@ -108,6 +108,7 @@ print(w.family_name) + ```{code-cell} int(w.dec_len) ``` @@ -122,21 +123,18 @@ int(w.rec_len) w.orthogonal ``` - ```{code-cell} w.biorthogonal ``` - 3. Symmetry ({attr}`~Wavelet.symmetry`): ```{code-cell} print(w.symmetry) ``` - 4. Number of vanishing moments for the scaling function `phi` ({attr}`~Wavelet.vanishing_moments_phi`) -and the wavelet function `psi` ({attr}`~Wavelet.vanishing_moments_psi`), associated with the filters: + and the wavelet function `psi` ({attr}`~Wavelet.vanishing_moments_psi`), associated with the filters: ```{code-cell} w.vanishing_moments_phi @@ -150,7 +148,7 @@ Now when we know a bit about the builtin Wavelets, let's see how to create {ref}`custom Wavelets ` objects. These can be done in two ways: 1. Passing the filter bank object that implements the `filter_bank` attribute. The -attribute must return four filters coefficients. + attribute must return four filters coefficients. ```{code-cell} class MyHaarFilterBank(object): diff --git a/doc/source/regression/wp.md b/doc/source/regression/wp.md index 204a3cbe..8c745f12 100644 --- a/doc/source/regression/wp.md +++ b/doc/source/regression/wp.md @@ -23,6 +23,7 @@ kernelspec: ``` + ```{code-cell} --- tags: [hide-input] @@ -51,7 +52,6 @@ def format_array(a): return numpy.array2string(a, precision=5, separator=' ', suppress_small=True) ``` - ## Create Wavelet Packet structure Okay, let's create a sample {class}`WaveletPacket` object: @@ -115,7 +115,6 @@ print(wp['a'].data) print(wp['a'].path) ``` - - 2nd level: ```{code-cell} @@ -126,7 +125,6 @@ print(wp['aa'].data) print(wp['aa'].path) ``` - - 3rd level: ```{code-cell} @@ -225,7 +223,6 @@ print([node.path for node in wp.get_level(3, 'freq')]) Note that {meth}`WaveletPacket.get_level` also performs automatic decomposition until it reaches the specified `level`. - ## Reconstructing data from Wavelet Packets ```{code-cell} @@ -284,7 +281,6 @@ print([n.path for n in new_wp.get_leaf_nodes(False)]) print([n.path for n in new_wp.get_leaf_nodes(True)]) ``` - ## Removing nodes from Wavelet Packet tree Let's create some sample data: @@ -366,7 +362,7 @@ print(wp.a) **Remember that you should not rely on the attribute access.** 2. At the first attempt to access the node, it is computed via the decomposition -of its parent node (which is the `wp` object itself). + of its parent node (which is the `wp` object itself). ```{code-cell} print(wp['a']) diff --git a/doc/source/regression/wp2d.md b/doc/source/regression/wp2d.md index 31854e7d..3a5574e4 100644 --- a/doc/source/regression/wp2d.md +++ b/doc/source/regression/wp2d.md @@ -27,6 +27,7 @@ kernelspec: ## Import pywt + ```{code-cell} from __future__ import print_function import pywt @@ -159,6 +160,7 @@ print(wp['aaaa'].data) ``` + Ups, we have reached the maximum level of decomposition for the `'aaaa'` path, which, by the way, was: @@ -186,42 +188,34 @@ just like with {class}`Node` and {class}`WaveletPacket` for the 1D case.). print(wp['av'].data) ``` - ```{code-cell} print(wp['av'].path) ``` - ```{code-cell} print(wp['av'].node_name) ``` - ```{code-cell} print(wp['av'].parent.path) ``` - ```{code-cell} print(wp['av'].parent.data) ``` - ```{code-cell} print(wp['av'].level) ``` - ```{code-cell} print(wp['av'].maxlevel) ``` - ```{code-cell} print(wp['av'].mode) ``` - ### Collecting nodes We can get all nodes on the particular level using the @@ -247,7 +241,6 @@ len(wp.get_level(1)) print([node.path for node in wp.get_level(1)]) ``` - - 2nd level of decomposition: ```{code-cell} @@ -314,7 +307,7 @@ Note: just remember to not assign to the `node.data parameter directly (TODO). And reconstruct the data from the `a`, `d`, `vh`, `vv`, `vd` and `h` packets (Note that `va` node was not set and the WP tree is "not complete" -\- the `va` branch will be treated as *zero-array*): +\- the `va` branch will be treated as _zero-array_): ```{code-cell} print(new_wp.reconstruct(update=False)) @@ -371,7 +364,7 @@ print([n.path for n in new_wp.get_leaf_nodes()]) ``` Passing the `decompose = True` parameter to the method will force the WP -object to do a full decomposition up to the *maximum level* of decomposition: +object to do a full decomposition up to the _maximum level_ of decomposition: ```{code-cell} paths = [n.path for n in new_wp.get_leaf_nodes(decompose=True)]