Package mvpa :: Package tests :: Module test_datasetng
[hide private]
[frames] | no frames]

Source Code for Module mvpa.tests.test_datasetng

 1  '''Tests for the dataset implementation''' 
 2  import numpy as N 
 3   
 4  from numpy.testing import assert_array_equal 
 5  from nose.tools import ok_ 
 6   
 7  from mvpa.datasets.base import _Dataset as Dataset 
 8   
 9   
10 -def test_initSimple():
11 samples = N.arange(12).reshape((4,3)) 12 labels = range(4) 13 chunks = [1, 1, 2, 2] 14 15 ds = Dataset.initSimple(samples, labels, chunks) 16 17 assert_array_equal(ds.samples, samples) 18 ok_(ds.sa.labels == labels) 19 ok_(ds.sa.chunks == chunks) 20 21 # XXX but why is this puking, or rather do we want to keep cluttering the 22 # interface like this -- I'd prefer having it all inside the collection. 23 ok_(ds.labels == labels) 24 ok_(ds.chunks == chunks) 25 26 ok_(sorted(ds.sa.names) == ['chunks', 'labels'])
27