Skip to content

Commit 44abfbd

Browse files
committed
test: relax pynndescent correlation threshold to 0.95
Linux x86 produces ~0.97 correlation while macOS ARM produces ~0.99. Use 0.95 threshold to accommodate platform-dependent SIMD differences while still validating the matrices are structurally similar.
1 parent 501190b commit 44abfbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/model/test_self_mapping.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ def test_connectivities_from_distances(self, adata_pbmc3k, transformer, remove_l
109109
assert (nbhs.connectivities - conn_cmap).nnz == 0, "Connectivity matrices should be identical"
110110
else:
111111
# For approximate methods, check correlation instead of exact equality
112-
# Both matrices should have similar structure and values
112+
# pynndescent uses SIMD and produces different results on different platforms
113+
# (macOS ARM ~0.99, Linux x86 ~0.97), so we use a relaxed threshold
113114
sc_dense = nbhs.connectivities.toarray().flatten()
114115
cm_dense = conn_cmap.toarray().flatten()
115116
correlation = np.corrcoef(sc_dense, cm_dense)[0, 1]
116-
assert correlation > 0.99, f"Connectivity matrices should be highly correlated, got {correlation:.4f}"
117+
assert correlation > 0.95, f"Connectivity matrices should be highly correlated, got {correlation:.4f}"
117118

118119
# Validate matrix properties
119120
assert (conn_cmap - conn_cmap.T).nnz == 0, "CellMapper connectivity matrix should be symmetric"

0 commit comments

Comments
 (0)