geotiff tests: consolidate rotated-CRS cluster#2404
Merged
Conversation
Folds three rotated / dropped-CRS test files into a single parametrized file at ``read/test_crs.py`` under the layout established by epic #2390 PR 1: * ``test_allow_rotated_geotiff_2115.py`` * ``test_allow_rotated_crs_drop_2126.py`` * ``test_allow_rotated_no_crs_2122.py`` Parametrizes scenarios as ``rotated_no_crs``, ``rotated_with_crs``, ``axis_aligned_with_crs`` with ``eager`` / ``dask`` backend axes. The GPU eager + dask+CuPy cases stay gated by ``@requires_gpu``. The two cross-file ``_write_rotated_tiff`` consumers (``test_georef_status_2136.py``, ``test_lazy_finalization_parity_2162.py``) now import from ``read/test_crs.py``. The release-gate and reference docs that cite the old filenames are updated to point at the new file. The HTTP rotated test (``test_http_dask_allow_rotated_2130.py``) is left in place; it belongs to PR 9 (integration cluster). ``CLUSTER_AUDIT_PR3.md`` maps every old ``file::test`` to its new ``file::test_id`` and is removed in a follow-up commit before approval. Part of epic #2390.
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
PR Review: geotiff tests: consolidate rotated-CRS cluster
Blockers (must fix before merge)
None.
Suggestions (should fix, not blocking)
None.
Nits (optional improvements)
-
xrspatial/geotiff/tests/read/test_crs.py(the_build_*callers around lines 357 / 374 / 390 / 410): temp filenames are built withf"..._{chunks}.tif"; whenchunks is Nonethis writes literal_None.tifpaths under pytest's tmp_path. Functional but a bit ugly. Worth swapping for the test ID label ("eager"/"dask") via a small lookup. -
xrspatial/geotiff/tests/read/test_crs.py:_build_rotated_no_crsreturns(src, arr)but the default-raises tests discardarr. Trivial;src, _ = ...would make the intent obvious. Same shape in_build_axis_aligned_with_crs. -
xrspatial/geotiff/tests/CLUSTER_AUDIT_PR3.md: the audit table lumps the two dropped HTTP cases as "covered by PR 9". Correct, but naming the specific tests intest_http_dask_allow_rotated_2130.py(e.g.test_http_dask_rotated_default_raises,test_http_dask_rotated_allow_rotated_reads) would make the trail explicit so a future reviewer does not have to open the integration file to confirm.
What looks good
- Parametrization is the right shape:
(scenario, chunks)with descriptive IDs (rotated_no_crs,rotated_with_crs,axis_aligned_with_crscrossed witheager/dask), and GPU variants stay behind@requires_gpuwithout bleeding the import gate into the rest of the file. - Both rotated TIFF writers are preserved as distinct test paths rather than collapsed: hand-rolled with the full
_GEO_KEYS_4326block, and the tifffile-based one with a Geographic-only GeoKey. Different GeoKey-parser branches; worth keeping both. - Unit tests for
_extract_transformand_populate_attrs_from_geo_infoare parametrized over the attrs they assert on (crs/crs_wkt/transform), which is cleaner than the original three-separate-functions layout. - Cross-file consumers of
_write_rotated_tiff(test_georef_status_2136.py,test_lazy_finalization_parity_2162.py) are updated to import from the new module, with a relocation comment citing the epic PR. The two doc paths (release_gate_geotiff.rst,geotiff.rst) that cited the old filenames also point at the new location. - 5705 passing on the full geotiff suite locally; file count moves -2 as the epic intended.
Checklist
- Algorithm matches reference/paper (N/A: tests-only restructure)
- All implemented backends produce consistent results (eager / dask / GPU eager / dask+CuPy covered)
- NaN handling is correct (N/A)
- Edge cases are covered by tests (axis-aligned regression guard preserved)
- Dask chunk boundaries handled correctly (
chunks=2exercised across all rotated cases) - No premature materialization or unnecessary copies (N/A)
- Benchmark exists or is not needed (N/A)
- README feature matrix updated (N/A)
- Docstrings present and accurate (module docstring plus per-test docstrings preserved or improved)
- CLUSTER_AUDIT_PR3.md present; will be removed in follow-up commit
Three nits from /review-pr applied: * Add ``_chunks_label`` helper so tmp_path filenames read ``..._eager.tif`` / ``..._dask.tif`` instead of literal ``..._None.tif`` / ``..._2.tif``. * Use ``src, _ = ...`` in the default-raises and axis-aligned tests so the unused fixture return is explicit. * Spell out the specific PR 9 test names that supersede the two dropped HTTP cases in ``CLUSTER_AUDIT_PR3.md`` so the trail is explicit without opening the integration file. All 22 ``read/`` tests still pass.
The audit is a review artifact, not a documentation deliverable. Git history and the PR description retain the trail mapping old test files to ``read/test_crs.py`` IDs. Part of epic #2390.
brendancol
commented
May 26, 2026
Contributor
Author
brendancol
left a comment
There was a problem hiding this comment.
Follow-up review
All three nits from the prior review are addressed in 89d0078:
- Filename labels: new
_chunks_labelhelper mapsNonetoeagerand2todask, so tmp_path now contains..._eager.tif/..._dask.tifinstead of..._None.tif. Applied across all five parametrized cases that previously interpolated the rawchunksvalue (the no-CRS default-raises, no-CRS optin-reads, rotated-with-CRS hand-rolled, rotated-with-CRS geokey-only, GPU, and the VRT pair). - Unused-binding cleanup:
src, _ = _build_*(...)in the default-raises and axis-aligned tests so it is obvious the array fixture is intentionally unused at those sites. - Audit specifics:
CLUSTER_AUDIT_PR3.mdnow names the two replacing PR 9 tests (test_http_dask_rotated_default_raises,test_http_dask_rotated_allow_rotated_reads) on the dropped HTTP rows.
The audit file was then removed in 283b600 before approval, per the epic plan. The 22 read/ tests still pass locally.
No new findings on the follow-up pass.
7 tasks
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
Folds three rotated / dropped-CRS test files into a single parametrized file at
xrspatial/geotiff/tests/read/test_crs.pyunder the layout from epic #2390 PR 1.Files folded:
test_allow_rotated_geotiff_2115.pytest_allow_rotated_crs_drop_2126.pytest_allow_rotated_no_crs_2122.pyThe HTTP rotated test (
test_http_dask_allow_rotated_2130.py) is left for PR 9 (integration).What changed
read/__init__.pyandread/test_crs.pywith 22 parametrized tests over(scenario, chunks)wherescenarioisrotated_no_crs/rotated_with_crs/axis_aligned_with_crsandchunksiseager/dask.@requires_gpu.chunksaxis._write_rotated_tiff(test_georef_status_2136.py,test_lazy_finalization_parity_2162.py) now import from the new module.read/test_crs.py.Audit
CLUSTER_AUDIT_PR3.mdmaps every oldfile::testto its newfile::test_id. Two HTTP cases from 2115 were dropped; the same coverage already exists intest_http_dask_allow_rotated_2130.py(PR 9 cluster). The audit file is deleted on a follow-up commit before approval.Test plan
pytest xrspatial/geotiff/tests/read/ -v: 22 passedpytest xrspatial/geotiff/tests/ -x -q: 5705 passed, 68 skippedCloses #2396. Part of epic #2390.