Audit Belgian corpus splits and record CUDA evidence
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-07-26 22:29:02 +02:00
parent 68d3fa34e3
commit 7a83df1e7f
5 changed files with 116 additions and 12 deletions
@@ -15,6 +15,13 @@ assert SPEC and SPEC.loader
module = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(module)
ASSEMBLER_SPEC = importlib.util.spec_from_file_location(
"assemble_building_corpus", ROOT / "scripts" / "assemble_belgium_building_corpus.py"
)
assert ASSEMBLER_SPEC and ASSEMBLER_SPEC.loader
assembler = importlib.util.module_from_spec(ASSEMBLER_SPEC)
ASSEMBLER_SPEC.loader.exec_module(assembler)
def test_normalizer_retains_native_identity_and_records_rejections(tmp_path: Path) -> None:
raster_path = tmp_path / "image.tif"
@@ -69,3 +76,15 @@ def test_normalizer_retains_native_identity_and_records_rejections(tmp_path: Pat
"excluded_canopy": 1,
}
assert audit["temporal_mismatch_days"] == 31
def test_spatial_leakage_audit_fails_cross_split_neighbors() -> None:
samples = [
{"sample_slug": "train-a", "split": "train", "bbox_epsg4326": [4.0, 50.0, 4.01, 50.01]},
{"sample_slug": "val-a", "split": "val", "bbox_epsg4326": [4.005, 50.005, 4.02, 50.02]},
{"sample_slug": "test-far", "split": "test", "bbox_epsg4326": [5.0, 51.0, 5.01, 51.01]},
]
audit = assembler.audit_spatial_leakage(samples)
assert audit["status"] == "failed"
assert audit["findings"][0]["left"] == "train-a"
assert audit["findings"][0]["right"] == "val-a"