From 33367e4c7131bf58ab6e451d6eb474d088c60a47 Mon Sep 17 00:00:00 2001 From: pbrod Date: Fri, 27 May 2016 14:12:22 +0200 Subject: [PATCH] Updated doctests --- wafo/polynomial.py | 7 ++++--- wafo/spectrum/core.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wafo/polynomial.py b/wafo/polynomial.py index 637a0b2..2b0082a 100644 --- a/wafo/polynomial.py +++ b/wafo/polynomial.py @@ -19,6 +19,7 @@ # !/usr/bin/env python from __future__ import absolute_import import warnings # @UnusedImport +from functools import reduce from numpy.polynomial import polyutils as pu from .plotbackend import plotbackend as plt import numpy as np @@ -236,8 +237,8 @@ def polydeg(x, y): >>> x = np.linspace(0,10,300) >>> y = np.sin(x ** 3 / 100) ** 2 + 0.05 * np.random.randn(x.size) >>> n = polydeg(x,y) - >>> n - 21 + >>> 18 < n < 24 + True ys = orthofit(x,y,n); plt.plot(x, y, '.', x, ys, 'k') @@ -266,7 +267,7 @@ def polydeg(x, y): # required to take AIC noise into account and to ensure that this minimum # is a (likely) global minimum. - while nit < 6: + while nit < 8: p = orthofit(x, y, n) ys = orthoval(p, x) # -- Akaike's Information Criterion diff --git a/wafo/spectrum/core.py b/wafo/spectrum/core.py index f994317..da3dd8c 100644 --- a/wafo/spectrum/core.py +++ b/wafo/spectrum/core.py @@ -4213,4 +4213,4 @@ def test_docstrings(): if __name__ == '__main__': test_docstrings() # test_mm_pdf() - # main() + # main()