@@ -1095,33 +1095,21 @@ def test_datashader_outline_width_uses_points_units(sdata_blobs: SpatialData):
10951095 ).pl .show ()
10961096
10971097
1098- def test_datashader_fill_alpha_not_applied_twice (sdata_blobs : SpatialData ):
1099- """Datashader fill_alpha must not be applied twice (once in shade, once in imshow) .
1098+ def test_datashader_alpha_not_applied_twice (sdata_blobs : SpatialData ):
1099+ """Datashader fill_alpha and outline_alpha must not be applied twice.
11001100
11011101 Regression test for https://github.com/scverse/spatialdata-plot/issues/367.
11021102 Before the fix, alpha was passed both to ds.tf.shade(min_alpha=...) and to
1103- ax.imshow(alpha=...), resulting in effective transparency of fill_alpha **2.
1103+ ax.imshow(alpha=...), resulting in effective transparency of alpha **2.
11041104 """
11051105 fig , ax = plt .subplots ()
1106- sdata_blobs .pl .render_shapes (method = "datashader" , fill_alpha = 0.5 , color = "red" ).pl .show (ax = ax )
1107-
1108- axes_images = [c for c in ax .get_children () if isinstance (c , matplotlib .image .AxesImage )]
1109- for img in axes_images :
1110- assert img .get_alpha () is None , (
1111- f"Datashader AxesImage has alpha={ img .get_alpha ()} , which would be applied "
1112- "on top of the alpha already in the RGBA channels — causing double transparency."
1113- )
1114- plt .close (fig )
1115-
1116-
1117- def test_datashader_outline_alpha_not_applied_twice (sdata_blobs : SpatialData ):
1118- """Datashader outline_alpha must not be applied twice.
1119-
1120- Regression test for https://github.com/scverse/spatialdata-plot/issues/367.
1121- The same double-alpha bug affected outline rendering in _render_ds_outlines().
1122- """
1123- fig , ax = plt .subplots ()
1124- sdata_blobs .pl .render_shapes (method = "datashader" , outline_alpha = 0.5 , outline_color = "blue" ).pl .show (ax = ax )
1106+ sdata_blobs .pl .render_shapes (
1107+ method = "datashader" ,
1108+ fill_alpha = 0.5 ,
1109+ color = "red" ,
1110+ outline_alpha = 0.5 ,
1111+ outline_color = "blue" ,
1112+ ).pl .show (ax = ax )
11251113
11261114 axes_images = [c for c in ax .get_children () if isinstance (c , matplotlib .image .AxesImage )]
11271115 for img in axes_images :
0 commit comments