changeset 103:a90d85fef3d4

clean up and a few more test
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 06 May 2008 16:07:39 -0400
parents 4537ac630348
children e1a004b21daa
files test_dataset.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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