Made doctests less strict

master
Per A Brodtkorb 8 years ago
parent 91bac94a80
commit 7a1c6307a0

@ -1086,14 +1086,14 @@ class Pchip(BPoly):
# Call the Scipy cubic spline interpolator # Call the Scipy cubic spline interpolator
>>> from scipy.interpolate import interpolate >>> from scipy.interpolate import interpolate
>>> function = interpolate.interp1d(x, y, kind='cubic') >>> function = interpolate.interp1d(x, y, kind='cubic')
>>> yvec1 = function(xvec) >>> yvec1 = function(xvec); yvec1
>>> np.allclose(yvec1, [-1.00000000e+00, -9.41911765e-01, -8.70588235e-01, >>> np.allclose(yvec1, [-1.00000000e+00, -9.41911765e-01, -8.70588235e-01,
... -7.87500000e-01, -6.94117647e-01, -5.91911765e-01, ... -7.87500000e-01, -6.94117647e-01, -5.91911765e-01,
... -4.82352941e-01, -3.66911765e-01, -2.47058824e-01, ... -4.82352941e-01, -3.66911765e-01, -2.47058824e-01,
... -1.24264706e-01, 2.49800181e-16, 1.24264706e-01, ... -1.24264706e-01, 2.49800181e-16, 1.24264706e-01,
... 2.47058824e-01, 3.66911765e-01, 4.82352941e-01, ... 2.47058824e-01, 3.66911765e-01, 4.82352941e-01,
... 5.91911765e-01, 6.94117647e-01, 7.87500000e-01, ... 5.91911765e-01, 6.94117647e-01, 7.87500000e-01,
... 8.70588235e-01, 9.41911765e-01]) ... 8.70588235e-01, 9.41911765e-01], rtol=1e-3)
True True
@ -1346,7 +1346,7 @@ def test_pp():
def test_docstrings(): def test_docstrings():
import doctest import doctest
print('Testing docstrings in {}'.formate(__file__)) print('Testing docstrings in {}'.format(__file__))
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE) doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)

@ -1181,11 +1181,12 @@ class TimeSeries(PlotData):
>>> ts = wo.mat2timeseries(x) >>> ts = wo.mat2timeseries(x)
>>> S0 = ts.tospecdata(method='psd') >>> S0 = ts.tospecdata(method='psd')
>>> np.allclose(S0.data[21:25], >>> np.allclose(S0.data[21:25],
... ( 0.2543896 , 0.26366755, 0.23372824, 0.19459349)) ... (0.2543896 , 0.26366755, 0.23372824, 0.19459349), rtol=1e-2)
True True
>>> S = ts.tospecdata() >>> S = ts.tospecdata()
>>> np.allclose(S.data[21:25], >>> np.allclose(S.data[21:25],
... (0.00207876, 0.0025113 , 0.00300008, 0.00351852)) ... (0.00207876, 0.0025113 , 0.00300008, 0.00351852), rtol=1e-2)
True True
>>> h = S.plot() >>> h = S.plot()

Loading…
Cancel
Save