Preserve aspect ratio in false-positive review sheets
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-13 17:20:40 +02:00
parent 1322a5d66a
commit e2ddf84c74
4 changed files with 88 additions and 30 deletions
@@ -112,21 +112,21 @@ def test_detection_quality_evidence_exposes_persisted_detection_provenance() ->
assert properties["tile_index"] == 3
def _write_geotiff(path: Path, *, seed: int) -> None:
def _write_geotiff(path: Path, *, seed: int, width: int = 128, height: int = 128) -> None:
rng = np.random.default_rng(seed)
data = rng.integers(35, 190, size=(3, 128, 128), dtype=np.uint8)
data = rng.integers(35, 190, size=(3, height, width), dtype=np.uint8)
data[:, 32:92, 38:98] = np.array([190, 180, 165], dtype=np.uint8)[:, None, None]
path.parent.mkdir(parents=True, exist_ok=True)
with rasterio.open(
path,
"w",
driver="GTiff",
width=128,
height=128,
width=width,
height=height,
count=3,
dtype="uint8",
crs="EPSG:4326",
transform=from_bounds(5.0, 51.0, 5.01, 51.01, 128, 128),
transform=from_bounds(5.0, 51.0, 5.01, 51.01, width, height),
) as dataset:
dataset.write(data)
@@ -174,7 +174,11 @@ def _write_review_portfolio(tmp_path: Path, *, unsafe_tile: bool = False) -> tup
samples = []
for sample_index, sample_slug in enumerate(("geel", "turnhout")):
tile_path = storage_root / sample_slug / "tile_0000.tif"
_write_geotiff(tile_path, seed=sample_index + 1)
_write_geotiff(
tile_path,
seed=sample_index + 1,
height=80 if sample_slug == "turnhout" else 128,
)
selected_tile = (tmp_path / "outside.tif") if unsafe_tile and sample_slug == "geel" else tile_path
if unsafe_tile and sample_slug == "geel":
_write_geotiff(selected_tile, seed=99)