[Scipy-svn] r3805 - in branches/testing_cleanup/scipy: . sandbox/lobpcg/tests sandbox/timeseries/lib/tests testing
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue Jan 8 18:50:28 EST 2008
Author: matthew.brett at gmail.com
Date: 2008-01-08 17:50:11 -0600 (Tue, 08 Jan 2008)
New Revision: 3805
Added:
branches/testing_cleanup/scipy/testing/setup.py
Modified:
branches/testing_cleanup/scipy/sandbox/lobpcg/tests/test_lobpcg.py
branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
branches/testing_cleanup/scipy/setup.py
branches/testing_cleanup/scipy/testing/nosetester.py
Log:
Cleaning up sandbox, testing setup.py
Modified: branches/testing_cleanup/scipy/sandbox/lobpcg/tests/test_lobpcg.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/lobpcg/tests/test_lobpcg.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/sandbox/lobpcg/tests/test_lobpcg.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -5,7 +5,7 @@
from pylab import plot, show, legend, xlabel, ylabel
set_printoptions(precision=3,linewidth=90)
-def test1(n):
+def check1(n):
L = 1.0
le=L/n
rho = 7.85e3
@@ -17,7 +17,7 @@
B = mass*(diag(r_[4.*ones(n-1),2])+diag(ones(n-1),1)+diag(ones(n-1),-1))
return A,B
-def test2(n):
+def check2(n):
x = arange(1,n+1)
B = diag(1./x)
y = arange(n-1,0,-1)
@@ -27,22 +27,22 @@
n = 100 # Dimension
-A,B = test1(n) # Fixed-free elastic rod
-A,B = test2(n) # Mikota pair acts as a nice test since the eigenvalues are the squares of the integers n, n=1,2,...
+def test_1and2():
+ A,B = check1(n) # Fixed-free elastic rod
+ A,B = check2(n) # Mikota pair acts as a nice test since the eigenvalues are the squares of the integers n, n=1,2,...
+
+ m = 20
+ V = rand(n,m)
+ X = linalg.orth(V)
+
+ eigs,vecs = lobpcg.lobpcg(X,A,B)
+ eigs = sort(eigs)
+
+ w,v=symeig(A,B)
-m = 20
-V = rand(n,m)
-X = linalg.orth(V)
-
-eigs,vecs = lobpcg.lobpcg(X,A,B)
-eigs = sort(eigs)
-
-w,v=symeig(A,B)
-
-
-plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig')
-plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg')
-legend()
-xlabel(r'Eigenvalue $i$')
-ylabel(r'$\lambda_i$')
-show()
+ plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig')
+ plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg')
+ legend()
+ xlabel(r'Eigenvalue $i$')
+ ylabel(r'$\lambda_i$')
+ show()
Modified: branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -11,20 +11,20 @@
import numpy as N
import numpy.core.numeric as numeric
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
-import maskedarray.testutils
-from maskedarray.testutils import *
+import scipy.sandbox.maskedarray.testutils
+from import scipy.sandbox.maskedarray.testutils import *
import maskedarray.core as coremodule
from maskedarray.core import MaskedArray, masked
from timeseries.lib.interpolate import backward_fill, forward_fill, interp_masked1d
-class TestFuncs(NumpyTestCase):
+class TestFuncs(TestCase):
def __init__(self, *args, **kwds):
- NumpyTestCase.__init__(self, *args, **kwds)
+ TestCase.__init__(self, *args, **kwds)
self.mask = [1,0,1,0,0,1,1,0,0,0]
self.data = numeric.arange(10)
self.test_array = masked_array(self.data, mask=self.mask)
@@ -61,4 +61,4 @@
###############################################################################
#------------------------------------------------------------------------------
if __name__ == "__main__":
- NumpyTest().run()
+ unittest.main()
Modified: branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -13,7 +13,7 @@
import numpy as N
import numpy.core.numeric as numeric
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import NumpyTest, TestCase
import maskedarray.testutils
from maskedarray.testutils import *
@@ -28,10 +28,10 @@
from timeseries.lib import moving_funcs as MF
-class TestCMovAverage(NumpyTestCase):
+class TestCMovAverage(TestCase):
def __init__(self, *args, **kwds):
- NumpyTestCase.__init__(self, *args, **kwds)
+ TestCase.__init__(self, *args, **kwds)
self.data = numeric.arange(25)
self.maskeddata = MaskedArray(self.data)
self.maskeddata[10] = masked
@@ -84,10 +84,10 @@
-class TestMovFuncs(NumpyTestCase):
+class TestMovFuncs(TestCase):
def __init__(self, *args, **kwds):
- NumpyTestCase.__init__(self, *args, **kwds)
+ TestCase.__init__(self, *args, **kwds)
self.data = numeric.arange(25)
self.maskeddata = MaskedArray(self.data)
self.maskeddata[10] = masked
@@ -150,4 +150,4 @@
#------------------------------------------------------------------------------
if __name__ == "__main__":
- NumpyTest().run()
+ unittest.main()
Modified: branches/testing_cleanup/scipy/setup.py
===================================================================
--- branches/testing_cleanup/scipy/setup.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/setup.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -22,6 +22,7 @@
config.add_subpackage('ndimage')
config.add_subpackage('stsci')
config.add_subpackage('weave')
+ config.add_subpackage('testing')
config.make_svn_version_py() # installs __svn_version__.py
config.make_config_py()
return config
Modified: branches/testing_cleanup/scipy/testing/nosetester.py
===================================================================
--- branches/testing_cleanup/scipy/testing/nosetester.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/testing/nosetester.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -49,11 +49,13 @@
''' Module testing function
labels - identifies tests to run. This can be a string to
- pass to the nostests executable with the '-a'
+ pass to the nostests executable with the '-A'
option, or one of several special values.
Special values are:
'fast' - the default - which corresponds to
- nosetests -a option of 'not slow and not bench'.
+ nosetests -A option of 'not slow and not bench'.
+ 'full' - fast (as above) and slow tests as in
+ nosetests -A option of 'not bench'.
None or '' - run all tests and benchmarks
verbose - verbosity value 1-10
@@ -64,6 +66,8 @@
if labels:
if labels == 'fast':
labels = 'not slow and not bench'
+ elif labels == 'full':
+ labels = 'not bench'
argv += ['-A', labels]
argv += ['--verbosity', str(verbose)]
if doctests:
Added: branches/testing_cleanup/scipy/testing/setup.py
===================================================================
--- branches/testing_cleanup/scipy/testing/setup.py 2008-01-08 22:55:53 UTC (rev 3804)
+++ branches/testing_cleanup/scipy/testing/setup.py 2008-01-08 23:50:11 UTC (rev 3805)
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+def configuration(parent_package='',top_path=None):
+ from numpy.distutils.misc_util import Configuration
+ config = Configuration('testing', parent_package, top_path)
+ return config
+
+if __name__ == '__main__':
+ from numpy.distutils.core import setup
+ setup(**configuration(top_path='').todict())
More information about the Scipy-svn
mailing list