Skip to content

Commit d4bf89c

Browse files
timtreisclaude
andcommitted
Add visual tests for transfunc on continuous shapes and labels
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b646004 commit d4bf89c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

tests/pl/test_render_labels.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ def test_plot_can_color_with_norm_no_clipping(self, sdata_blobs: SpatialData):
295295
cmap=_viridis_with_under_over(),
296296
).pl.show()
297297

298+
def test_plot_transfunc_applied_to_continuous_labels(self, sdata_blobs: SpatialData):
299+
sdata_blobs.pl.render_labels("blobs_labels", color="channel_0_sum", transfunc=np.sqrt).pl.show()
300+
298301
def test_plot_can_annotate_labels_with_table_layer(self, sdata_blobs: SpatialData):
299302
sdata_blobs["table"].layers["normalized"] = get_standard_RNG().random(sdata_blobs["table"].X.shape)
300303
sdata_blobs.pl.render_labels("blobs_labels", color="channel_0_sum", table_layer="normalized").pl.show()

tests/pl/test_render_shapes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,11 @@ def test_plot_can_color_with_norm_no_clipping(self, sdata_blobs_shapes_annotated
732732
element="blobs_polygons", color="value", norm=Normalize(2, 4, clip=False), cmap=_viridis_with_under_over()
733733
).pl.show()
734734

735+
def test_plot_transfunc_applied_to_continuous_shapes(self, sdata_blobs_shapes_annotated: SpatialData):
736+
sdata_blobs_shapes_annotated.pl.render_shapes(
737+
element="blobs_polygons", color="value", transfunc=np.sqrt
738+
).pl.show()
739+
735740
def test_plot_datashader_can_color_with_norm_and_clipping(self, sdata_blobs_shapes_annotated: SpatialData):
736741
sdata_blobs_shapes_annotated.pl.render_shapes(
737742
element="blobs_polygons",

0 commit comments

Comments
 (0)