Skip to content

Fix northness/eastness to stay lazy on dask arrays#1123

Merged
brendancol merged 4 commits intomasterfrom
issue-1122
Mar 31, 2026
Merged

Fix northness/eastness to stay lazy on dask arrays#1123
brendancol merged 4 commits intomasterfrom
issue-1122

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

@brendancol brendancol commented Mar 31, 2026

Summary

  • Use da.cos/da.sin/da.deg2rad/da.where when the aspect result is dask-backed
  • Previously np.cos() etc. would implicitly call .compute() on the dask array

Context

Found during performance sweep (#1122). The core aspect() function correctly uses map_overlap for dask, but northness()/eastness() applied numpy trig ops to the dask result, triggering full materialization.

Test plan

  • All 64 existing aspect tests pass (verified)
  • Manual test confirms dask output stays lazy (dask.Array type preserved)

Parallel subagent triage + ralph-loop workflow for auditing all
xrspatial modules for performance bottlenecks, OOM risk under
30TB dask workloads, and backend-specific anti-patterns.
7 tasks covering command scaffold, module scoring, parallel subagent
dispatch, report merging, ralph-loop generation, and smoke tests.
Use da.cos/da.sin/da.deg2rad/da.where when the aspect result is dask-
backed, preventing implicit materialization via numpy dispatch.
@github-actions github-actions bot added the performance PR touches performance-sensitive code label Mar 31, 2026
@brendancol brendancol merged commit d45f27a into master Mar 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant