Mercurial > pylearn
diff test_dataset.py @ 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 | b4159cbdc06b 4b0859606d05 |
line wrap: on
line diff
--- 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()