# HG changeset patch # User Frederic Bastien # Date 1209741857 14400 # Node ID dde1fb1b63ba516c2d48768603ab140f63c90049 # Parent d48eba49a2f44bfcb7ef31f504188c15a2ffdfd1 fixed test and removed print diff -r d48eba49a2f4 -r dde1fb1b63ba dataset.py --- 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): diff -r d48eba49a2f4 -r dde1fb1b63ba test_dataset.py --- 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()