Skip to content

Commit cfa71f1

Browse files
committed
test: regenerate datashader baselines for faithful color + as_points radius
Continuous datashader points now use the "max" reduction (full colormap range instead of sum-darkened), and uniform-circle as_points dots are sized to the true radius on the datashader backend. Regenerate the six affected continuous point baselines and the shapes as_points datashader baseline; clarify the as_points test docstrings (matplotlib stays size-based, an expected backend difference).
1 parent 4218dc0 commit cfa71f1

8 files changed

Lines changed: 5 additions & 4 deletions
-2.17 KB
Loading
-761 Bytes
Loading
-356 Bytes
Loading
-2.13 KB
Loading
-2.16 KB
Loading
-741 Bytes
Loading
5.1 KB
Loading

tests/pl/test_render_shapes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,16 +1159,17 @@ def test_plot_can_color_shapes_by_gene_symbols(self, sdata_blobs: SpatialData):
11591159

11601160
@staticmethod
11611161
def _as_points(sdata_blobs: SpatialData, method: str):
1162-
# identical params for both backends; size=120 keeps dots non-overlapping, where the engines agree
1163-
# (they only diverge on overlap: matplotlib stacks markers, datashader aggregates)
1162+
# blobs_circles is uniform-radius: the datashader backend sizes the dots to the true disc radius
1163+
# (so as_points matches the geometry render), while matplotlib uses the marker `size` (scatter
1164+
# markers are display-sized, not data-sized). The two backends therefore differ for circles.
11641165
return sdata_blobs.pl.render_shapes("blobs_circles", as_points=True, method=method, size=120)
11651166

11661167
def test_plot_shapes_as_points_matplotlib(self, sdata_blobs: SpatialData):
1167-
"""as_points draws one dot per shape at its centroid (matplotlib backend)."""
1168+
"""as_points draws one dot per shape at its centroid; matplotlib uses the marker `size`."""
11681169
self._as_points(sdata_blobs, "matplotlib").pl.show()
11691170

11701171
def test_plot_shapes_as_points_datashader(self, sdata_blobs: SpatialData):
1171-
"""Same render via datashader; should look maximally similar to the matplotlib baseline."""
1172+
"""Datashader sizes uniform-circle as_points dots to the true radius, matching the geometry render."""
11721173
self._as_points(sdata_blobs, "datashader").pl.show()
11731174

11741175

0 commit comments

Comments
 (0)