Skip to content

northness/eastness geodesic path is untested #2829

@brendancol

Description

@brendancol

What's missing

northness() and eastness() in xrspatial/aspect.py take a method argument and pass it to aspect(). Every test in xrspatial/tests/test_northness_eastness.py uses the default method='planar', so the method='geodesic' branch through these two wrappers has never run in CI on any backend.

The planar side is well covered: correctness, output range, NaN handling, custom names, and all four backends. The gap is only the geodesic branch of the two wrappers.

Why it matters

northness/eastness forward method, z_unit, and boundary to aspect(). If that wiring broke for method='geodesic', nothing would catch it. Geodesic aspect runs a different code path (ECEF projection, lat/lon coordinate grids) than planar, so the wrapper behavior should be pinned on its own rather than assumed from the planar tests.

Proposed fix

Add tests that assert:

  • northness(agg, method='geodesic') equals cos(deg2rad(...)) of geodesic aspect, with flat cells (aspect -1) mapped to NaN
  • eastness(agg, method='geodesic') equals sin(deg2rad(...)) likewise
  • numpy, dask+numpy, cupy, and dask+cupy agree, reusing the geodesic raster helpers from test_geodesic_aspect.py

Test-only. No source change expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QA/QCtestsTest coverage and parity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions