From ed1edc8c53a45647f917f6567ab21b5ee9d6566c Mon Sep 17 00:00:00 2001 From: Tim Treis Date: Sat, 15 Nov 2025 13:54:04 +0100 Subject: [PATCH 1/2] made most args keyword only --- src/spatialdata_plot/pl/basic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/spatialdata_plot/pl/basic.py b/src/spatialdata_plot/pl/basic.py index 883f51ce..029168be 100644 --- a/src/spatialdata_plot/pl/basic.py +++ b/src/spatialdata_plot/pl/basic.py @@ -157,6 +157,7 @@ def render_shapes( self, element: str | None = None, color: ColorLike | None = None, + *, fill_alpha: float | int | None = None, groups: list[str] | str | None = None, palette: list[str] | str | None = None, @@ -339,6 +340,7 @@ def render_points( self, element: str | None = None, color: ColorLike | None = None, + *, alpha: float | int | None = None, groups: list[str] | str | None = None, palette: list[str] | str | None = None, @@ -482,6 +484,7 @@ def render_points( def render_images( self, element: str | None = None, + *, channel: list[str] | list[int] | str | int | None = None, cmap: list[Colormap | str] | Colormap | str | None = None, norm: Normalize | None = None, @@ -599,6 +602,7 @@ def render_labels( self, element: str | None = None, color: str | None = None, + *, groups: list[str] | str | None = None, contour_px: int | None = 3, palette: list[str] | str | None = None, @@ -728,6 +732,7 @@ def render_labels( def show( self, coordinate_systems: list[str] | str | None = None, + *, legend_fontsize: int | float | _FontSize | None = None, legend_fontweight: int | _FontWeight = "bold", legend_loc: str | None = "right margin", From 040f90350306578265c7d72de233d06c4c288aec Mon Sep 17 00:00:00 2001 From: Tim Treis Date: Sat, 15 Nov 2025 14:07:12 +0100 Subject: [PATCH 2/2] fixed test --- tests/pl/test_render_labels.py | 2 +- tests/pl/test_render_points.py | 2 +- tests/pl/test_render_shapes.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pl/test_render_labels.py b/tests/pl/test_render_labels.py index 8184de0a..8d96ec96 100644 --- a/tests/pl/test_render_labels.py +++ b/tests/pl/test_render_labels.py @@ -305,7 +305,7 @@ def test_warns_when_table_does_not_annotate_element(sdata_blobs: SpatialData): # Create a table that annotates a DIFFERENT element than the one we will render other_table = sdata_blobs_local["table"].copy() - other_table.obs["region"] = "blobs_multiscale_labels" + other_table.obs["region"] = pd.Categorical(["blobs_multiscale_labels"] * other_table.n_obs) other_table.uns["spatialdata_attrs"]["region"] = "blobs_multiscale_labels" sdata_blobs_local["other_table"] = other_table diff --git a/tests/pl/test_render_points.py b/tests/pl/test_render_points.py index 2a60f4c1..71a6c4e3 100644 --- a/tests/pl/test_render_points.py +++ b/tests/pl/test_render_points.py @@ -473,7 +473,7 @@ def test_warns_when_table_does_not_annotate_element(sdata_blobs: SpatialData): # Create a table that annotates a DIFFERENT element than the one we will render other_table = sdata_blobs_local["table"].copy() - other_table.obs["region"] = "blobs_labels" # Different from blobs_points + other_table.obs["region"] = pd.Categorical(["blobs_labels"] * other_table.n_obs) # Different from blobs_points other_table.uns["spatialdata_attrs"]["region"] = "blobs_labels" sdata_blobs_local["other_table"] = other_table diff --git a/tests/pl/test_render_shapes.py b/tests/pl/test_render_shapes.py index e8b301a1..8fbc5d4c 100644 --- a/tests/pl/test_render_shapes.py +++ b/tests/pl/test_render_shapes.py @@ -670,7 +670,7 @@ def test_warns_when_table_does_not_annotate_element(sdata_blobs: SpatialData): # Create a table that annotates a DIFFERENT element than the one we will render other_table = sdata_blobs_local["table"].copy() - other_table.obs["region"] = "blobs_points" # Different from blobs_circles + other_table.obs["region"] = pd.Categorical(["blobs_points"] * other_table.n_obs) # Different region other_table.uns["spatialdata_attrs"]["region"] = "blobs_points" sdata_blobs_local["other_table"] = other_table