scanpy icon indicating copy to clipboard operation
scanpy copied to clipboard

tests for sc.pl.diffmap and sc.pl.rank_genes_groups

Open sueoglu opened this issue 4 months ago • 1 comments

Noticed that sc.pl.diffmap and some of the sc.pl.rank_genes_groups plots don’t seem to have tests at the moment. How would you usually approach testing these plotting functions?

sueoglu avatar Sep 05 '25 08:09 sueoglu

We currently pytest.mark.parameterize the tests with a representative set of parameter combinations, then use image comparison to check if the outcome is close enough. There are a lot of examples in the tests!

It’s very flawed though. E.g. the combined difference of some text labels being very slightly shifted might have caused us to set the comparison tolerance a little lower, and as an effect, the presence or absence of some thin lines doesn’t register at all, making the tests succeed despite the plot looking totally different.

flying-sheep avatar Sep 09 '25 09:09 flying-sheep