def test_connected_count_matrix(self): """Directed""" is_c = is_connected(self.T_not_connected) self.assertFalse(is_c) is_c = is_connected(self.T_connected) self.assertTrue(is_c) """Undirected""" is_c = is_connected(self.T_not_connected, directed=False) self.assertTrue(is_c)
def _transition_matrix(self, msm): P = msm.transition_matrix # should be ndarray by default assert (isinstance(P, np.ndarray)) # shape assert (np.all(P.shape == (msm.nstates, msm.nstates))) # test transition matrix properties import pyemma.msm.analysis as msmana assert (msmana.is_transition_matrix(P)) assert (msmana.is_connected(P)) # REVERSIBLE if msm.is_reversible: assert (msmana.is_reversible(P))
def test_is_connected(self): self.assertTrue(is_connected(self.T)) self.assertTrue(is_connected(self.T, directed=False))