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 wafo.plotbackend import plotbackend as plt
from wafo.demos import humps
from wafo.misc import dea3
from numdifftools.extrapolation import dea3
# from wafo.dctpack import dct
from collections import defaultdict
# from pychebfun import Chebfun

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

Loading…
Cancel
Save