Skip to content

geotiff tests: consolidate georef and rotation cluster (#2435)#2463

Merged
brendancol merged 3 commits into
xarray-contrib:mainfrom
brendancol:issue-2435
May 26, 2026
Merged

geotiff tests: consolidate georef and rotation cluster (#2435)#2463
brendancol merged 3 commits into
xarray-contrib:mainfrom
brendancol:issue-2435

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #2435 (cluster 11 of the long-tail GeoTIFF test consolidation epic #2424). Tests-only.

Summary

Fold twelve top-level georef / no-georef / rotation test files into a single xrspatial/geotiff/tests/read/test_georef.py, grouped by concern:

Read side:

Write side (kept in the same file under a write-side heading because they share the rotated-affine and no-georef-marker fixtures; splitting into write/test_georef.py would scatter one concern across two modules):

GPU gating moves to the shared requires_gpu marker and gpu_available probe from _helpers/markers.py. The per-issue rotated-TIFF and VRT writers keep their distinct byte layouts and are suffixed by issue number to avoid collision. The status suite imports _write_rotated_tiff from read/test_crs.py, which owns the rotated-CRS read surface and is left untouched. No assertion changed.

Audit

CLUSTER_AUDIT_GEOREF.md maps every old file to its new section. The audit file is deleted in a final pre-merge commit.

Verification

  • pytest xrspatial/geotiff/tests/read/test_georef.py -q: 171 passed (same total as the twelve source files).
  • pytest xrspatial/geotiff/tests/read/ -q: 711 passed, 4 skipped.
  • pytest xrspatial/geotiff/tests/ --co -q: 5890 collected, no errors.
  • File count drops by 11 (12 deleted, 1 added).

Test plan

  • Consolidated read/test_georef.py passes on this checkout (GPU present).
  • Full geotiff test suite collects.
  • CI green across numpy / cupy / dask+numpy / dask+cupy.
  • Audit file deleted on the pre-merge commit.

…b#2435)

Fold twelve top-level georef / no-georef / rotation test files into
xrspatial/geotiff/tests/read/test_georef.py. Read-side and write-side
cases share the rotated-affine and no-georef-marker fixtures, so the
write-side tests stay in the same module under a write-side heading
rather than splitting into write/test_georef.py.

GPU gating moves to the shared requires_gpu marker and gpu_available
probe from _helpers/markers.py. Per-issue rotated-TIFF and VRT writers
keep their distinct byte layouts and are suffixed by issue number to
avoid collision. The status suite imports _write_rotated_tiff from
read/test_crs.py, which is left untouched.

CLUSTER_AUDIT_GEOREF.md maps every old file to its new section; it is
deleted in a pre-merge commit per epic xarray-contrib#2424.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 26, 2026
Copy link
Copy Markdown
Contributor Author

@brendancol brendancol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: geotiff tests: consolidate georef and rotation cluster (#2435)

Tests-only consolidation. Twelve top-level files fold into read/test_georef.py. No source under xrspatial/geotiff/ changed, so the algorithm / backend-dispatch / performance sections of the checklist do not apply. I verified the move preserved every test rather than re-deriving correctness.

Blockers (must fix before merge)

None.

Suggestions (should fix, not blocking)

None.

Nits (optional improvements)

  • read/test_georef.py:81 imports _write_rotated_tiff as _write_rotated_tiff_crs with a # noqa: E402, but the import sits in the normal top-of-file block, not after code. flake8 with --select=E402 is clean without it, so the marker can be dropped.

What looks good

  • Test count is identical: 144 unique test functions in both the old twelve files and the new module, 171 collected items each. comm shows zero names dropped.
  • Every assertion is carried over verbatim; the only changes are mechanical (helper renames, shared marker).
  • Helper-name collisions across the source files (_write_rotated_tiff, _write_rotated_vrt, _make_da, _rotated_dataarray, _ROTATED_TUPLE) are resolved by suffixing each with its issue number, so the distinct byte layouts stay distinct.
  • The status suite keeps importing _write_rotated_tiff from read/test_crs.py with the same (path, arr) call shape; the imported helper's signature is unchanged, so the dependency holds and read/test_crs.py is untouched.
  • _NO_GEOREF_KEY resolves to the same string from _coords and _geotags, so consolidating the import to _coords does not change any marker comparison.
  • GPU gating moved to the shared requires_gpu marker; the one spot that read the old _HAS_GPU global now calls gpu_available(), which returns the same bool.
  • flake8 is clean; full suite collects 5890 with no errors.

Checklist

  • [n/a] Algorithm matches reference/paper -- no algorithm changed
  • All implemented backends produce consistent results -- GPU + dask + numpy paths preserved, all pass on this checkout
  • NaN handling is correct -- unchanged from source files
  • Edge cases are covered by tests -- 1x1 / Nx1 / 1xN / no-georef / rotated all carried over
  • Dask chunk boundaries handled correctly -- unchanged
  • No premature materialization or unnecessary copies -- tests-only
  • [n/a] Benchmark exists or is not needed -- tests-only
  • [n/a] README feature matrix updated -- no new function
  • Docstrings present and accurate -- module + per-section docstrings explain provenance

Copy link
Copy Markdown
Contributor Author

@brendancol brendancol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review (round 2)

The one nit from the first pass is fixed in 58bd26c: the unnecessary # noqa: E402 on the read/test_crs import is gone, and flake8 stays clean.

The audit file CLUSTER_AUDIT_GEOREF.md is deleted in 1e5c023 per epic #2424. Nothing else outstanding; the diff is now tests-only with no leftover scaffolding. 171 tests still pass on this checkout.

@brendancol brendancol merged commit 0ae1339 into xarray-contrib:main May 26, 2026
3 of 6 checks passed
brendancol added a commit that referenced this pull request May 26, 2026
The georef/rotation cluster (#2463) moved test_no_georef_windowed_coords_1710.py
into read/test_georef.py but left the reader.windowed row in
release_gate_geotiff.rst citing the deleted path. Repoint it so the
checklist-parity gate stays green on the merged branch.
brendancol added a commit that referenced this pull request May 26, 2026
* geotiff tests: consolidate VRT tail cluster (#2437)

Fold the 12 VRT-residue files into existing vrt/ modules plus a new
vrt/test_parity.py:

- missing-sources trio (1843 internal entry point + STRICT env, 1860
  public default, 1799/2265 chunked policy) -> vrt/test_missing_sources.py
- srcrect-validation (1784), kwarg-drop (1685), tiled-validation (1862)
  -> vrt/test_validation.py
- lazy-chunks (1798), dask-vrt-kwargs (1795) -> vrt/test_window.py
- backend-parity (2321), finalization-parity (2162), backend-coverage
  (2026_05_11) -> new vrt/test_parity.py

Update release_gate_geotiff.rst rows to cite the consolidated homes so
the checklist-parity gate stays green. CLUSTER_AUDIT_VRT_TAIL.md maps
every old file::test to its new home and is deleted before merge.

* Repoint stale release-gate citation after merge with #2463 (#2437)

The georef/rotation cluster (#2463) moved test_no_georef_windowed_coords_1710.py
into read/test_georef.py but left the reader.windowed row in
release_gate_geotiff.rst citing the deleted path. Repoint it so the
checklist-parity gate stays green on the merged branch.

* Delete cluster audit doc before merge (#2437)
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.

Consolidation cluster 11: georef and rotation (long-tail epic #2424)

1 participant