fix(labels): restore render float-dtype guard for spatialdata <0.8 - #751
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #751 +/- ##
=======================================
Coverage 79.59% 79.60%
=======================================
Files 17 18 +1
Lines 4641 4657 +16
Branches 1029 1032 +3
=======================================
+ Hits 3694 3707 +13
- Misses 598 599 +1
- Partials 349 351 +2
🚀 New features to boost your workflow:
|
Member
Author
|
Blocked by scverse/spatialdata#1150 so we can remove the local |
#758 removed the render-time float-dtype guard on the assumption that spatialdata always rejects float labels at the model boundary. That only holds on spatialdata >=0.8; the library still supports spatialdata >=0.3, where float labels parse fine and would again crash deep in skimage with a cryptic TypeError (#606). Restore the guard so the clear error holds across the whole supported range. - render.py: re-add the float-dtype ValueError guard. - test_render_labels.py: re-add test_render_labels_rejects_float_dtype in a version-agnostic form (assert an "integer dtype" error is raised at whichever layer enforces it: spatialdata on >=0.8, our guard on <0.8). - test_render_shapes.py: sort queried shapes before render so the overlap draw order (and the baseline) is stable across spatialdata's query-order change in 0.8; regenerate the baseline accordingly. The measure_obs float coverage stays as the version-independent _stream_label_centroid_stats unit test added in #758.
timtreis
force-pushed
the
fix/sdata-08-compat
branch
from
August 7, 2026 13:53
8097f73 to
ba46b8b
Compare
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.
Problem
#758 (merged) removed
_render_labels' float-dtype guard, assuming spatialdata always rejects float labels at the model boundary. That only holds on spatialdata >= 0.8. The library still declaresspatialdata >= 0.3, and on spatialdata < 0.8Labels2DModel.parseaccepts float labels — so with the guard gone,render_labelsagain crashes deep in skimage with a crypticTypeError(the #606 regression). This PR corrects that.Changes
ValueErrorguard (safety net for spatialdata < 0.8; >= 0.8 rejects earlier at the model boundary).test_render_labels_rejects_float_dtype, now version-agnostic: asserts an"integer dtype"error at whichever layer enforces it (spatialdata on >= 0.8; our guard on < 0.8).sort_index()the queried shapes before rendering the random-shuffling test, so the overlapping circles' draw order (and baseline) is stable across spatialdata's 0.8 query-order change; baseline regenerated.measure_obsfloat coverage stays as the version-independent_stream_label_centroid_statsunit test added in #758.