Repository navigation
Conversation
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.
jan-glx
marked this pull request as ready for review
October 15, 2026 14:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Stacked on #1273)
The
SpatialDataclass docstring said that tables are stored asAnnDataobjects "with the spatial coordinates stored in the obsm slot". The library moved away from table coordinates early on (#123): tables have no coordinate system (design doc), and spatialdata never transforms, queries or validates coordinates stored in a table. The old line has likely contributed to recurring confusion, e.g. squidpy finding NaNs inobsm["spatial"](#387), spatial queries ignoring centroids stored there (#573, #825), and queries crashing on tables that only carryobsm["spatial"](#1248).At the same time,
obsm["spatial"]is the squidpy/scanpy convention (squidpy's defaultspatial_key, scanpy'ssc.pl.spatial(basis="spatial")) and is populated widely in practice: by most spatialdata-io readers (xenium, visium, visium_hd, merscope, cosmx, dbit, mcmicro, steinbock), by the legacy-AnnData converter, and by spatialdata-plot'smeasure_obs(scverse/spatialdata-plot#705).This PR therefore replaces the line with a description of the actual behaviour that names
obsm["spatial"]explicitly: