Add tests for PAM sidecar reader edges and symbology dask stats#3605
Merged
Conversation
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.
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.
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_sidecarwere never hit:{}(not a bogus name list),<CategoryNames>list,<CategoryNames>with no RAT at all,<FieldDefn>missing its<Usage>element is skipped.This takes
_pam.pyto full branch coverage.Symbology dask statistics
Added to
write/test_symbology_sidecar_3537.py._dask_finite_statshad only run withnodata=None, leaving these untested:where-mask on the dask path,count == 0 -> Nonebranch,StreamingStatsover 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 withNUMBA_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.pyreached 100% and_symbology.pyhas only the low-priority 3D-without-band-dim edge left.Also adds the
branch_covcolumn to the sweep state CSV and records the geotiff row.