# HG changeset patch # User Frederic Bastien # Date 1212783347 14400 # Node ID f7924e13e4261c9b897207b469e3e51ce1bff14f # Parent 4bfdda107a1755373091046006c22fadebbeb2d7# Parent 3af204aa71e58d3714290d9f5d93a20217ca5af9 Automated merge with ssh://projects@lgcm.iro.umontreal.ca/hg/pylearn diff -r 4bfdda107a17 -r f7924e13e426 _test_dataset.py --- a/_test_dataset.py Fri Jun 06 16:13:17 2008 -0400 +++ b/_test_dataset.py Fri Jun 06 16:15:47 2008 -0400 @@ -1,7 +1,7 @@ #!/bin/env python from dataset import * from math import * -import numpy,unittest +import numpy, unittest, sys from misc import * def have_raised(to_eval, **var): @@ -430,7 +430,13 @@ del a,ds1,ds2,ds3 def test_FieldsSubsetDataSet(self): - raise NotImplementedError() + a = numpy.random.rand(10,4) + ds = ArrayDataSet(a,LookupList(['x','y','z','w'],[slice(3),3,[0,2],0])) + ds = FieldsSubsetDataSet(ds,['x','y','z']) + + test_all(a,ds) + + del a, ds def test_MinibatchDataSet(self): raise NotImplementedError() def test_HStackedDataSet(self): @@ -442,5 +448,14 @@ if __name__=='__main__': - unittest.main() + if len(sys.argv)==2: + if sys.argv[1]=="--debug": + module = __import__("_test_dataset") + tests = unittest.TestLoader().loadTestsFromModule(module) + tests.debug() + print "bad argument: only --debug is accepted" + elif len(sys.argv)==1: + unittest.main() + else: + print "bad argument: only --debug is accepted"