Skip to content

Commit 97679d2

Browse files
committed
fix shared landmarks in DA, update test for correct gp_type="fixed" behavior
test_landmark_reuse_and_storage expected (25, 5) landmarks from a run with n_landmarks=50 on 50 combined cells. That was only passing because mellon's str-vs-enum bug silently ignored gp_type="fixed", causing compute_landmarks to return None. With mellon>=1.7.1 the fix works and correctly returns all 50 cells, so the assertion now expects (50, 5).
1 parent 99e7555 commit 97679d2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/test_anndata_functions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,16 @@ def test_landmark_reuse_and_storage():
572572
anndata_fields3 = from_json_string(adata.uns["kompot_de"]["anndata_fields"])
573573
assert "reuse_landmarks_run" in anndata_fields3.get("uns", {})
574574

575-
# Check if landmarks are stored in the result
575+
# Check if landmarks are stored in the result.
576+
# This run uses n_landmarks=50 on 50 combined cells, so with gp_type="fixed"
577+
# compute_landmarks returns all 50 cells as landmarks.
576578
if (
577579
"reuse_landmarks_run" in adata.uns
578580
and "landmarks" in adata.uns["reuse_landmarks_run"]
579581
):
580582
reused_landmarks = adata.uns["reuse_landmarks_run"]["landmarks"]
581-
assert reused_landmarks.shape == landmarks_shape, (
582-
"Expected reused landmarks to have the same shape"
583+
assert reused_landmarks.shape == (50, 5), (
584+
f"Expected (50, 5) landmarks for n_landmarks=50, got {reused_landmarks.shape}"
583585
)
584586

585587
# Test sequential reuse by keeping one of the landmarks and deleting the other

0 commit comments

Comments
 (0)