[Scipy-svn] r4782 - branches/spatial/scipy/spatial/tests

scipy-svn@scip... scipy-svn@scip...
Sun Oct 5 09:11:41 CDT 2008


Author: peridot
Date: 2008-10-05 09:11:35 -0500 (Sun, 05 Oct 2008)
New Revision: 4782

Modified:
   branches/spatial/scipy/spatial/tests/test_kdtree.py
Log:
Cut down size of test cases (run time 30s -> 3s)


Modified: branches/spatial/scipy/spatial/tests/test_kdtree.py
===================================================================
--- branches/spatial/scipy/spatial/tests/test_kdtree.py	2008-10-05 09:36:46 UTC (rev 4781)
+++ branches/spatial/scipy/spatial/tests/test_kdtree.py	2008-10-05 14:11:35 UTC (rev 4782)
@@ -75,10 +75,10 @@
     
 class test_random(ConsistencyTests):
     def setUp(self):
-        self.n = 1000
+        self.n = 100
         self.k = 4
         self.data = np.random.randn(self.n, self.k)
-        self.kdtree = KDTree(self.data)
+        self.kdtree = KDTree(self.data,leafsize=2)
         self.x = np.random.randn(self.k)
         self.d = 0.2
         self.m = 10
@@ -192,10 +192,10 @@
 class test_random_ball(ball_consistency):
 
     def setUp(self):
-        n = 1000
+        n = 100
         k = 4
         self.data = np.random.randn(n,k)
-        self.T = KDTree(self.data)
+        self.T = KDTree(self.data,leafsize=2)
         self.x = np.random.randn(k)
         self.p = 2.
         self.eps = 0
@@ -252,7 +252,7 @@
 class test_two_random_trees(two_trees_consistency):
 
     def setUp(self):
-        n = 100
+        n = 50
         k = 4
         self.data1 = np.random.randn(n,k)
         self.T1 = KDTree(self.data1,leafsize=2)
@@ -315,8 +315,8 @@
 class test_count_neighbors:
 
     def setUp(self):
-        n = 100
-        k = 4
+        n = 50
+        k = 2
         self.T1 = KDTree(np.random.randn(n,k),leafsize=2)
         self.T2 = KDTree(np.random.randn(n,k),leafsize=2)
         
@@ -331,7 +331,7 @@
                 np.sum([len(l) for l in self.T1.query_ball_tree(self.T2,r)]))
 
     def test_multiple_radius(self):
-        rs = np.exp(np.linspace(np.log(0.01),np.log(10),10))
+        rs = np.exp(np.linspace(np.log(0.01),np.log(10),3))
         results = self.T1.count_neighbors(self.T2, rs)
         assert np.all(np.diff(results)>=0)
         for r,result in zip(rs, results):
@@ -339,7 +339,7 @@
 
 class test_sparse_distance_matrix:
     def setUp(self):
-        n = 100
+        n = 50
         k = 4
         self.T1 = KDTree(np.random.randn(n,k),leafsize=2)
         self.T2 = KDTree(np.random.randn(n,k),leafsize=2)



More information about the Scipy-svn mailing list