Skip to content

geotiff tests: consolidate overview cluster#2456

Merged
brendancol merged 4 commits into
mainfrom
worktree-agent-a7a0ded3828ce4bdd
May 26, 2026
Merged

geotiff tests: consolidate overview cluster#2456
brendancol merged 4 commits into
mainfrom
worktree-agent-a7a0ded3828ce4bdd

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #2432. Cluster 8 of the long-tail GeoTIFF test consolidation epic (#2424).

Summary

Fold ten top-level overview files into the write-side and read-side overview suites. One PR, since the diff stays clean.

Write-side -> extended xrspatial/geotiff/tests/write/test_overview.py:

  • test_overview_block_order_2308.py
  • test_overview_levels_decimation_factors_1766.py
  • test_overview_nodata_inheritance_1739.py
  • test_overview_pixel_is_point_1642.py
  • test_overview_resampling_min_max_median_2026_05_11.py
  • test_mode_overview_perf.py

Read-side -> new xrspatial/geotiff/tests/read/test_overview.py:

  • test_overview_filter.py
  • test_overview_geo_inheritance_1640.py
  • test_overview_level_type_validation_2074.py
  • test_overview_level_validation_backends_2160.py

Each file becomes a # Section: block in the target, matching the convention already used in write/test_overview.py. Module-level helpers that collided across files were renamed (e.g. the _write_cog_with_one_overview / cog_with_overview pair from the 2074 and 2160 files are namespaced per issue). No test bodies or assertions changed.

test_overview_filter.py exercises select_overview_ifd and open_geotiff(overview_level=...), so it lands on the read side next to the other IFD-selection coverage rather than in the write-side file the issue tentatively listed it under. The audit file records this.

The two GPU overview files (test_gpu_writer_overview_inplace_1948.py, test_gpu_writer_overview_mode_and_compression_level_1740.py) are left in place for the GPU cluster (#2438).

Audit

xrspatial/geotiff/tests/CLUSTER_AUDIT_OVERVIEW.md maps every old file::test to its new file::test. The audit file is deleted on a final commit on this branch before merge.

Verification

  • pytest xrspatial/geotiff/tests/write/test_overview.py -q: 328 passed.
  • pytest xrspatial/geotiff/tests/read/test_overview.py -q: 60 passed.
  • pytest xrspatial/geotiff/tests/ -x -q: 5815 passed, 68 skipped, 2 xfailed.
  • find xrspatial/geotiff/tests -name 'test_*.py' | wc -l: 235 (was 244; -10 deleted +1 added).

Test plan

  • New read/test_overview.py passes on this checkout.
  • Extended write/test_overview.py passes.
  • Full xrspatial/geotiff/tests/ suite passes.
  • CI green across numpy / cupy / dask+numpy / dask+cupy.
  • Audit file deleted on the pre-merge commit.

Tests-only -- no source changes.

Fold ten top-level overview test files into the write-side and read-side
overview suites for cluster 8 of epic #2424.

Write-side -> write/test_overview.py (extended):
- test_overview_block_order_2308.py
- test_overview_filter.py is read-side; see note below
- test_overview_levels_decimation_factors_1766.py
- test_overview_nodata_inheritance_1739.py
- test_overview_pixel_is_point_1642.py
- test_overview_resampling_min_max_median_2026_05_11.py
- test_mode_overview_perf.py

Read-side -> read/test_overview.py (new):
- test_overview_filter.py
- test_overview_geo_inheritance_1640.py
- test_overview_level_type_validation_2074.py
- test_overview_level_validation_backends_2160.py

The two GPU overview files stay put; they belong to the GPU cluster
(#2438). CLUSTER_AUDIT_OVERVIEW.md maps every old file::test to its new
home and is deleted on a pre-merge commit.

Tests-only. No source changes.
@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 overview cluster

Tests-only consolidation. I checked it as a behavior-preserving move rather than a logic change.

Blockers

None.

Suggestions

None.

Nits

  • write/test_overview.py keeps several imports inside their sections (lines 1361, 1494-1495, 1820, 2100, 2592) with # noqa: E402 rather than hoisting them to the module header. That is a defensible choice for an auditable move and the noqa is correct, but a follow-up could lift them to the top once the dust settles. Not worth churning the diff for now.

What looks good

  • Test-count parity is exact: 102 test functions across the ten source files, 58 added to write/test_overview.py and 44 in the new read/test_overview.py, 102 total. No test dropped or duplicated.
  • Sample test bodies diff clean against the originals. The only deltas are the intended ones: STEM -> _STEM_1766 and the colliding _write_cog_with_one_overview / cog_with_overview pair namespaced per issue (_2074 / _2160), plus a couple of imports moved local. Assertions are untouched.
  • test_overview_filter.py lands on the read side next to the other IFD-selection coverage, which matches its actual call surface (select_overview_ifd, open_geotiff(overview_level=...)); the audit file records the divergence from the issue's tentative write-side listing.
  • The two GPU overview files are left in place for the GPU cluster (#2438), as scoped.
  • Full suite green: pytest xrspatial/geotiff/tests/ -x -q -> 5815 passed, 68 skipped, 2 xfailed. File count 244 -> 235.

Checklist

  • No source changes; behavior preserved
  • All backends still parametrized (numpy / dask+numpy / cupy / dask+cupy)
  • NaN / sentinel handling tests carried over unchanged
  • Edge cases (odd shapes, 1x1, all-sentinel) carried over
  • Temporary files uniquely named per section
  • No duplicate test or fixture names within either target
  • CI green across backends (pending)
  • Audit file present; scheduled for deletion pre-merge

Per epic #2424, the per-cluster audit mapping is removed once the
consolidation is in place.
The CI fast lane installs only `.[tests]`, which does not include
tifffile. The consolidated read/test_overview.py used a bare
`import tifffile` inside the IFD-builder helpers, so those tests raised
ModuleNotFoundError instead of skipping. The original
test_overview_filter.py guarded with pytest.importorskip; restore that
behaviour by importing tifffile through importorskip in every helper
that hand-builds a TIFF.
@brendancol brendancol merged commit e9c897f into main May 26, 2026
6 of 7 checks passed
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 8: overview (long-tail epic #2424)

1 participant