3c1eafeea79d946575ea5b6b5cb02f945897d2fd,mvpa/tests/test_mapper.py,,test_flatten,#,28

Before Change


        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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: PyMVPA/PyMVPA
Commit Name: 3c1eafeea79d946575ea5b6b5cb02f945897d2fd
Time: 2009-12-10
Author: michael.hanke@gmail.com
File Name: mvpa/tests/test_mapper.py
Class Name:
Method Name: test_flatten


Project Name: arviz-devs/arviz
Commit Name: 7ffcd4a2a5213c0a7de9fdc3aff4725c166db986
Time: 2019-01-27
Author: ahartikainen@users.noreply.github.com
File Name: arviz/tests/test_plots.py
Class Name:
Method Name: test_plot_ppc_discrete


Project Name: idaholab/raven
Commit Name: 0ca2ef263f600ee029f208dfca8fef7b8fe5038b
Time: 2020-08-23
Author: mohammad.abdo@inl.gov
File Name: framework/Optimizers/GeneticAlgorithm.py
Class Name: GeneticAlgorithm
Method Name: _useRealization