fix: bound detection QA to inference coverage
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 00:35:39 +02:00
parent 2f9898bc82
commit 0cad8fdf76
12 changed files with 159 additions and 45 deletions
+7 -2
View File
@@ -129,9 +129,14 @@ class DetectionQaService:
def filter_population(
geometries: list[tuple[dict[str, Any], BaseGeometry]],
coverage: DetectionQaCoverage,
*,
raw_count: int | None = None,
) -> CoveragePopulation:
evaluated: list[tuple[dict[str, Any], BaseGeometry]] = []
excluded_outside_count = 0
resolved_raw_count = len(geometries) if raw_count is None else raw_count
if resolved_raw_count < len(geometries):
raise ValueError("raw_count cannot be smaller than the supplied geometry population")
excluded_outside_count = resolved_raw_count - len(geometries)
clipped_boundary_count = 0
for feature, geometry in geometries:
@@ -157,7 +162,7 @@ class DetectionQaService:
return CoveragePopulation(
geometries=evaluated,
raw_count=len(geometries),
raw_count=resolved_raw_count,
evaluated_count=len(evaluated),
excluded_outside_count=excluded_outside_count,
clipped_boundary_count=clipped_boundary_count,