Fixes #907, #908: make bump dask backends truly lazy, add agg parameter#914
Merged
brendancol merged 2 commits intomasterfrom Feb 27, 2026
Merged
Fixes #907, #908: make bump dask backends truly lazy, add agg parameter#914brendancol merged 2 commits intomasterfrom
brendancol merged 2 commits intomasterfrom
Conversation
Rewrite _bump_dask_numpy and _bump_dask_cupy to use da.map_blocks instead of eagerly allocating the full output array, which would OOM on large rasters. Each chunk now independently filters bumps whose center falls within it and computes only the chunk-sized result. Also add an `agg` template parameter to bump() with full backend dispatch (numpy, cupy, dask+numpy, dask+cupy) via ArrayTypeFunctionMapping. Tests use single-chunk for bitwise equality and multi-chunk for approximate verification of the lazy chunked path.
- Implement _hotspots_dask_cupy: GPU convolution + CPU classification via map_overlap - Implement _emerging_hotspots_dask_cupy: GPU convolution, CPU Mann-Kendall via map_blocks - Replace not_implemented_func stubs with real dask_cupy_func in both APIs - Add tests verifying dask+cupy results match numpy reference - Update README backend support table for hotspots, emerging hotspots, and bump
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.
Summary
aggtemplate-raster parameter tobump()so shape, chunks, and backend are inferred from an existing DataArrayArrayTypeFunctionMapping— Dask backends usemap_blockswithblock_infofor truly lazy, per-chunk bump generationwidth/heightoptional whenaggis providedTest plan
test_bumpstill passestest_bump_agg_numpy— NumPy backend with agg, determinism checktest_bump_agg_cupy— CuPy backend matches NumPy (skipped without GPU)test_bump_agg_dask— single-chunk Dask matches NumPy bitwisetest_bump_agg_dask_chunked— multi-chunk Dask laziness and approximate energy conservationtest_bump_agg_dask_cupy— Dask+CuPy single-chunk matches NumPy (skipped without GPU)test_bump_preserves_coords— coordinates and dims propagated from aggtest_bump_agg_infers_shape— shape inferred from agg matches explicit width/heightCloses #907, #908