Skip to content

Commit af0ca3b

Browse files
committed
bump
1 parent 8506163 commit af0ca3b

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

docs/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
nb_execution_mode = "off"
8686
nb_merge_streams = True
8787
typehints_defaults = "braces"
88+
autodoc_type_aliases = {
89+
"ColorLike": "spatialdata_plot.pl.basic.ColorLike",
90+
}
8891

8992
source_suffix = {
9093
".rst": "restructuredtext",
@@ -135,5 +138,12 @@
135138
nitpick_ignore = [
136139
# If building the documentation fails because of a missing link that is outside your control,
137140
# you can add an exception to this list.
138-
# ("py:class", "igraph.Graph"),
141+
("py:class", "Colormap"),
142+
("py:class", "Normalize"),
143+
("py:class", "ColorLike"),
144+
]
145+
nitpick_ignore_regex = [
146+
("py:class", r"default .+"),
147+
("py:class", r"gets set to .+"),
148+
("py:class", r"optional"),
139149
]

src/spatialdata_plot/pl/basic.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,15 @@ def render_shapes(
187187
element : str | None, optional
188188
The name of the shapes element to render. If `None`, all shapes elements in the `SpatialData` object will be
189189
used.
190-
color : ColorLike | None, optional
190+
color : ColorLike | str | None, optional
191191
Can either be color-like (name of a color as string, e.g. "red", hex representation, e.g. "#000000" or
192192
"#000000ff", or an RGB(A) array as a tuple or list containing 3-4 floats within [0, 1]. If an alpha value is
193-
indicated, the value of `fill_alpha` takes precedence if given) or a string representing a key in
194-
:attr:`sdata.table.obs`. The latter can be used to color by categorical or continuous variables. If
193+
indicated, the value of `fill_alpha` takes precedence if given) or a string referencing stored annotations.
194+
When the provided key matches a column on the shapes element itself, those values are used directly. When
195+
the key references an AnnData table annotating the element, both ``obs`` columns and ``var_names`` entries
196+
(optionally pulled from ``layers``) are supported; use `table_name` to disambiguate which table should be
197+
consulted. The string form can therefore represent categorical or continuous measurements tied to the shapes
198+
element.
195199
`element` is `None`, if possible the color will be broadcasted to all elements. For this, the table in which
196200
the color key is found must annotate the respective element (region must be set to the specific element). If
197201
the color column is found in multiple locations, please provide the table_name to be used for the elements.
@@ -241,8 +245,8 @@ def render_shapes(
241245
spatial element to be plotted if the table annotates it. If you want to use different tables for particular
242246
elements, as specified under element.
243247
table_layer: str | None
244-
Layer of the table to use for coloring if `color` is in :attr:`sdata.table.var_names`. If None, the data in
245-
:attr:`sdata.table.X` is used for coloring.
248+
Layer of the table to use for coloring if `color` is present in the ``var_names`` of the table. If None, the
249+
data stored in ``X`` is used for coloring.
246250
shape: Literal["circle", "hex", "visium_hex", "square"] | None
247251
If None (default), the shapes are rendered as they are. Else, if either of "circle", "hex" or "square" is
248252
specified, the shapes are converted to a circle/hexagon/square before rendering. If "visium_hex" is
@@ -368,8 +372,9 @@ def render_points(
368372
color : str | None, optional
369373
Can either be color-like (name of a color as string, e.g. "red", hex representation, e.g. "#000000" or
370374
"#000000ff", or an RGB(A) array as a tuple or list containing 3-4 floats within [0, 1]. If an alpha value is
371-
indicated, the value of `fill_alpha` takes precedence if given) or a string representing a key in
372-
:attr:`sdata.table.obs`. The latter can be used to color by categorical or continuous variables. If
375+
indicated, the value of `fill_alpha` takes precedence if given) or a string representing a key in the ``obs``
376+
dataframe of the table providing annotations. The latter can be used to color by categorical or continuous
377+
variables. If
373378
`element` is `None`, if possible the color will be broadcasted to all elements. For this, the table in which
374379
the color key is found must annotate the respective element (region must be set to the specific element). If
375380
the color column is found in multiple locations, please provide the table_name to be used for the elements.
@@ -403,8 +408,8 @@ def render_points(
403408
spatial element to be plotted if the table annotates it. If you want to use different tables for particular
404409
elements, as specified under element.
405410
table_layer: str | None
406-
Layer of the table to use for coloring if `color` is in :attr:`sdata.table.var_names`. If None, the data in
407-
:attr:`sdata.table.X` is used for coloring.
411+
Layer of the table to use for coloring if `color` is present in the ``var_names`` of the table. If None, the
412+
data stored in ``X`` is used for coloring.
408413
409414
**kwargs : Any
410415
Additional arguments for customization. This can include:
@@ -627,8 +632,8 @@ def render_labels(
627632
The name of the labels element to render. If `None`, all label
628633
elements in the `SpatialData` object will be used and all parameters will be broadcasted if possible.
629634
color : str | None
630-
Can either be string representing a color-like or key in :attr:`sdata.table.obs` or in the index of
631-
:attr:`sdata.table.var`. The latter can be used to color by categorical or continuous variables. If the
635+
Can either be string representing a color-like or key in the ``obs`` dataframe or ``var`` index of the
636+
associated table. The latter can be used to color by categorical or continuous variables. If the
632637
color column is found in multiple locations, please provide the table_name to be used for the element if you
633638
would like a specific table to be used. By default one table will automatically be choosen.
634639
groups : list[str] | str | None
@@ -664,8 +669,8 @@ def render_labels(
664669
table_name: str | None
665670
Name of the table containing the color columns.
666671
table_layer: str | None
667-
Layer of the AnnData table to use for coloring if `color` is in :attr:`sdata.table.var_names`. If None,
668-
:attr:`sdata.table.X` of the default table is used for coloring.
672+
Layer of the AnnData table to use for coloring if `color` is present in the ``var_names`` of the default
673+
table. If None, the ``X`` matrix of the default table is used for coloring.
669674
kwargs
670675
Additional arguments to be passed to cmap and norm.
671676

0 commit comments

Comments
 (0)