Skip to content

Commit 54e678e

Browse files
committed
adds test and release note
1 parent 62df27a commit 54e678e

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

docs/release-notes/0.13.5.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
```{rubric} Features
44
```
5+
* Adds support for multi-GPU clustering via Dask to `tl.leiden` and `tl.louvain` {pr}`502` {smaller}`S Dicks`
6+
* Adds support for specifying multiple resolutions as a list in `tl.leiden` and `tl.louvain` {pr}`502` {smaller}`S Dicks`
57

68
```{rubric} Performance
79
```

tests/dask/test_dask_clustering.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ def test_dask_clustering(client, clustering_function):
2424
@pytest.mark.parametrize("resolution", [0.1, [0.5, 1.0]])
2525
def test_dask_clustering_resolution(client, clustering_function, resolution):
2626
adata = pbmc3k_processed()
27-
print(resolution)
2827
clustering_function(
2928
adata, use_dask=True, key_added="test_dask", resolution=resolution
3029
)
31-
print(adata.obs.columns)
3230
if isinstance(resolution, list):
3331
for r in resolution:
3432
assert f"test_dask_{r}" in adata.obs.columns

tests/test_clustering.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def test_clustering_subset(adata_neighbors, key):
4848
clustering(adata_neighbors, key_added=key)
4949

5050
for c in adata_neighbors.obs[key].unique():
51-
print("Analyzing cluster ", c)
5251
cells_in_c = adata_neighbors.obs[key] == c
5352
ncells_in_c = adata_neighbors.obs[key].value_counts().loc[c]
5453
key_sub = str(key) + "_sub"
@@ -71,6 +70,18 @@ def test_clustering_subset(adata_neighbors, key):
7170
assert len(common_cat) == 0
7271

7372

73+
@pytest.mark.parametrize("clustering_function", [rsc.tl.leiden, rsc.tl.louvain])
74+
@pytest.mark.parametrize("resolution", [0.1, [0.5, 1.0]])
75+
def test_clustering_resolution(adata_neighbors, clustering_function, resolution):
76+
adata = adata_neighbors.copy()
77+
clustering_function(adata, key_added="test_clustering", resolution=resolution)
78+
if isinstance(resolution, list):
79+
for r in resolution:
80+
assert f"test_clustering_{r}" in adata.obs.columns
81+
else:
82+
assert "test_clustering" in adata.obs.columns
83+
84+
7485
def test_kmeans_basic(adata_neighbors):
7586
rsc.tl.kmeans(adata_neighbors)
7687
assert adata_neighbors.obs["kmeans"].nunique() == 8

0 commit comments

Comments
 (0)