Skip to content

Commit 7823d90

Browse files
committed
add tests
1 parent 668831f commit 7823d90

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
91.2 KB
Loading
91.2 KB
Loading

tests/pl/test_render_images.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import scanpy as sc
55
import spatialdata_plot # noqa: F401
6+
from matplotlib.colors import Normalize
67
from spatial_image import to_spatial_image
78
from spatialdata import SpatialData
89

@@ -68,6 +69,13 @@ def test_plot_can_render_two_channels_str_from_image(self, sdata_blobs_str: Spat
6869
def test_plot_can_render_two_channels_str_from_multiscale_image(self, sdata_blobs_str: SpatialData):
6970
sdata_blobs_str.pl.render_images(element="blobs_multiscale_image", channel=["c1", "c2"]).pl.show()
7071

72+
def test_plot_can_pass_vmin_vmax(self, sdata_blobs: SpatialData):
73+
sdata_blobs.pl.render_images(element="blobs_image", channel=1, vmin=0, vmax=0.4).pl.show()
74+
75+
def test_plot_can_pass_normalize(self, sdata_blobs: SpatialData):
76+
norm = Normalize(vmin=0, vmax=0.4, clip=True)
77+
sdata_blobs.pl.render_images(element="blobs_image", channel=1, norm=norm).pl.show()
78+
7179
def test_plot_can_pass_color_to_single_channel(self, sdata_blobs: SpatialData):
7280
sdata_blobs.pl.render_images(element="blobs_image", channel=1, palette="red").pl.show()
7381

0 commit comments

Comments
 (0)