Repository navigation
test: Add the CRS conformance suite from geotiff-test-data - #181
Conversation
…driven builder Design for making GeoKey -> CRS parsing match GDAL/PROJ: a shared conformance corpus and CT table in geotiff-test-data, and a rewrite of _crs.py that interprets the table with pyproj's typed constructors. Written before any code so the manifest schema, table schema, equality definition and known-failures mechanism can be reviewed first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Also records the async-tiff issue/PR in the spec and switches GeoKey names to the no-suffix form and axes to a direction list, so the plan and spec agree. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Found by the corpus review: libgeotiff reads only ProjScaleAtNatOrigin for CT 7, and PROJ gives Polar Stereographic south/south or north/north axes by the sign of the latitude. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Also adds the stage 3 plan. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The JSON ships in the wheel under async_geotiff/data for the table-driven builder. pytest now collects only tests/, since the geotiff-test-data submodule carries its own suite with its own dependencies. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every row of the geotiff-test-data CRS manifest is opened and its CRS compared to GDAL's with pyproj equivalence (ignoring geographic axis order, as rasterio does), then by projecting the manifest's test point with both CRSs. 34 rows fail against the current builder and are listed as strict xfails so the list can only shrink; two EPSG-coded rows differ only by proj.db version and are non-strict. The submodule bump also brought the corrected predictor-2 fixture, which async-tiff 0.7.0 decodes wrongly on partial tiles; the two read tests for it are strict xfails until async-tiff is fixed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
We should include specs but not plans. let's gitignore the plan folder
There was a problem hiding this comment.
Note
This comment was written by Claude (Claude Code), not by @kylebarron.
Done: dev-docs/plans/ is now in .gitignore and both plan files are removed from the branch (they stay on disk locally). The spec remains under dev-docs/specs/.
🤖 Written by Claude Code
| # for; this fixture now really carries predictor 2, and async-tiff 0.7.0 | ||
| # reverses it wrongly on the partial last tile column (300 wide, 128 tiles). |
There was a problem hiding this comment.
is this fixed in 0.7.2? Or should we create an upstream issue?
There was a problem hiding this comment.
Note
This comment was written by Claude (Claude Code), not by @kylebarron.
It is fixed in 0.7.2: the test passes with async-tiff==0.7.2 and fails with 0.7.0. So instead of the xfail, this PR now bumps the floor to async-tiff>=0.7.2 (lock updated) and the two read tests run normally again. I had filed developmentseed/async-tiff#370 before checking; closed it with that finding.
🤖 Written by Claude Code
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Specs are committed under dev-docs/specs; plans are working notes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…iles The corrected predictor-2 fixture from geotiff-test-data decodes correctly with 0.7.2, so the read tests need no xfail. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| dependencies = [ | ||
| "affine>=2.4.0", | ||
| "async-tiff>=0.7.0", | ||
| "async-tiff>=0.7.2", |
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
Stage 3 of the GeoKey-to-CRS work: the test harness, with no changes to
_crs.pyyet. The design is indev-docs/specs/2026-10-26-geokey-crs-conformance-design.md(also in this PR, with the stage plans) and the corpus landed in developmentseed/geotiff-test-data#84.Changes
35da663, which carriescrs/(98 GDAL-written fixtures, manifest, CT table).tests/test_crs_conformance.py: one parametrized test per manifest row. Opens the fixture, assertsexpected.equals(geotiff.crs, ignore_axis_order=True)against GDAL's PROJJSON, then projects the manifest's test point with both CRSs in this environment's PROJ and compares. Rows the manifest flags are skipped (2).KNOWN_FAILURESlists the 34 rows that fail against today's builder, grouped by cause (rejected CT codes, PROJJSON PROJ rejects, wrong variant, origin/scale keys, units, axes, datum/PM/TOWGS84, ESRI PE String), eachxfail(strict=True): a fix that makes a row pass fails the run until the row is removed.REGISTRY_DRIFTholds two EPSG-coded rows that differ only by proj.db version between this venv's PROJ 9.5 and the generator's 9.8; they are non-strict.src/async_geotiff/data/geotiff-ct-methods.jsonfor the stage 4 builder, with a test that it equals the submodule copy (verified it ships in the wheel).[tool.pytest.ini_options] testpaths = ["tests"]: the submodule now has its own test suite with its own dependencies, which barepytestwas collecting.tests/test_read.py: the bump also brings geotiff-test-data#74, which madewrite_cogactually apply predictor 2;uint8_1band_deflate_block128_unaligned_predictor2now really has it, and async-tiff 0.7.0 decodes the partial last tile column wrongly (first mismatch at row 1, col 260 of the 300-wide image). The two full-read tests for that fixture are strict xfails. This needs an async-tiff issue; I was not able to file it from this session.Numbers
uv run pytest: 435 passed, 4 skipped, 36 xfailed. Ruff clean.Two findings from building the harness, recorded in the spec: strict geographic axis order would have failed every row the current builder writes latitude-first (rasterio accepts those), so the comparison ignores geographic axis order like rasterio does; and the manifest's own
x, ycannot be used directly here because Equidistant Cylindrical moved 5.9 km between PROJ 9.5 and 9.8, so the test projects with both CRSs instead.Next: stage 4, the table-driven rewrite of
_crs.py, which should emptyKNOWN_FAILURESdown to the rows that need the async-tiff release with keys 2062/3096 (developmentseed/async-tiff#368) and the GDAL prime-meridian-in-grads row.🤖 Written by Claude Code
🤖 Generated with Claude Code