Skip to content

Commit 480eb5a

Browse files
timtreisclaude
andcommitted
Fix docstrings and remove dead code across public API
Systematic audit of all public method docstrings against their implementations, fixing mismatches and removing dead/broken code. Docstring fixes: - Fix `norm` type/default in render_shapes, render_points (was `bool | Normalize, default False`, now `Normalize | None`) - Fix `palette` type across all render methods (add `dict[str, str]`) - Remove false claim that palette defaults to lightgray when groups given - Fix `cmap` description: continuous only, not discrete (render_shapes, render_points) - Fix `scale` description in render_shapes: applies to polygons too - Fix `method` description: "or" not "and", add >10k threshold - Fix `show()` return type: `Axes | list[Axes] | None`, not `sd.SpatialData` - Document all 13 missing `show()` parameters - Fix `render_labels` return type (was `None`) - Fix `render_points` return saying "shapes" (copy-paste) - Fix `render_labels` broadcasting example referencing render_images - Add Notes section to render_images: RGB auto-detection, compositing, cmap broadcast - Add type annotations to colorbar/colorbar_params across all methods - Fix `make_palette_from_data` color column lookup description - Fix OutlineParams docstring (was "Cmap params") - Fix typo "precendence" → "precedence" Dead code removal: - Remove `share_extent` from `show()` (accepted but never used) - Remove `na_color` from `render_images()` (no use case for images) - Remove `**kwargs` from `render_images()` (broken: crashed or was silently dropped) - Remove dead `transfunc` from `LabelsRenderParams` (stored but never read) - Remove vestigial `LabelsRenderParams.outline` field - Remove vestigial `ShapesRenderParams.contour_px` field New behavior: - Warn when user requests `colorbar=True` for 5+ channel images Related: #463, #582 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7817c38 commit 480eb5a

File tree

5 files changed

+125
-112
lines changed

5 files changed

+125
-112
lines changed

src/spatialdata_plot/pl/_palette.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,9 @@ def make_palette_from_data(
594594
element
595595
Name of a shapes or points element in *sdata*.
596596
color
597-
Column name containing categorical labels (in the element itself
598-
for points, or in the linked table for shapes/labels).
597+
Column name containing categorical labels. The column is first
598+
looked up directly on the element (both for shapes and points);
599+
if not found there, it falls back to the linked AnnData table.
599600
palette
600601
Source colours. Accepts the same values as
601602
:func:`make_palette` (*None*, a list, a named palette, or a

0 commit comments

Comments
 (0)