-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
apiAPI design and consistencyAPI design and consistencybackend-coverageAdding missing dask/cupy/dask+cupy backend supportAdding missing dask/cupy/dask+cupy backend supportenhancementNew feature or requestNew feature or request
Description
Problem
bump() in xrspatial/bump.py is inconsistent with every other function in the library:
- Wrong input API: Takes raw
width/heightintegers instead of a DataArray template. Every other function takes a DataArray. - No backend dispatch: No
ArrayTypeFunctionMapping, no cupy/dask backends — numpy only. - No coordinates on output: Returns a DataArray without coordinate values, making it incompatible with downstream functions that require coordinate information (slope, proximity, etc.).
- Performance: The numba-JIT triple-nested loop is O(count × spread²) per bump. Fine for small arrays but slow for large count/spread.
There's even a TODO in the source: "TODO: change parameters to take agg instead of height/width".
Proposed Fix
- Refactor
bump()to accept a template DataArray (matchinggenerate_terrain()pattern). - Add
ArrayTypeFunctionMappingdispatch with numpy/cupy/dask/dask+cupy backends. - For CuPy:
@cuda.jitkernel with each thread handling one bump. - For dask:
map_blockssince each bump's effect is local to its spread radius. - Set proper coordinates on the output DataArray.
- Update README feature matrix.
Breaking Change
The function signature changes from bump(width, height, ...) to accepting a DataArray. Document in changelog.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiAPI design and consistencyAPI design and consistencybackend-coverageAdding missing dask/cupy/dask+cupy backend supportAdding missing dask/cupy/dask+cupy backend supportenhancementNew feature or requestNew feature or request