Skip to content

aspect(method='geodesic') memory guard is eager-only too #2783

Closed

Description

@brendancol

Follow-up from #2765 / PR #2779, which made the geodesic slope memory guard backend-aware.

aspect.py:427 runs the same eager-only guard:

rows, cols = agg.shape[-2], agg.shape[-1]
_check_geodesic_memory(rows, cols, func_name='aspect')

The dask geodesic aspect backend streams chunk by chunk, same as slope, so sizing the guard against the full raster rejects large-but-chunked rasters that would run fine. The fix mirrors the slope change: call _check_geodesic_memory_backend_aware(agg, func_name='aspect') instead, and add the equivalent dask guard tests.

Kept out of #2779 to keep that PR scoped to slope.

Activity

  1. added
    bugSomething isn't working
    oomOut-of-memory risk with large datasets
    backend-coverageAdding missing dask/cupy/dask+cupy backend support
    daskDask backend / chunked arrays
    on Jun 1, 2026
  2. added this to the 1.0.0 milestone on Jun 4, 2026
  3. brendancol commented on Jun 23, 2026

    @brendancol
    ContributorAuthor

    Already fixed. The backend-aware guard this issue asks for landed in #2840 / #2846 (commit d51eb3d): aspect.py now calls _check_geodesic_memory_backend_aware(agg, func_name='aspect') instead of the eager-only _check_geodesic_memory(rows, cols, ...). It sizes the guard against the largest chunk plus the 1-cell map_overlap halo for dask, and against the full raster for eager numpy/cupy. The earlier interim fix that skipped the full-raster guard for dask aspect was #2774.

    The dask guard tests live in TestGeodesicAspectMemoryGuard (xrspatial/tests/test_geodesic_aspect.py): a large-raster/small-chunk case the eager guard would reject but the chunked path allows, a dask+cupy variant, and a single-whole-raster-chunk case that's still rejected. All pass.

    Closing as already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-coverageAdding missing dask/cupy/dask+cupy backend supportbugSomething isn't workingdaskDask backend / chunked arraysoomOut-of-memory risk with large datasetsseverity:highSweep finding: HIGH

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions