fix(visium): build the circles from the spot coordinates again - #416
Merged
Conversation
`visium()` used `coords` for two things: the raw `tissue_positions` table merged into `adata.obs`, and, after a rebinding, the `(n, 2)` array of spot coordinates that `ShapesModel.parse()` consumes. In #411 the rebinding was inlined into the `adata.obsm["spatial"]` assignment (`coords` changing type is what mypy rejects), so the raw table reached `ShapesModel.parse()` and the reader raised `TypeError: ShapesModel.parse() does not support the type <class 'pandas.core.frame.DataFrame'>`. Use a separate name for the coordinates, which keeps mypy happy without changing the runtime behaviour, and add a regression test on a minimal synthetic dataset (the plain Visium reader had no test coverage). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
LucaMarconato
enabled auto-merge (squash)
September 9, 2026 10:59
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
==========================================
- Coverage 63.15% 63.13% -0.02%
==========================================
Files 26 26
Lines 3257 3258 +1
==========================================
Hits 2057 2057
- Misses 1200 1201 +1
🚀 New features to boost your workflow:
|
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.
Fixes a bug introduced by #411
below: AI generated–manually reviewed
visium()usedcoordsfor two things: the rawtissue_positionstable merged intoadata.obs, and, after a rebinding, the(n, 2)array of spot coordinates thatShapesModel.parse()consumes.In #411 the rebinding was inlined into the
adata.obsm["spatial"]assignment (coordschanging type is what mypy rejects), so the raw table reachedShapesModel.parse()and the reader raisedTypeError: ShapesModel.parse() does not support the type <class 'pandas.core.frame.DataFrame'>.Use a separate name for the coordinates, which keeps mypy happy without changing the runtime behaviour, and add a regression test on a minimal synthetic dataset (the plain Visium reader had no test coverage).