Commit 480eb5a
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- src/spatialdata_plot/pl
5 files changed
+125
-112
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
598 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
599 | 600 | | |
600 | 601 | | |
601 | 602 | | |
| |||
0 commit comments