def test_ntimescales_1(): # see issue #603 trajs = [np.random.randint(0, 30, size=500) for _ in range(5)] pccap = PCCAPlus(n_macrostates=11).fit(trajs) lumped_trajs = pccap.transform(trajs) assert len(np.unique(lumped_trajs)) == 11
def test_ntimescales_1(): # see issue #603 trajs = [random.randint(0, 100, size=500) for _ in range(15)] pccap = PCCAPlus(n_macrostates=11).fit(trajs) lumped_trajs = pccap.transform(trajs) observed_macros = len(np.unique(lumped_trajs)) assert observed_macros == 11, observed_macros
def test_pcca_plus_1(): assignments, ref_macrostate_assignments = _metastable_system() pipeline = Pipeline([('msm', MarkovStateModel()), ('pcca+', PCCAPlus(2))]) macro_assignments = pipeline.fit_transform(assignments)[0] # we need to consider any permutation of the state labels when we # test for equality. Since it's only a 2-state that's simple using # the logical_not to flip the assignments. assert (np.all(macro_assignments == ref_macrostate_assignments) or np.all( macro_assignments == np.logical_not(ref_macrostate_assignments)))