# HG changeset patch # User Frederic Bastien # Date 1212509902 14400 # Node ID 474be3d12c23ae99e464596c82e11d2ad0cd6304 # Parent 9502f100eda50dc624f1636415ff4c148233a6e8 make test_speed generic diff -r 9502f100eda5 -r 474be3d12c23 test_dataset.py --- 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()