moved test/test_dispersion_relation.py to the wave_theory/test

master
Per.Andreas.Brodtkorb 12 years ago
parent 6121ccdea1
commit 7b806924f1

@ -1674,7 +1674,7 @@ class SpecData1D(PlotData):
f = wafodata(); f = PlotData();
# f.options = options; # f.options = options;
# if defnr>1 or defnr==-2: # if defnr>1 or defnr==-2:
# f.u = utc # save level u # f.u = utc # save level u

@ -192,9 +192,11 @@ def test_bandwidth():
>>> S.bandwidth([0,1,2,3]) >>> S.bandwidth([0,1,2,3])
array([ 0.65354446, 0.3975428 , 0.75688813, 2.00207912]) array([ 0.65354446, 0.3975428 , 0.75688813, 2.00207912])
''' '''
def main(): def test_docstrings():
import doctest import doctest
doctest.testmod() doctest.testmod()
if __name__ == '__main__': if __name__ == '__main__':
main() #from nose.plugins.plugintest import run_buffered as run
#run()
test_docstrings()

@ -2135,8 +2135,8 @@ class rv_continuous(rv_generic):
arguments relevant for a given distribution. arguments relevant for a given distribution.
""" """
loc = kwds.get('loc', 0) loc = kwds.get('loc', None)
scale = kwds.get('scale', 1) scale = kwds.get('scale', None)
args, loc, scale = self.fix_loc_scale(args, loc, scale) args, loc, scale = self.fix_loc_scale(args, loc, scale)
if not (self._argcheck(*args) and (scale > 0)): if not (self._argcheck(*args) and (scale > 0)):
return nan return nan
@ -3195,8 +3195,8 @@ class cauchy_gen(rv_continuous):
return inf, inf, nan, nan return inf, inf, nan, nan
def _entropy(self): def _entropy(self):
return log(4*pi) return log(4*pi)
def _fitstart(data, args=None): def _fitstart(self, data, args=None):
return (0, 1) return (0, 1)
cauchy = cauchy_gen(name='cauchy') cauchy = cauchy_gen(name='cauchy')
@ -7591,7 +7591,7 @@ class rv_discrete(rv_generic):
else: else:
invfac = 1.0 invfac = 1.0
tot = 0.0 # tot = 0.0
low, upp = self._ppf(0.001, *args), self._ppf(0.999, *args) low, upp = self._ppf(0.001, *args), self._ppf(0.999, *args)
low = max(min(-suppnmin, low), lb) low = max(min(-suppnmin, low), lb)
upp = min(max(suppnmin, upp), ub) upp = min(max(suppnmin, upp), ub)
@ -8384,8 +8384,11 @@ def test_truncrayleigh():
#Compare ML and MPS method #Compare ML and MPS method
phat = truncrayleigh.fit2(R, method='ml'); phat = truncrayleigh.fit2(R, method='ml');
def test_docstrings():
def test_doctstrings(): import doctest
doctest.testmod()
def test_script():
import matplotlib import matplotlib
matplotlib.interactive(True) matplotlib.interactive(True)
R = norm.rvs(size=100) R = norm.rvs(size=100)

@ -4,7 +4,7 @@ Created on 19. juli 2010
@author: pab @author: pab
''' '''
from wafo.spectrum.dispersion_relation import w2k,k2w #@UnusedImport from wafo.wave_theory.dispersion_relation import w2k,k2w #@UnusedImport
def test_k2w(): def test_k2w():
''' '''
Loading…
Cancel
Save