Mercurial > pylearn
diff _test_dataset.py @ 26:672fe4b23032
Fixed dataset errors so that _test_dataset.py works again.
author | bengioy@grenat.iro.umontreal.ca |
---|---|
date | Fri, 11 Apr 2008 11:14:54 -0400 |
parents | b6b36f65664f |
children | 541a273bc89f |
line wrap: on
line diff
--- a/_test_dataset.py Wed Apr 09 18:27:13 2008 -0400 +++ b/_test_dataset.py Fri Apr 11 11:14:54 2008 -0400 @@ -78,6 +78,19 @@ for i, x in enumerate(a.minibatches(["x"], minibatch_size=3, n_batches=6)): self.failUnless(numpy.all( x == arr2[i*3:i*3+3,0:2])) + +class T_renamingdataset(unittest.TestCase): + def setUp(self): + numpy.random.seed(123456) + + + def test_hasfield(self): + n = numpy.random.rand(3,8) + a=ArrayDataSet(data=n,fields={"x":slice(2),"y":slice(1,4),"z":slice(4,6)}) + b=a.rename({'xx':'x','zz':'z'}) + self.failUnless(b.hasFields('xx','zz') and not b.hasFields('x') and not b.hasFields('y')) + + if __name__ == '__main__': unittest.main()