Describe the bug
The Dask path in geodesic aspect skips the chunk memory guard. In xrspatial/aspect.py, the method='geodesic' branch checks is_dask and skips _check_geodesic_memory for any Dask-backed array. So a Dask array whose single chunk spans the whole raster gets no guard at all, and it can still OOM at compute time.
The slope module already handles this. slope() calls _check_geodesic_memory_backend_aware(agg, func_name='slope') (in xrspatial/slope.py). That helper is backend-aware: for eager numpy/cupy it sizes against the full raster, and for Dask it sizes against the largest chunk plus the map_overlap halo. A single huge chunk has no memory advantage over eager, so the helper still rejects it.
Aspect should call the same helper so its Dask geodesic path gets a real guard instead of none.
Expected behavior
aspect(raster, method='geodesic') on a Dask array with one chunk covering the whole raster should raise MemoryError when the chunk exceeds available memory, the same way slope() does. A small-chunked raster should still stream through fine.
Additional context
The helper already lives in xrspatial/geodesic.py. The fix swaps the import and replaces the inline is_dask check in aspect with the shared helper.
Describe the bug
The Dask path in geodesic aspect skips the chunk memory guard. In
xrspatial/aspect.py, themethod='geodesic'branch checksis_daskand skips_check_geodesic_memoryfor any Dask-backed array. So a Dask array whose single chunk spans the whole raster gets no guard at all, and it can still OOM at compute time.The slope module already handles this.
slope()calls_check_geodesic_memory_backend_aware(agg, func_name='slope')(inxrspatial/slope.py). That helper is backend-aware: for eager numpy/cupy it sizes against the full raster, and for Dask it sizes against the largest chunk plus the map_overlap halo. A single huge chunk has no memory advantage over eager, so the helper still rejects it.Aspect should call the same helper so its Dask geodesic path gets a real guard instead of none.
Expected behavior
aspect(raster, method='geodesic')on a Dask array with one chunk covering the whole raster should raiseMemoryErrorwhen the chunk exceeds available memory, the same wayslope()does. A small-chunked raster should still stream through fine.Additional context
The helper already lives in
xrspatial/geodesic.py. The fix swaps the import and replaces the inlineis_daskcheck in aspect with the shared helper.