Skip to content

feat: add opt-in rasterization tiles - #1166

Open
stanbot8 wants to merge 2 commits into
scverse:mainfrom
stanbot8:feat/987-raster-output-tiling
Open

feat: add opt-in rasterization tiles#1166
stanbot8 wants to merge 2 commits into
scverse:mainfrom
stanbot8:feat/987-raster-output-tiling

Conversation

@stanbot8

@stanbot8stanbot8 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

A large rasterization canvas can exceed available memory. Compute tiled raster shape and fill metadata 1 time before tile graph construction. Closes#987.

Design

The rasterization path can create 1 output canvas for the complete target extent. An enabled tile size bounds each rasterization canvas and preserves output coordinates and tile boundaries.

The implementation changes src/spatialdata/_core/operations/rasterize.py.

Limitations

  • Tiling is opt-in.
  • Smaller tiles create more tasks.

Tests

The baseline failed, and the candidate passed the same reproducer. The focused A/B reproducer passed on the candidate. The upstream CI test matrix passed. The repository quality checks passed in CI.

The tests are in tests/core/operations/test_rasterize.py.

Commands
python -m pytest tests/core/operations/test_rasterize.py -qruff check src/spatialdata/_core/operations/rasterize.py tests/core/operations/test_rasterize.py

@codecov

codecovBot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.55%. Comparing base (eb4fb3d) to head (6d80ac6).

Additional details and impacted files
@@ Coverage Diff @@## main #1166 +/- ##
==========================================
+ Coverage 92.44% 92.55% +0.11% 
==========================================
Files 51 51 Lines 7820 7901 +81 ==========================================
+ Hits 7229 7313 +84 + Misses 591 588 -3 
Files with missing linesCoverage Δ
src/spatialdata/_core/operations/rasterize.py92.87% <100.00%> (+2.27%)⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stanbot8
stanbot8force-pushed the feat/987-raster-output-tiling branch from 8c23041 to aab46d8CompareJuly 24, 2026 20:26
@stanbot8
stanbot8force-pushed the feat/987-raster-output-tiling branch from aab46d8 to 6d80ac6CompareJuly 25, 2026 16:11
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exceeding rasterize's maximum label index

1 participant

@stanbot8