Expand YOLO training AOIs safely
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-12 23:42:29 +02:00
parent 53cd38a5b2
commit 0f49c980ba
11 changed files with 310 additions and 7 deletions
@@ -6,6 +6,7 @@ import subprocess
import sys
import numpy as np
import pytest
ROOT = Path(__file__).resolve().parents[2]
@@ -75,6 +76,30 @@ def test_operator_yolo_tile_dataset_export_help_does_not_require_gis_dependencie
assert "--blank-range-threshold" in result.stdout
def test_default_validation_split_is_explicit_and_rejects_holdout_leakage() -> None:
module = load_tile_exporter()
samples = [
{"sample_slug": "geel", "recommended_split": "train"},
{"sample_slug": "turnhout", "recommended_split": "val"},
{"sample_slug": "retie", "recommended_split": "val"},
{"sample_slug": "westerlo", "recommended_split": "val"},
{"sample_slug": "arendonk_heide", "recommended_split": "val"},
]
assert module.DEFAULT_VALIDATION_SAMPLE_SLUGS == frozenset(
{"turnhout", "retie", "westerlo", "arendonk_heide"}
)
assert module.validate_validation_split(
samples,
set(module.DEFAULT_VALIDATION_SAMPLE_SLUGS),
) == set(module.DEFAULT_VALIDATION_SAMPLE_SLUGS)
with pytest.raises(SystemExit, match="recommended validation holdouts"):
module.validate_validation_split(samples, {"turnhout"})
with pytest.raises(SystemExit, match="unknown samples"):
module.validate_validation_split(samples, {"turnhout", "missing"})
def test_iter_tile_windows_covers_edges_without_duplicates() -> None:
module = load_tile_exporter()