evaluate models on fresh regional calibration AOIs
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-08-09 22:36:27 +02:00
parent 116b8e291e
commit b068a5e065
28 changed files with 5053 additions and 18 deletions
@@ -1,4 +1,9 @@
from scripts.provision_belgium_building_training_portfolio import AOIS
import json
from pathlib import Path
import pytest
from scripts.provision_belgium_building_training_portfolio import AOIS, load_custom_aois
V63_CANDIDATES = {
@@ -32,3 +37,57 @@ def test_v66_lowrise_candidates_are_flemish_train_role_inputs() -> None:
assert all(aoi.region == "flanders" for aoi in candidates.values())
assert all(aoi.split == "train" for aoi in candidates.values())
assert all("lowrise" in aoi.context for aoi in candidates.values())
def test_custom_aoi_spec_loads_non_protected_calibration(tmp_path: Path) -> None:
spec = tmp_path / "aois.json"
spec.write_text(
json.dumps(
{
"aois": [
{
"slug": "fresh-rural-cal",
"region": "wallonia",
"context": "rural-lowrise",
"split": "calibration",
"lon": 5.25,
"lat": 50.25,
}
]
}
),
encoding="utf-8",
)
result = load_custom_aois(spec)
assert len(result) == 1
assert result[0].slug == "fresh-rural-cal"
assert result[0].split == "calibration"
@pytest.mark.parametrize("split", ["test", "background-test"])
def test_custom_aoi_spec_rejects_protected_splits(
tmp_path: Path, split: str
) -> None:
spec = tmp_path / "aois.json"
spec.write_text(
json.dumps(
{
"aois": [
{
"slug": "forbidden",
"region": "flanders",
"context": "urban",
"split": split,
"lon": 4.5,
"lat": 51.0,
}
]
}
),
encoding="utf-8",
)
with pytest.raises(SystemExit, match="protected/unsupported split"):
load_custom_aois(spec)