Skip to content

Commit 0136844

Browse files
authored
Merge pull request #463 from grlee77/test_doc_fix
TST: fix misc. doctest failures (test_doc.py)
2 parents efd20d0 + 374ca20 commit 0136844

7 files changed

Lines changed: 13 additions & 5 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ script:
7373
pip install PyWavelets*.whl -v
7474
pushd demo
7575
nosetests pywt
76+
python ../pywt/tests/test_doc.py
7677
popd
7778
elif [ "${USE_SDIST}" == "1" ]; then
7879
python setup.py sdist
7980
# Move out of source directory to avoid finding local pywt
8081
pushd dist
8182
pip install PyWavelets* -v
8283
nosetests pywt
84+
python ../pywt/tests/test_doc.py
8385
popd
8486
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
8587
pip install -e . -v

doc/source/ref/other-functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ Each can be loaded via a function of the same name.
7171

7272
>>> import pywt
7373
>>> camera = pywt.data.camera()
74-
>>> doppler = pywt.data.demo_signal('doppler')
74+
>>> doppler = pywt.data.demo_signal('doppler', 1024)
7575
>>> available_signals = pywt.data.demo_signal('list')

doc/source/ref/wavelets.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ from plain Python lists of filter coefficients and a *filter bank-like* object.
332332
>>> print(wavelet)
333333
ContinuousWavelet gaus1
334334
Family name: Gaussian
335-
Short name: db
335+
Short name: gaus
336336
Symmetry: anti-symmetric
337337
DWT: False
338338
CWT: True
@@ -390,7 +390,7 @@ Approximating wavelet functions - ``ContinuousWavelet.wavefun()``
390390
>>> print(wavelet)
391391
ContinuousWavelet gaus1
392392
Family name: Gaussian
393-
Short name: db
393+
Short name: gaus
394394
Symmetry: anti-symmetric
395395
DWT: False
396396
CWT: True

doc/source/regression/dwt-idwt.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extension mode (please refer to the PyWavelets' documentation for the
7474
:ref:`extension modes <Modes>` available:
7575

7676
>>> pywt.Modes.modes
77-
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect']
77+
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect', 'antisymmetric', 'antireflect']
7878

7979
As you see in the above example, the :ref:`periodization <Modes.periodization>`
8080
(periodization) mode is slightly different from the others. It's aim when

doc/source/regression/modes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Import :mod:`pywt` first
1919
List of available signal extension :ref:`modes <Modes>`:
2020

2121
>>> print(pywt.Modes.modes)
22-
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect']
22+
['zero', 'constant', 'symmetric', 'periodic', 'smooth', 'periodization', 'reflect', 'antisymmetric', 'antireflect']
2323

2424

2525
Invalid mode name should rise a :exc:`ValueError`:

pywt/_multilevel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ def wavedecn_size(shapes):
933933
934934
Examples
935935
--------
936+
>>> import numpy as np
936937
>>> import pywt
937938
>>> data_shape = (64, 32)
938939
>>> shapes = pywt.wavedecn_shapes(data_shape, 'db2', mode='periodization')

pywt/tests/test_doc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
import os
66
import unittest
77

8+
try:
9+
import numpy as np
10+
np.set_printoptions(legacy='1.13')
11+
except TypeError:
12+
pass
813

914
pdir = os.path.pardir
1015
docs_base = os.path.abspath(os.path.join(os.path.dirname(__file__),

0 commit comments

Comments
 (0)