Skip to content

Commit 90f8683

Browse files
timtreisclaude
andcommitted
Improve multi-channel colorbar info and fix dataclass docstrings
- Change 5+ channel colorbar message to logger.info on auto mode only (explicit colorbar=True is not blocked) - Fix double periods in dataclass docstrings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 480eb5a commit 90f8683

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/spatialdata_plot/pl/render.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,11 +1305,11 @@ def _render_images(
13051305

13061306
# 2) Image has any number of channels but 1
13071307
else:
1308-
if n_channels >= 5 and render_params.colorbar is True:
1309-
logger.warning(
1310-
"Colorbars are not supported for multi-channel images with 5+ channels. "
1311-
"To view individual channel scales, render channels separately with "
1312-
"`channel=<name>` and `colorbar=True`."
1308+
if n_channels >= 5 and render_params.colorbar == "auto":
1309+
logger.info(
1310+
"Colorbars are not shown by default for images with 5+ channels. "
1311+
"To show individual channel colorbars, render channels separately "
1312+
"with `channel=<name>` and `colorbar=True`."
13131313
)
13141314
layers = {}
13151315
for ch_idx, ch in enumerate(channels):

src/spatialdata_plot/pl/render_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class ScalebarParams:
214214

215215
@dataclass
216216
class ShapesRenderParams:
217-
"""Shapes render parameters.."""
217+
"""Shapes render parameters."""
218218

219219
cmap_params: CmapParams
220220
outline_params: OutlineParams
@@ -239,7 +239,7 @@ class ShapesRenderParams:
239239

240240
@dataclass
241241
class PointsRenderParams:
242-
"""Points render parameters.."""
242+
"""Points render parameters."""
243243

244244
cmap_params: CmapParams
245245
element: str
@@ -261,7 +261,7 @@ class PointsRenderParams:
261261

262262
@dataclass
263263
class ImageRenderParams:
264-
"""Image render parameters.."""
264+
"""Image render parameters."""
265265

266266
cmap_params: list[CmapParams] | CmapParams
267267
element: str
@@ -278,7 +278,7 @@ class ImageRenderParams:
278278

279279
@dataclass
280280
class LabelsRenderParams:
281-
"""Labels render parameters.."""
281+
"""Labels render parameters."""
282282

283283
cmap_params: CmapParams
284284
element: str

0 commit comments

Comments
 (0)