Moved import of dea3 directly to integrate. Added import collections

master
Per A Brodtkorb 7 years ago
parent a63561bad3
commit a148caa586

@ -9,7 +9,7 @@ from scipy import special as sp
from scipy.integrate import simps, trapz from scipy.integrate import simps, trapz
from wafo.plotbackend import plotbackend as plt from wafo.plotbackend import plotbackend as plt
from wafo.demos import humps from wafo.demos import humps
from wafo.misc import dea3 from numdifftools.extrapolation import dea3
# from wafo.dctpack import dct # from wafo.dctpack import dct
from collections import defaultdict from collections import defaultdict
# from pychebfun import Chebfun # from pychebfun import Chebfun

@ -3,6 +3,7 @@ Misc
''' '''
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
import sys import sys
import collections
from wafo import numba_misc from wafo import numba_misc
import fractions import fractions
import numpy as np import numpy as np
@ -17,9 +18,7 @@ from scipy.special import gammaln
from scipy.integrate import trapz, simps from scipy.integrate import trapz, simps
import warnings import warnings
from time import strftime, gmtime from time import strftime, gmtime
from numdifftools.extrapolation import dea3 # @UnusedImport
from wafo.plotbackend import plotbackend from wafo.plotbackend import plotbackend
from collections import Callable
import numbers import numbers
try: try:
from wafo import c_library as clib # @UnresolvedImport from wafo import c_library as clib # @UnresolvedImport
@ -36,7 +35,7 @@ __all__ = ['now', 'spaceline', 'narg_smallest', 'args_flat', 'is_numlike',
'parse_kwargs', 'detrendma', 'ecross', 'findcross', 'findextrema', 'parse_kwargs', 'detrendma', 'ecross', 'findcross', 'findextrema',
'findpeaks', 'findrfc', 'rfcfilter', 'findtp', 'findtc', 'findpeaks', 'findrfc', 'rfcfilter', 'findtp', 'findtc',
'findoutliers', 'common_shape', 'argsreduce', 'stirlerr', 'findoutliers', 'common_shape', 'argsreduce', 'stirlerr',
'getshipchar', 'dea3', 'getshipchar',
'betaloge', 'gravity', 'nextpow2', 'discretize', 'betaloge', 'gravity', 'nextpow2', 'discretize',
'polar2cart', 'cart2polar', 'pol2cart', 'cart2pol', 'polar2cart', 'cart2polar', 'pol2cart', 'cart2pol',
'meshgrid', 'ndgrid', 'trangood', 'tranproc', 'meshgrid', 'ndgrid', 'trangood', 'tranproc',
@ -2082,7 +2081,7 @@ def _discretize_adaptive(fun, a, b, tol=0.005, n=5):
err = erri.max() err = erri.max()
err0 = inf err0 = inf
num_tries = 0 num_tries = 0
reltol = abstol = tol # reltol = abstol = tol
for j in range(50): for j in range(50):
if num_tries < 5 and err > tol: if num_tries < 5 and err > tol:
err0 = err err0 = err

Loading…
Cancel
Save