changeset 250:474be3d12c23

make test_speed generic
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 03 Jun 2008 12:18:22 -0400
parents 9502f100eda5
children 7e6edee187e3
files test_dataset.py
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/test_dataset.py	Tue Jun 03 12:14:03 2008 -0400
+++ b/test_dataset.py	Tue Jun 03 12:18:22 2008 -0400
@@ -493,12 +493,11 @@
     raise NotImplementedError()
 
 
-def test_speed():
-    print "test_speed"
-    import time
-    a2 = numpy.random.rand(100000,400)
-    ds = ArrayDataSet(a2,{'all':slice(0,a2.shape[1],1)})
+def test_speed(array, ds):
+    print "test_speed", ds.__class__
+
     mat = numpy.random.rand(400,100)
+
     @print_timing
     def f_array_full(a):
         a+1
@@ -540,9 +539,9 @@
             exs[0]+1
 #            ex[0]*mat
 
-    f_array_full(a2)
-    f_array_index(a2)
-    f_array_iter(a2)
+    f_array_full(array)
+    f_array_index(array)
+    f_array_iter(array)
 
     f_ds_index(ds)
     f_ds_iter(ds)
@@ -556,7 +555,6 @@
     f_ds_mb2(ds,1000)
     f_ds_mb2(ds,10000)
 
-    del a2, ds
 
 if __name__=='__main__':
     test1()