Skip to content

Add hotspots() and emerging_hotspots() dask+cupy backends #904

@brendancol

Description

@brendancol

Problem

Both hotspots() and emerging_hotspots() support 3 of 4 backends but are missing dask+cupy:

# focal.py line 1223
dask_cupy_func=lambda *args: not_implemented_func(
    *args, messages='hotspots() does not support dask with cupy backed DataArray.'),

# emerging_hotspots.py line 601
dask_cupy_func=lambda *args: not_implemented_func(
    messages='emerging_hotspots() does not support dask+cupy backed DataArray.',

Why This Should Be Straightforward

  • The cupy backends for both already exist (_hotspots_cupy, _emerging_hotspots_cupy).
  • The dask+numpy backends also exist and use map_overlap.
  • The same file (focal.py) already has a working dask+cupy implementation for mean() at line 80 that demonstrates the pattern.
  • The missing piece is combining these: map_overlap with cupy chunk functions and cupy meta arrays.

Proposed Fix

  • hotspots: implement _hotspots_dask_cupy() following the _mean_dask_cupy() pattern.
  • emerging_hotspots: implement _emerging_hotspots_dask_cupy() similarly.
  • Update README feature matrix: add ✅ for Hotspots dask GPU column.

Impact

Hotspot analysis is critical for spatial epidemiology, crime analysis, and environmental monitoring — compute-intensive operations where GPU provides the most benefit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-coverageAdding missing dask/cupy/dask+cupy backend supportenhancementNew feature or requestfocal toolsFocal statistics and hotspot analysisgpuCuPy / CUDA GPU support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions