changeset 63:14589f02a372

more test
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Fri, 02 May 2008 10:14:24 -0400
parents 23bf2c9eb7b3
children 863da25a60f1
files test_dataset.py
diffstat 1 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test_dataset.py	Fri May 02 10:14:01 2008 -0400
+++ b/test_dataset.py	Fri May 02 10:14:24 2008 -0400
@@ -66,11 +66,11 @@
 #    print "take a slice and look at field y",ds[1:6:2]["y"]
     have_thrown = False
     try:
-        ds['h']
+        ds['h'] # h is not defined...
     except :
         have_thrown = True
     assert have_thrown == True
-    assert ds == ds.fields().examples()
+    assert len(ds.fields())==3
     for field in ds.fields():
         for field_value in field: # iterate over the values associated to that field for all the ds examples
             pass
@@ -81,5 +81,33 @@
     for field_examples in ds.fields():
         for example_value in field_examples:
             pass
+
+    assert ds == ds.fields().examples()
+
+
+    #test missing value
+
+    assert len(ds[:3])==3
+    for x,z in ds[:3]('x','z'):
+        assert ds[i]['z'].all()==a[i][0:3:2].all()
+
+    #ds[i1:i2:s]# returns a ds with the examples i1,i1+s,...i2-s.
+
+    #ds[i]# returns an Example.
+
+    #ds[[i1,i2,...in]]# returns a ds with examples i1,i2,...in.
+
+    #ds[fieldname]# an iterable over the values of the field fieldname across
+      #the ds (the iterable is obtained by default by calling valuesVStack
+      #over the values for individual examples).
+
+    #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])
+    #* ds1 & ds2 & ds3 == ds.vstack([ds1,ds2,ds3])
+
+
 test_ArrayDataSet()