Skip to content

Commit 872bf02

Browse files
author
Sonja Stockhaus
committed
add test + changelog
1 parent efd7487 commit 872bf02

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning][].
2121
- Legend order is now deterministic (#143)
2222
- Images no longer normalised by default (#150)
2323
- Colorbar no longer autoscales to [0, 1] (#155)
24+
- Plotting shapes after a spatial query is now possible (#163)
2425

2526
## [0.0.4] - 2023-08-11
2627

Loading

tests/pl/test_render_shapes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,17 @@ def test_plot_colorbar_respects_input_limits(self, sdata_blobs: SpatialData):
108108
def test_plot_colorbar_can_be_normalised(self, sdata_blobs: SpatialData):
109109
sdata_blobs.shapes["blobs_polygons"]["cluster"] = [1, 2, 3, 5, 20]
110110
sdata_blobs.pl.render_shapes("blobs_polygons", color="cluster", groups=["c1"], norm=True).pl.show()
111+
112+
def test_plot_can_plot_shapes_after_spatial_query(self, sdata_blobs: SpatialData):
113+
# subset to only shapes, should be unnecessary after rasterizeation of multiscale images is included
114+
blob = SpatialData.from_elements_dict(
115+
{
116+
"blobs_circles": sdata_blobs.shapes["blobs_circles"],
117+
"blobs_multipolygons": sdata_blobs.shapes["blobs_multipolygons"],
118+
"blobs_polygons": sdata_blobs.shapes["blobs_polygons"],
119+
}
120+
)
121+
cropped_blob = blob.query.bounding_box(
122+
axes=["x", "y"], min_coordinate=[100, 100], max_coordinate=[300, 300], target_coordinate_system="global"
123+
)
124+
cropped_blob.pl.render_shapes().pl.show()

0 commit comments

Comments
 (0)