# HG changeset patch # User Olivier Delalleau # Date 1243440498 14400 # Node ID 71a052a92b054fb9da507f323aa98749fca03df5 # Parent d57df00f12b06bbb79de5ffca920de2607c7fa3e Made test_speed faster when run by nosetests diff -r d57df00f12b0 -r 71a052a92b05 pylearn/sandbox/test_speed.py --- a/pylearn/sandbox/test_speed.py Wed May 27 11:48:05 2009 -0400 +++ b/pylearn/sandbox/test_speed.py Wed May 27 12:08:18 2009 -0400 @@ -63,10 +63,16 @@ f_ds_mb1(ds,1000) f_ds_mb1(ds,10000) -def test_speed(): +# Subset of tests when run by nosetests. +def run_test(): a2 = numpy.random.rand(100000,400) ds1 = ArrayDataSet(a2,{'all':slice(0,a2.shape[1],1)}) - run(a2,ds1) + run(a2, ds1) + return a2, ds1 + +# Full set of tests when run from command line. +def run_full(): + a2, ds1 = run_test() a1 = numpy.random.rand(100000,40) ds4 = ArrayDataSet(a1,LookupList(["f"+str(x)for x in range(a1.shape[1])], range(a1.shape[1]))) @@ -79,4 +85,5 @@ del a2,ds1,ds3 if __name__=='__main__': - test_speed() + run_full() +