[Scipy-svn] r3096 - trunk/Lib/sandbox/pyem/tests

scipy-svn@scip... scipy-svn@scip...
Mon Jun 11 05:12:22 CDT 2007


Author: cdavid
Date: 2007-06-11 05:12:10 -0500 (Mon, 11 Jun 2007)
New Revision: 3096

Modified:
   trunk/Lib/sandbox/pyem/tests/test_densities.py
   trunk/Lib/sandbox/pyem/tests/test_gmm_em.py
Log:
Convert check calls to test calls in tests, for future convertion to setuptools

Modified: trunk/Lib/sandbox/pyem/tests/test_densities.py
===================================================================
--- trunk/Lib/sandbox/pyem/tests/test_densities.py	2007-06-11 09:32:17 UTC (rev 3095)
+++ trunk/Lib/sandbox/pyem/tests/test_densities.py	2007-06-11 10:12:10 UTC (rev 3096)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-# Last Change: Sat Jun 09 02:00 PM 2007 J
+# Last Change: Mon Jun 11 06:00 PM 2007 J
 
 # TODO:
 #   - having "fake tests" to check that all mode (scalar, diag and full) are
@@ -68,24 +68,24 @@
             0.00000253261067, 0.00000001526368])
 
 class test_py_implementation(TestDensities):
-    def _check(self, level, decimal = DEF_DEC):
+    def _test(self, level, decimal = DEF_DEC):
         Y   = gauss_den(self.X, self.mu, self.va)
         assert_array_almost_equal(Y, self.Yt, decimal)
 
-    def check_2d_diag(self, level = 0):
+    def test_2d_diag(self, level = 0):
         self._generate_test_data_2d_diag()
-        self._check(level)
+        self._test(level)
 
-    def check_2d_full(self, level = 0):
+    def test_2d_full(self, level = 0):
         self._generate_test_data_2d_full()
-        self._check(level)
+        self._test(level)
     
-    def check_py_1d(self, level = 0):
+    def test_py_1d(self, level = 0):
         self._generate_test_data_1d()
-        self._check(level)
+        self._test(level)
 
 class test_c_implementation(TestDensities):
-    def _check(self, level, decimal = DEF_DEC):
+    def _test(self, level, decimal = DEF_DEC):
         try:
             from pyem._c_densities import gauss_den as c_gauss_den
             Y   = c_gauss_den(self.X, self.mu, self.va)
@@ -94,17 +94,17 @@
             print "Error while importing C implementation, not tested"
             print " -> (Import error was %s)" % inst 
 
-    def check_1d(self, level = 0):
+    def test_1d(self, level = 0):
         self._generate_test_data_1d()
-        self._check(level)
+        self._test(level)
 
-    def check_2d_diag(self, level = 0):
+    def test_2d_diag(self, level = 0):
         self._generate_test_data_2d_diag()
-        self._check(level)
+        self._test(level)
 
-    def check_2d_full(self, level = 0):
+    def test_2d_full(self, level = 0):
         self._generate_test_data_2d_full()
-        self._check(level)
+        self._test(level)
 
 class test_gauss_ell(NumpyTestCase):
     def test_dim(self):

Modified: trunk/Lib/sandbox/pyem/tests/test_gmm_em.py
===================================================================
--- trunk/Lib/sandbox/pyem/tests/test_gmm_em.py	2007-06-11 09:32:17 UTC (rev 3095)
+++ trunk/Lib/sandbox/pyem/tests/test_gmm_em.py	2007-06-11 10:12:10 UTC (rev 3096)
@@ -43,7 +43,7 @@
 class test_full_run(EmTest):
     """This class only tests whether the algorithms runs. Do not check the
     results."""
-    def check_1d(self, level = 1):
+    def test_1d(self, level = 1):
         d       = 1
         k       = 2
         mode    = 'full'
@@ -52,7 +52,7 @@
         #seed(1)
         self._create_model_and_run_em(d, k, mode, nframes)
 
-    def check_2d(self, level = 1):
+    def test_2d(self, level = 1):
         d       = 2
         k       = 2
         mode    = 'full'
@@ -61,7 +61,7 @@
         #seed(1)
         self._create_model_and_run_em(d, k, mode, nframes)
 
-    def check_5d(self, level = 1):
+    def test_5d(self, level = 1):
         d       = 5
         k       = 3
         mode    = 'full'
@@ -71,9 +71,9 @@
         self._create_model_and_run_em(d, k, mode, nframes)
 
 class test_diag_run(EmTest):
-    """This class only tests whether the algorithms runs. Do not check the
+    """This class only tests whether the algorithms runs. Do not test the
     results."""
-    def check_1d(self, level = 1):
+    def test_1d(self, level = 1):
         d       = 1
         k       = 2
         mode    = 'diag'
@@ -82,7 +82,7 @@
         #seed(1)
         self._create_model_and_run_em(d, k, mode, nframes)
 
-    def check_2d(self, level = 1):
+    def test_2d(self, level = 1):
         d       = 2
         k       = 2
         mode    = 'diag'
@@ -91,7 +91,7 @@
         #seed(1)
         self._create_model_and_run_em(d, k, mode, nframes)
 
-    def check_5d(self, level = 1):
+    def test_5d(self, level = 1):
         d       = 5
         k       = 3
         mode    = 'diag'
@@ -103,11 +103,11 @@
 class test_datasets(EmTest):
     """This class tests whether the EM algorithms works using pre-computed
     datasets."""
-    def check_1d_full(self, level = 1):
+    def test_1d_full(self, level = 1):
         d = 1
         k = 4
         mode = 'full'
-        # Data are exactly the same than in diagonal mode, just check that
+        # Data are exactly the same than in diagonal mode, just test that
         # calling full mode works even in 1d, even if it is kind of stupid to
         # do so
         dic = load_dataset('diag_1d_4k.mat')
@@ -120,7 +120,7 @@
         assert_array_equal(gmm.gm.mu, dic['mu'])
         assert_array_equal(gmm.gm.va, dic['va'])
 
-    def check_1d_diag(self, level = 1):
+    def test_1d_diag(self, level = 1):
         d = 1
         k = 4
         mode = 'diag'
@@ -134,7 +134,7 @@
         assert_array_equal(gmm.gm.mu, dic['mu'])
         assert_array_equal(gmm.gm.va, dic['va'])
 
-    def check_2d_full(self, level = 1):
+    def test_2d_full(self, level = 1):
         d = 2
         k = 3
         mode = 'full'
@@ -148,7 +148,7 @@
         assert_array_equal(gmm.gm.mu, dic['mu'])
         assert_array_equal(gmm.gm.va, dic['va'])
 
-    def check_2d_diag(self, level = 1):
+    def test_2d_diag(self, level = 1):
         d = 2
         k = 3
         mode = 'diag'



More information about the Scipy-svn mailing list