changeset 349:2174fe5cc7d0

added test for ds.subset()
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 17 Jun 2008 16:09:59 -0400
parents 952129cd55cb
children ae6605eccd09
files _test_dataset.py
diffstat 1 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/_test_dataset.py	Tue Jun 17 14:59:10 2008 -0400
+++ b/_test_dataset.py	Tue Jun 17 16:09:59 2008 -0400
@@ -371,11 +371,11 @@
 #ds[:n] returns a dataset with the n first examples.
     ds2=ds.subset[:3]
     test_ds(ds,ds2,index=[0,1,2])
-#     del ds2
+#    del ds2
 
-# #ds[i1:i2:s]# returns a ds with the examples i1,i1+s,...i2-s.
-#     ds2=ds.subset[1:7:2]
-#     test_ds(ds,ds2,[1,3,5])
+#ds[i1:i2:s]# returns a ds with the examples i1,i1+s,...i2-s.
+    ds2=ds.subset[1:7:2]
+    test_ds(ds,ds2,[1,3,5])
 #     del ds2
 
 # #ds[i]
@@ -385,29 +385,29 @@
 #     assert not have_raised("var['ds']["+str(len(ds)-1)+"]",ds=ds)
 #     del ds2
 
-# #ds[[i1,i2,...in]]# returns a ds with examples i1,i2,...in.
-#     ds2=ds.subset[[4,7,2,8]]
-#     test_ds(ds,ds2,[4,7,2,8])
+#ds[[i1,i2,...in]]# returns a ds with examples i1,i2,...in.
+    ds2=ds.subset[[4,7,2,8]]
+    test_ds(ds,ds2,[4,7,2,8])
 #     del ds2
 
-# #ds.<property># returns the value of a property associated with
-#   #the name <property>. The following properties should be supported:
-#   #    - 'description': a textual description or name for the ds
-#   #    - 'fieldtypes': a list of types (one per field)
+#ds.<property># returns the value of a property associated with
+  #the name <property>. The following properties should be supported:
+  #    - 'description': a textual description or name for the ds
+  #    - 'fieldtypes': a list of types (one per field)
 
-# #* ds1 | ds2 | ds3 == ds.hstack([ds1,ds2,ds3])#????
-#     #assert hstack([ds('x','y'),ds('z')])==ds
-#     #hstack([ds('z','y'),ds('x')])==ds
-#     assert have_raised2(hstack,[ds('x'),ds('x')])
-#     assert have_raised2(hstack,[ds('y','x'),ds('x')])
-#     assert not have_raised2(hstack,[ds('x'),ds('y')])
+#* ds1 | ds2 | ds3 == ds.hstack([ds1,ds2,ds3])#????
+    #assert hstack([ds('x','y'),ds('z')])==ds
+    #hstack([ds('z','y'),ds('x')])==ds
+    assert have_raised2(hstack,[ds('x'),ds('x')])
+    assert have_raised2(hstack,[ds('y','x'),ds('x')])
+    assert not have_raised2(hstack,[ds('x'),ds('y')])
     
-# #        i=0
-# #        for example in hstack([ds('x'),ds('y'),ds('z')]):
-# #            example==ds[i]
-# #            i+=1 
-# #        del i,example
-# #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])#????
+#        i=0
+#        for example in hstack([ds('x'),ds('y'),ds('z')]):
+#            example==ds[i]
+#            i+=1 
+#        del i,example
+#* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])#????
 
 def test_fields_fct(ds):
     #@todo, fill correctly