コード例 #1
0
ファイル: test_tica.py プロジェクト: yuxuanzhuang/PyEMMA
 def test_duplicated_data_in_fit_transform(self):
     X = np.random.randn(100, 2)
     d = DataInMemory([X, X])
     tica = api.tica(data=d, lag=1, dim=1)
     out1 = tica.get_output()
     out2 = tica.fit_transform([X, X])
     np.testing.assert_array_almost_equal(out1, out2)
コード例 #2
0
        def perform(chunksize, stride):
            try:
                transformed_output = tica.get_output(chunk=chunksize, stride=stride)
                tica.write_to_hdf5(out, group=group, chunksize=chunksize, stride=stride)

                import h5py
                with h5py.File(out) as f:
                    assert len(f[group]) == len(data)
                    for (itraj, actual), desired in zip(f[group].items(), transformed_output):
                        np.testing.assert_equal(actual, desired, err_msg='failed for cs=%s, stride=%s'
                                                                         %(chunksize, stride))
            finally:
                os.remove(out)