Skip to content

northness/eastness call np.cos/sin on dask arrays, triggering implicit materialization #1122

@brendancol

Description

@brendancol

Describe the bug

northness() at line 509 and eastness() at line 585 call np.cos()/np.sin() on asp_data which may be a dask array. NumPy implicitly calls .compute() on dask arrays, materializing the full result into RAM.

The core aspect() function correctly uses map_overlap for dask, but northness()/eastness() bypass that by operating on the result with numpy ops.

Expected behavior

Use da.cos/da.sin/da.deg2rad/da.where when the data is dask-backed, keeping the computation lazy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghigh-priorityoomOut-of-memory risk with large datasets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions