changeset 66:dde1fb1b63ba

fixed test and removed print
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Fri, 02 May 2008 11:24:17 -0400
parents d48eba49a2f4
children 5b699b31770a 427e02ef0629
files dataset.py test_dataset.py
diffstat 2 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Fri May 02 11:10:20 2008 -0400
+++ b/dataset.py	Fri May 02 11:24:17 2008 -0400
@@ -553,7 +553,7 @@
             dataset = FieldsSubsetDataSet(dataset,fieldnames)
         assert dataset.hasFields(*fieldnames)
         self.dataset=dataset
-        print type(dataset)
+
         if isinstance(dataset,MinibatchDataSet):
             LookupList.__init__(self,fieldnames,list(dataset._fields))
         elif isinstance(original_dataset,MinibatchDataSet):
--- a/test_dataset.py	Fri May 02 11:10:20 2008 -0400
+++ b/test_dataset.py	Fri May 02 11:24:17 2008 -0400
@@ -23,13 +23,6 @@
         print "var=",var
     print "take a slice and look at field y",ds[1:6:2]["y"]
 
-def test2():
-    a = numpy.random.rand(10,4)
-    print a
-    ds = ArrayDataSet(a,{'x':slice(3),'y':3,'z':[0,2]})
-    for x,z in ds[:3]('x','z'):
-        assert ds[i]['z'].all()==a[i][0:3:2].all()
-    
 def test_ArrayDataSet():
     #don't test stream
     #tested only with float value
@@ -95,9 +88,10 @@
     #test missing value
 
     assert len(ds[:3])==3
+    i=0
     for x,z in ds[:3]('x','z'):
         assert ds[i]['z'].all()==a[i][0:3:2].all()
-
+        i+=1
     #ds[i1:i2:s]# returns a ds with the examples i1,i1+s,...i2-s.
 
     #ds[i]# returns an Example.
@@ -116,7 +110,5 @@
     #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])
 
 
-#test2()
-
 test_ArrayDataSet()