Skip to content

Add tests for PAM sidecar reader edges and symbology dask stats#3605

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-geotiff-2026-07-02
Jul 2, 2026
Merged

Add tests for PAM sidecar reader edges and symbology dask stats#3605
brendancol merged 1 commit into
mainfrom
deep-sweep-test-coverage-geotiff-2026-07-02

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Test-coverage sweep of the geotiff subpackage. Test-only, no source changes.

PAM sidecar reader edges

New tests/unit/test_pam_reader_edges.py. The round-trip write tests always emit a full thematic RAT, so four fall-through paths in _parse_rat / read_pam_sidecar were never hit:

  • a thematic RAT with no Name column returns {} (not a bogus name list),
  • a named RAT with zero rows falls back to the <CategoryNames> list,
  • <CategoryNames> with no RAT at all,
  • a <FieldDefn> missing its <Usage> element is skipped.

This takes _pam.py to full branch coverage.

Symbology dask statistics

Added to write/test_symbology_sidecar_3537.py. _dask_finite_stats had only run with nodata=None, leaving these untested:

  • the sentinel-exclusion where-mask on the dask path,
  • the dask all-NaN count == 0 -> None branch,
  • StreamingStats over integer buffers, with and without a sentinel.

The dask+cupy leg ran and passed on a CUDA host.

Coverage

Measured branch coverage over geotiff/tests/ plus the top-level geotiff-touching tests with NUMBA_DISABLE_JIT=1. Source-only (excluding the four GPU-only files, which pytest-cov cannot instrument here because numba's CUDA target registration collides with the coverage hook) line+branch coverage moved from 90.9% to 91.1%; _pam.py reached 100% and _symbology.py has only the low-priority 3D-without-band-dim edge left.

Also adds the branch_cov column to the sweep state CSV and records the geotiff row.

Test-coverage sweep of the geotiff subpackage; test-only, no source changes.

read_pam_sidecar edges (new tests/unit/test_pam_reader_edges.py): the
round-trip write tests always emit a full thematic RAT, so four fall-through
paths in _parse_rat / read_pam_sidecar were never hit: a RAT with no Name
column returns {}, a named RAT with zero rows falls back to CategoryNames,
CategoryNames with no RAT at all, and a FieldDefn missing its Usage element
is skipped. This takes _pam.py to full branch coverage.

_symbology dask stats (added to write/test_symbology_sidecar_3537.py):
_dask_finite_stats had only run with nodata=None, so the sentinel-exclusion
where-mask, the dask all-NaN count==0 -> None branch, and StreamingStats over
integer buffers (with and without a sentinel) were untested. The dask+cupy
leg ran and passed on a CUDA host.

Also adds the branch_cov column to the sweep state CSV and records the
geotiff row.
@brendancol brendancol merged commit 6b0887f into main Jul 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant