Mercurial > pylearn
comparison _test_dataset.py @ 294:f7924e13e426
Automated merge with ssh://projects@lgcm.iro.umontreal.ca/hg/pylearn
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Fri, 06 Jun 2008 16:15:47 -0400 |
parents | 4bfdda107a17 3af204aa71e5 |
children | 7380376816e5 |
comparison
equal
deleted
inserted
replaced
293:4bfdda107a17 | 294:f7924e13e426 |
---|---|
1 #!/bin/env python | 1 #!/bin/env python |
2 from dataset import * | 2 from dataset import * |
3 from math import * | 3 from math import * |
4 import numpy,unittest | 4 import numpy, unittest, sys |
5 from misc import * | 5 from misc import * |
6 | 6 |
7 def have_raised(to_eval, **var): | 7 def have_raised(to_eval, **var): |
8 have_thrown = False | 8 have_thrown = False |
9 try: | 9 try: |
428 test_all(a2,ds3) | 428 test_all(a2,ds3) |
429 | 429 |
430 del a,ds1,ds2,ds3 | 430 del a,ds1,ds2,ds3 |
431 | 431 |
432 def test_FieldsSubsetDataSet(self): | 432 def test_FieldsSubsetDataSet(self): |
433 raise NotImplementedError() | 433 a = numpy.random.rand(10,4) |
434 ds = ArrayDataSet(a,LookupList(['x','y','z','w'],[slice(3),3,[0,2],0])) | |
435 ds = FieldsSubsetDataSet(ds,['x','y','z']) | |
436 | |
437 test_all(a,ds) | |
438 | |
439 del a, ds | |
434 def test_MinibatchDataSet(self): | 440 def test_MinibatchDataSet(self): |
435 raise NotImplementedError() | 441 raise NotImplementedError() |
436 def test_HStackedDataSet(self): | 442 def test_HStackedDataSet(self): |
437 raise NotImplementedError() | 443 raise NotImplementedError() |
438 def test_VStackedDataSet(self): | 444 def test_VStackedDataSet(self): |
440 def test_ArrayFieldsDataSet(self): | 446 def test_ArrayFieldsDataSet(self): |
441 raise NotImplementedError() | 447 raise NotImplementedError() |
442 | 448 |
443 | 449 |
444 if __name__=='__main__': | 450 if __name__=='__main__': |
445 unittest.main() | 451 if len(sys.argv)==2: |
446 | 452 if sys.argv[1]=="--debug": |
453 module = __import__("_test_dataset") | |
454 tests = unittest.TestLoader().loadTestsFromModule(module) | |
455 tests.debug() | |
456 print "bad argument: only --debug is accepted" | |
457 elif len(sys.argv)==1: | |
458 unittest.main() | |
459 else: | |
460 print "bad argument: only --debug is accepted" | |
461 |