# HG changeset patch # User Frederic Bastien # Date 1210104459 14400 # Node ID a90d85fef3d43596b49dc40fa648be1366332e93 # Parent 4537ac6303483aedf3c34a5178b7d0b799096169 clean up and a few more test diff -r 4537ac630348 -r a90d85fef3d4 test_dataset.py --- a/test_dataset.py Tue May 06 16:03:17 2008 -0400 +++ b/test_dataset.py Tue May 06 16:07:39 2008 -0400 @@ -197,7 +197,7 @@ del x,y,i,id i=0 - m=ds.minibatches(['x','y'],n_batches=10,minibatch_size=3,offset=4) # bugged??? + m=ds.minibatches(['x','y'],n_batches=20,minibatch_size=3,offset=4) for x,y in m: assert len(x)==3 assert len(y)==3 @@ -256,9 +256,10 @@ pass assert have_raised("ds['h']") # h is not defined... - assert have_raised("ds["+str(len(ds))+"]") # h is not defined... - assert have_raised("ds["+str(len(ds))+"]") # h is not defined... - assert have_raised("ds[['h']]") # h is not defined... + assert have_raised("ds[['x']]") # h is not defined... + assert not have_raised("ds['x']") + assert have_raised("ds["+str(len(ds))+"]") # index not defined + assert not have_raised("ds["+str(len(ds)-1)+"]") #ds[:n] returns a dataset with the n first examples. ds2=ds[:3] @@ -278,7 +279,6 @@ ds2=ds[[4,7,2,8]] assert isinstance(ds2,DataSet) test_ds(ds,ds2,[4,7,2,8]) - #ds[i1,i2,...]# should we accept????no syntax of numpy.array #ds[fieldname]# an iterable over the values of the field fieldname across #the ds (the iterable is obtained by default by calling valuesVStack