From 8de23902c63bb67fb0ccee27656d19e47fb59abe Mon Sep 17 00:00:00 2001 From: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:51:51 +0530 Subject: [PATCH] Fix docstring parameter names that do not match the signatures Three docstrings name a parameter the function does not have. In two of them the name is the spelling used by a sibling function, so the docs drifted rather than being wrong from the start: - `validate_axes(axes)` documents `axis`, which is the parameter of the neighbouring `validate_axis_name`. - `SpatialData.subset(filter_tables=...)` documents `filter_table`, the spelling used by the `*_query` functions. The same docstring already refers to `filter_tables` correctly when describing `include_orphan_tables`. - `rasterize_bins(return_region_as_labels=...)` documents `return_regions_as_labels`, which is `rasterize`'s spelling. Its own `value_key` entry already refers to `return_region_as_labels`. `rasterize_bins_link_table_to_labels` repeats the last one in prose and tells the reader to call `rasterize_bins()` with `return_regions_as_labels=True`; `rasterize_bins` has no such parameter and takes no `**kwargs`, so that call raises `TypeError`. Docstrings only, no behaviour change. --- src/spatialdata/_core/operations/rasterize_bins.py | 4 ++-- src/spatialdata/_core/spatialdata.py | 4 ++-- src/spatialdata/models/_utils.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spatialdata/_core/operations/rasterize_bins.py b/src/spatialdata/_core/operations/rasterize_bins.py index f3ff32fbf..5277f5d78 100644 --- a/src/spatialdata/_core/operations/rasterize_bins.py +++ b/src/spatialdata/_core/operations/rasterize_bins.py @@ -56,7 +56,7 @@ def rasterize_bins( The key(s) (obs columns/var names) in the table that will be used to rasterize the bins. If `None`, all the var names will be used, and the returned object will be lazily constructed. Ignored if `return_region_as_labels` is `True`. - return_regions_as_labels + return_region_as_labels If `False` this function returns a `xarray.DataArray` of shape `(c, y, x)` with dimension of `c` equal to the number of key(s) specified in `value_key`, or the number of var names in `table_name` if `value_key` is `None`. If `True`, will return labels of shape `(y, x)`, @@ -280,7 +280,7 @@ def rasterize_bins_link_table_to_labels(sdata: SpatialData, table_name: str, ras Change the annotation target of the table to the rasterized labels. This function should be called after having rasterized the bins (calling `rasterize_bins()` with - `return_regions_as_labels=True`) and after having added the rasterized labels to the spatial data object. + `return_region_as_labels=True`) and after having added the rasterized labels to the spatial data object. Parameters ---------- diff --git a/src/spatialdata/_core/spatialdata.py b/src/spatialdata/_core/spatialdata.py index 89f4a4920..8be3c2682 100644 --- a/src/spatialdata/_core/spatialdata.py +++ b/src/spatialdata/_core/spatialdata.py @@ -2427,8 +2427,8 @@ def subset( ---------- element_names The names of the element_names to subset. If the element_name is the name of a table, this table would be - completely included in the subset even if filter_table is True. - filter_table + completely included in the subset even if `filter_tables` is True. + filter_tables If True (default), the table is filtered to only contain rows that are annotating regions contained within the element_names. include_orphan_tables diff --git a/src/spatialdata/models/_utils.py b/src/spatialdata/models/_utils.py index 1ffe50a49..972e2d9be 100644 --- a/src/spatialdata/models/_utils.py +++ b/src/spatialdata/models/_utils.py @@ -92,7 +92,7 @@ def validate_axes(axes: tuple[ValidAxis_t, ...]) -> None: Parameters ---------- - axis + axes The names of the axes Raises