def test_multiple_issues_warning(self): if use_assert_warns: with self.assertWarns(UserWarning): tica_nystroem(data=np.random.rand(100, 10), lag=1, max_columns=11, nsel=3, initial_columns=np.random.choice(10, 2, replace=False))
def test_single_issues_warning(self): if use_assert_warns: with self.assertLogs(level='WARNING'): t = tica_nystroem(data=self.data, lag=1, max_columns=12, initial_columns=self.initial_columns) else: t = tica_nystroem(data=self.data, lag=1, max_columns=12, initial_columns=self.initial_columns) self._compare_tica(t)
def test_multiple(self): t = tica_nystroem(data=self.data, lag=1, max_columns=11, nsel=3, initial_columns=self.initial_columns) self._compare_tica(t)
def test(self): t = tica_nystroem(data=self.Z, lag=self.lag, max_columns=10, initial_columns=np.array([91])) np.testing.assert_allclose(t.cov, self.tica_obj.cov[:, t.column_indices]) np.testing.assert_allclose(t.cov_tau, self.tica_obj.cov_tau[:, t.column_indices]) assert np.all( np.abs(self.tica_obj.eigenvalues[:4] - t.eigenvalues[:4]) < 1e-3)
def test_describe(self): # just check there is no exception tica_nystroem(max_columns=2).describe() tica_nystroem(max_columns=2, data=np.random.random((100, 10)))