Skip to content

Commit 059e16e

Browse files
author
Andrew Ramirez
committed
Update Test
1 parent b098dc1 commit 059e16e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

RISE/tests/test_parafac2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ def test_factor_thomson_reprod():
1515
X = import_thomson()
1616
X.obs["condition_unique_idxs"] = pd.Categorical(X.obs["condition_unique_idxs"])
1717

18-
X = pf2(X, 10, doEmbedding=False)
18+
X = pf2(X, 10, doEmbedding=False, tolerance=1e-6)
1919
C_first = np.array(X.varm["Pf2_C"], copy=True)
2020

21-
X = pf2(X, 10, doEmbedding=False)
22-
np.testing.assert_allclose(np.array(X.varm["Pf2_C"]), C_first, atol=1e-5, rtol=1e-5)
23-
21+
# Reload data to ensure clean state for second factorization
22+
XX = import_thomson()
23+
XX.obs["condition_unique_idxs"] = pd.Categorical(XX.obs["condition_unique_idxs"])
24+
XX = pf2(XX, 10, doEmbedding=False, tolerance=1e-6)
25+
np.testing.assert_allclose(np.array(XX.varm["Pf2_C"]), C_first, atol=1e-5, rtol=1e-5)
2426

2527
def test_factor_thomson_R2X():
2628
"""Import and factor Thomson.

0 commit comments

Comments
 (0)