Skip to content

Commit 260c2cc

Browse files
committed
Include soem more tests for joint pca computation
1 parent 66d82fe commit 260c2cc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_cellmapper.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,23 @@ def test_evaluate_expression_transfer_layers_and_methods(self, cmap, eval_layer,
4646
metrics = cmap.expression_transfer_metrics
4747
assert metrics["method"] == method
4848
assert metrics["n_valid_genes"] > 0
49+
50+
@pytest.mark.parametrize(
51+
"joint_pca_key,n_pca_components,pca_kwargs",
52+
[
53+
("pca_joint", 10, {}),
54+
("custom_pca", 5, {"svd_solver": "arpack"}),
55+
],
56+
)
57+
def test_compute_neighbors_joint_pca(self, cmap, joint_pca_key, n_pca_components, pca_kwargs):
58+
cmap.compute_neighbors(
59+
n_neighbors=3,
60+
use_rep=None,
61+
joint_pca_key=joint_pca_key,
62+
n_pca_components=n_pca_components,
63+
pca_kwargs=pca_kwargs,
64+
)
65+
assert joint_pca_key in cmap.ref.obsm
66+
assert joint_pca_key in cmap.query.obsm
67+
assert cmap.ref.obsm[joint_pca_key].shape[1] == n_pca_components
68+
assert cmap.query.obsm[joint_pca_key].shape[1] == n_pca_components

0 commit comments

Comments
 (0)