Skip to content

Add rusterize engine support for rasterization#61

Merged
dcherian merged 12 commits intomainfrom
rusterize
Feb 4, 2026
Merged

Add rusterize engine support for rasterization#61
dcherian merged 12 commits intomainfrom
rusterize

Conversation

@dcherian
Copy link
Contributor

@dcherian dcherian commented Dec 9, 2025

Closes #52

Refactors the rasterization module to support multiple backends via an engine parameter using a Protocol-based design. Both rasterio and rusterize are now optional dependencies.

Changes:

  • Add Rasterizer Protocol in core.py defining the engine interface
  • Refactor core.py to use Protocol-based engine selection
  • Add rusterize, test-rusterize, test-all optional dependency groups
  • Add test-rusterize CI job in GitHub Actions
  • Parametrize tests over available engines

Engine selection (engine=None) auto-detects, preferring rusterize if available, falling back to rasterio. geometry_clip remains rasterio-specific.

🤖 Generated with Claude Code

Refactors the rasterization module to support multiple backends via an
`engine` parameter using a Protocol-based design. Both rasterio and
rusterize are now optional dependencies.

Changes:
- Add Rasterizer Protocol in core.py defining the engine interface
- Add RasterioRasterizer class implementing the Protocol
- Add RusterizeRasterizer class implementing the Protocol
- Refactor core.py to use Protocol-based engine selection
- Add rusterize, test-rusterize, test-all optional dependency groups
- Add test-rusterize CI job in GitHub Actions
- Parametrize tests over available engines

Engine selection (engine=None) auto-detects, preferring rusterize if
available, falling back to rasterio. geometry_clip remains
rasterio-specific.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
dcherian and others added 10 commits January 23, 2026 17:06
Move geometry_clip from rasterio.py to core.py and add engine parameter
to support both rasterio and rusterize engines. The function now follows
the same pattern as rasterize and geometry_mask.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Raise ValueError when merge_alg is not 'replace' or 'add' in the
dask code path for consistency with the validation in
_normalize_merge_alg.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new notebook documenting the rusterize engine for rasterization,
similar to the rasterio documentation. Highlights that rusterize does
not require GDAL, making it easier to install.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update both the GitHub Actions workflow and the hatch test matrix
for test-rusterize to use Python 3.14.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add S_20240101_concentration_v4.0.tif to docs/data/ to avoid
  network requests during docs build
- Update notebooks to use local file instead of remote URL
- Update .gitignore to allow docs/data directory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update geometry_mask.ipynb and rasterio.ipynb to use the new
import paths from rasterix.rasterize instead of the old
rasterix.rasterize.rasterio module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dcherian dcherian merged commit 586a6e4 into main Feb 4, 2026
11 checks passed
@dcherian dcherian deleted the rusterize branch February 4, 2026 03:44
Sign up for free to 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.

wrap rusterize

1 participant