Harden operator tile background metadata
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-11 15:52:45 +02:00
parent 5d24242fb4
commit b3bd34c384
4 changed files with 97 additions and 2 deletions
@@ -147,3 +147,27 @@ def test_background_negative_repeat_only_applies_to_training_background_tiles()
split="train",
background_negative_repeat=4,
) == 1
def test_background_category_is_derived_for_legacy_operator_manifests() -> None:
module = load_tile_exporter()
pure_empty_sample = {
"sample_slug": "postel_bos",
"sample_role": "background_candidate",
"reference_feature_count": 0,
}
sparse_context_sample = {
"sample_slug": "kasterlee_bos",
"sample_role": "background_candidate",
"reference_feature_count": 104,
}
reference_sample = {
"sample_slug": "geel",
"sample_role": "reference",
"reference_feature_count": 2500,
}
assert module.background_category_for_sample(pure_empty_sample) == "pure_empty_negative"
assert module.background_category_for_sample(sparse_context_sample) == "sparse_building_context"
assert module.background_category_for_sample(reference_sample) == "reference_aoi"