Skip to content

Commit

Permalink
Enforce stable cluster order in notebook test (scverse#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Sep 4, 2023
1 parent 1efc3a7 commit c87f1d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scanpy/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import sys
from pathlib import Path
Expand Down
5 changes: 5 additions & 0 deletions scanpy/tests/notebooks/test_pbmc3k.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def test_pbmc3k(image_comparer):
# sc.pl.rank_genes_groups_violin(adata, groups='0', n_genes=8)
# save_and_compare_images('rank_genes_groups_4')

if adata[adata.obs['leiden'] == '4', 'CST3'].X.mean() < 1:
( # switch clusters
adata.obs['leiden'][adata.obs['leiden'] == '4'],
adata.obs['leiden'][adata.obs['leiden'] == '5'],
) = ('5', '4')
new_cluster_names = [
'CD4 T cells',
'CD14+ Monocytes',
Expand Down

0 comments on commit c87f1d6

Please sign in to comment.