assert_array_equal(dsflat.samples, target)
// test index creation
d = Dataset(N.ones((2,2,2)))
f = FlattenMapper(inspace="voxel")
f.train(d)
md = f(d)
t = array(([0,0],[0,1],[1,0],[1,1]))
assert_array_equal(t, md.fa.voxel)
After Change
// try dataset mode, with some feature attribute
fattr = N.arange(N.prod(samples_shape)).reshape(samples_shape)
ds = Dataset(data, fa={"awesome": fattr.copy()})
assert_equal(ds.samples.shape, data_shape)
fm.train(ds)
dsflat = fm.forward(ds)
ok_(isinstance(dsflat, Dataset))
ok_(isinstance(dsflat.samples, myarray))
assert_array_equal(dsflat.samples, target)
assert_array_equal(dsflat.fa.awesome, N.arange(N.prod(samples_shape)))
assert_true(isinstance(dsflat.fa["awesome"], ArrayCollectable))
// test index creation
assert_array_equal(index_target, dsflat.fa.voxel)
// and back
revds = fm.reverse(dsflat)
ok_(isinstance(revds, Dataset))
ok_(isinstance(revds.samples, myarray))
assert_array_equal(revds.samples, data)
assert_array_equal(revds.fa.awesome, fattr)