From ce6e0ae5443a4e5e8639b4ee71a62fd79f0da1c9 Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Thu, 15 Oct 2026 10:20:36 +0200 Subject: [PATCH 1/3] docs: clarify how coordinates stored in tables are treated The SpatialData docstring said tables store "the spatial coordinates" in the obsm slot. Since the move away from table coordinates (spatialdata issue 123) the library does not process them (see docs/design_doc.md): they have no coordinate system, are not transformed and are ignored by spatial queries. Readers and tools nevertheless commonly populate obsm["spatial"] (squidpy/scanpy convention), so name it explicitly and state its limitations. --- src/spatialdata/_core/spatialdata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spatialdata/_core/spatialdata.py b/src/spatialdata/_core/spatialdata.py index 1b6a17127..34f232a76 100644 --- a/src/spatialdata/_core/spatialdata.py +++ b/src/spatialdata/_core/spatialdata.py @@ -108,8 +108,10 @@ class SpatialData: - images and labels are stored as :class:`xarray.DataArray` or :class:`xarray.DataTree` objects. - points are stored as :class:`dask.dataframe.DataFrame` objects. - shapes are stored as :class:`geopandas.GeoDataFrame`. - - the table are stored as :class:`anndata.AnnData` objects, with the spatial coordinates stored in the obsm - slot. + - tables are stored as :class:`anndata.AnnData` objects. Tables have no coordinate system: coordinates + stored in a table (e.g. in ``obsm["spatial"]``, the squidpy/scanpy convention that several + spatialdata-io readers populate) are not transformed or used by spatial queries, and can get out of sync + with the SpatialElements the table annotates. Tables can annotate SpatialElements (labels, shapes or points) and can be used to store additional information. Points can also store annotations directly, as additional dataframe columns. From 91e30b36adedde2aea92e6ce4724d710d24da4ec Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Thu, 15 Oct 2026 10:52:18 +0200 Subject: [PATCH 2/3] docs: say table coordinates are "currently" not processed --- src/spatialdata/_core/spatialdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spatialdata/_core/spatialdata.py b/src/spatialdata/_core/spatialdata.py index 34f232a76..207688286 100644 --- a/src/spatialdata/_core/spatialdata.py +++ b/src/spatialdata/_core/spatialdata.py @@ -110,8 +110,8 @@ class SpatialData: - shapes are stored as :class:`geopandas.GeoDataFrame`. - tables are stored as :class:`anndata.AnnData` objects. Tables have no coordinate system: coordinates stored in a table (e.g. in ``obsm["spatial"]``, the squidpy/scanpy convention that several - spatialdata-io readers populate) are not transformed or used by spatial queries, and can get out of sync - with the SpatialElements the table annotates. + spatialdata-io readers populate) are currently not transformed or used by spatial queries, and can get out + of sync with the SpatialElements the table annotates. Tables can annotate SpatialElements (labels, shapes or points) and can be used to store additional information. Points can also store annotations directly, as additional dataframe columns. From 960feba8789f18cafeb50172fcbb24ef419da6cb Mon Sep 17 00:00:00 2001 From: Jan Gleixner Date: Thu, 15 Oct 2026 11:07:12 +0200 Subject: [PATCH 3/3] docs: fix indentation so the tables bullet renders as a paragraph --- src/spatialdata/_core/spatialdata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spatialdata/_core/spatialdata.py b/src/spatialdata/_core/spatialdata.py index 207688286..98fd391c6 100644 --- a/src/spatialdata/_core/spatialdata.py +++ b/src/spatialdata/_core/spatialdata.py @@ -109,9 +109,9 @@ class SpatialData: - points are stored as :class:`dask.dataframe.DataFrame` objects. - shapes are stored as :class:`geopandas.GeoDataFrame`. - tables are stored as :class:`anndata.AnnData` objects. Tables have no coordinate system: coordinates - stored in a table (e.g. in ``obsm["spatial"]``, the squidpy/scanpy convention that several - spatialdata-io readers populate) are currently not transformed or used by spatial queries, and can get out - of sync with the SpatialElements the table annotates. + stored in a table (e.g. in ``obsm["spatial"]``, the squidpy/scanpy convention that several spatialdata-io + readers populate) are currently not transformed or used by spatial queries, and can get out of sync with + the SpatialElements the table annotates. Tables can annotate SpatialElements (labels, shapes or points) and can be used to store additional information. Points can also store annotations directly, as additional dataframe columns.