Exemple #1
0
def test_recursive(model_file):
    """ check the whole chain has been printed"""
    from pyemma.util.contexts import Capturing
    with Capturing() as out:
        main(['--recursive', model_file])
    assert out
    all_out = '\n'.join(out)
    assert_('FeatureReader' in all_out)
    assert_('TICA' in all_out)
    assert_('Kmeans' in all_out)
Exemple #2
0
    def test_with_pg_data_not_in_memory(self):
        import pkg_resources
        import pyemma

        path = pkg_resources.resource_filename('pyemma.coordinates.tests', 'data') + os.path.sep
        pdb_file = os.path.join(path, 'bpti_ca.pdb')
        traj_files = [
            os.path.join(path, 'bpti_001-033.xtc'),
            os.path.join(path, 'bpti_034-066.xtc'),
            os.path.join(path, 'bpti_067-100.xtc')
        ]
        reader = pyemma.coordinates.source(traj_files, top=pdb_file)

        with settings(show_progress_bars=True), Capturing(which='stderr') as out:
            cluster_kmeans(reader)
        self.assertIn('creating data array', '\n'.join(out))
Exemple #3
0
 def test_with_pg(self):
     with settings(show_progress_bars=True), Capturing(
             which='stderr') as output:
         cluster_kmeans(np.random.rand(100, 3))
     self.assertNotIn('creating data array', '\n'.join(output))