Skip to content

Close reproject test-coverage gaps from 2026-05-10 sweep#1577

Open
brendancol wants to merge 1 commit intomainfrom
deep-sweep-test-coverage-reproject-2026-05-10
Open

Close reproject test-coverage gaps from 2026-05-10 sweep#1577
brendancol wants to merge 1 commit intomainfrom
deep-sweep-test-coverage-reproject-2026-05-10

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Adds 39 tests against the reproject module's previously untested public surface, addressing five HIGH and one MEDIUM gap flagged by the 2026-05-10 test-coverage sweep.
  • No source changes -- the test-coverage sweep contract is tests-only.
  • State CSV updated: .claude/sweep-test-coverage-state.csv now records reproject,2026-05-10,,HIGH,1;4;5.

New test classes

  • TestLiteCRS (14 tests) -- direct coverage for xrspatial.reproject._lite_crs.CRS, the no-pyproj fallback class. Previously the only "lite CRS" test passed an integer CRS code that went through the pyproj path, so the lite path itself was untested. New tests cover construction from int/string, unknown-EPSG rejection, WKT generation+roundtrip for GEOGCS/PROJCS/UTM, equality+hash, and a monkeypatch that disables pyproj to force the lite path.
  • TestItrfBehaviour (5 tests) -- numerical behaviour for itrf_transform and itrf_frames. Existing tests only covered error paths; these add frame listing, scalar small-shift sanity, forward/reverse roundtrip to ~1e-9 deg, array input shape, and unknown-frame rejection.
  • TestGeoidHeightBehaviour (7 tests) -- geoid_height and geoid_height_raster happy-path numerical correctness. Reference EGM96 values at four locations, scalar/array consistency, longitude wrap (lon vs lon+360), near-pole finiteness, 2D coord input, and per-pixel agreement between geoid_height_raster and geoid_height.
  • TestVerticalHelperConversions (7 tests) -- the four public helpers (ellipsoidal_to_orthometric, orthometric_to_ellipsoidal, depth_to_ellipsoidal, ellipsoidal_to_depth) were exported but never directly tested. Each direction is checked against the geoid-height definition; both roundtrips close to within 1e-9 m; array broadcasting is exercised.
  • TestReprojectLatLonDimPropagation (4 tests) -- Cat 5 metadata gap. reproject() must preserve lat/lon and latitude/longitude dim names through same-CRS, cross-CRS, and dask paths. Equivalent test existed for merge() but not for reproject().

Note for follow-up

_merge_arrays_cupy is imported in xrspatial/reproject/__init__.py but never dispatched -- merge() always uses the numpy path, even for cupy inputs. That is a feature gap (missing cupy merge backend), not a test-coverage gap, so it is out of scope here.

Test plan

  • pytest xrspatial/tests/test_reproject.py -- 232 tests pass on a CUDA-available host (193 existing + 39 new).
  • The four new dask test cases run under the existing HAS_DASK skip guard.
  • No source file modified; verified via git diff --stat (only xrspatial/tests/test_reproject.py and .claude/sweep-test-coverage-state.csv).

Adds 39 tests against the reproject module's previously untested public
surface. The sweep flagged five HIGH gaps and one MEDIUM gap, all addressed
here without touching source.

New test classes in xrspatial/tests/test_reproject.py:

- TestLiteCRS: 14 tests for the no-pyproj fallback CRS class
  (xrspatial.reproject._lite_crs). Construction from int/string,
  rejection of unknown EPSG codes and bad inputs, WKT
  generation+roundtrip for GEOGCS/PROJCS/UTM, equality+hash, and
  monkeypatch tests that exercise the path with pyproj disabled.

- TestItrfBehaviour: 5 tests for itrf_transform and itrf_frames.
  Frame listing, scalar small-shift sanity, forward/reverse roundtrip
  to ~1e-9 degrees, array input shape preservation, and unknown-frame
  rejection.

- TestGeoidHeightBehaviour: 7 tests covering geoid_height and
  geoid_height_raster numerical correctness. Reference values at four
  locations, scalar/array consistency, longitude wrap, near-pole
  finiteness, 2D coord input, and per-pixel agreement between the
  raster path and the scalar path.

- TestVerticalHelperConversions: 7 tests for the public
  ellipsoidal<->orthometric and depth<->ellipsoidal helpers. Each
  scalar direction is checked against the geoid-height definition,
  both roundtrips close to within 1e-9 m, and array broadcasting is
  exercised.

- TestReprojectLatLonDimPropagation: 4 tests for the Cat 5 metadata
  gap. reproject() must preserve lat/lon and latitude/longitude dim
  names through same-CRS, cross-CRS, and dask paths.

State CSV updated: .claude/sweep-test-coverage-state.csv records
last_inspected=2026-05-10, severity_max=HIGH, categories_found=1;4;5.

Note flagged for follow-up: _merge_arrays_cupy is imported in
xrspatial/reproject/__init__.py but never dispatched -- merge() always
uses the numpy path even for cupy inputs. That is a feature gap
(missing cupy merge backend), not a test-coverage gap.

All 232 reproject tests pass locally on a CUDA-available host.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 11, 2026
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