Commit 832edaf
committed
fix(labels): defer float-dtype rejection to spatialdata's model validation
spatialdata 0.8 rejects non-integer label rasters at the model boundary
(parse / SpatialData construction / __setitem__) with a clear, actionable
message. This makes _render_labels' own float-dtype guard (added in #606,
when spatialdata 0.5 still accepted float labels) redundant dead code: a
validly built element can no longer reach the renderer with a float dtype.
- Remove the redundant render-time guard; trust the upstream boundary.
- Drop test_render_labels_rejects_float_dtype (asserts an unreachable
render-time scenario; upstream now raises earlier at parse).
- Rewrite the measure_obs float test to exercise _stream_label_centroid_stats
directly (where the integer-valued-float -> int cast lives), since a float
labels element can no longer be placed in a SpatialData.
The helper's float->int cast is kept as cheap, correct-by-construction
robustness for any integer-valued float raster passed to it directly.1 parent 227434d commit 832edaf
3 files changed
Lines changed: 17 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2189 | 2189 | | |
2190 | 2190 | | |
2191 | 2191 | | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
2198 | 2195 | | |
2199 | 2196 | | |
2200 | 2197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | 713 | | |
731 | 714 | | |
732 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
637 | 645 | | |
638 | 646 | | |
639 | 647 | | |
| |||
0 commit comments