Close reproject test-coverage gaps from 2026-05-10 sweep#1577
Open
brendancol wants to merge 1 commit intomainfrom
Open
Close reproject test-coverage gaps from 2026-05-10 sweep#1577brendancol wants to merge 1 commit intomainfrom
brendancol wants to merge 1 commit intomainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/sweep-test-coverage-state.csvnow recordsreproject,2026-05-10,,HIGH,1;4;5.New test classes
TestLiteCRS(14 tests) -- direct coverage forxrspatial.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 foritrf_transformanditrf_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_heightandgeoid_height_rasterhappy-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 betweengeoid_height_rasterandgeoid_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 preservelat/lonandlatitude/longitudedim names through same-CRS, cross-CRS, and dask paths. Equivalent test existed formerge()but not forreproject().Note for follow-up
_merge_arrays_cupyis imported inxrspatial/reproject/__init__.pybut 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).HAS_DASKskip guard.git diff --stat(onlyxrspatial/tests/test_reproject.pyand.claude/sweep-test-coverage-state.csv).