Initial public release
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
SCRIPT = Path(__file__).parents[2] / "scripts" / "assess_belgium_building_training_iteration.py"
|
||||
SPEC = importlib.util.spec_from_file_location("iteration_assessment", SCRIPT)
|
||||
assert SPEC and SPEC.loader
|
||||
MODULE = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
def test_calibration_selection_prefers_worst_region_then_aggregate() -> None:
|
||||
report = {
|
||||
"sweeps": [
|
||||
{"threshold": 0.1, "pure_empty_false_positives": 0, "aggregate": {"f1": 0.8}, "regions": {"a": {"f1": 0.2}}},
|
||||
{"threshold": 0.2, "pure_empty_false_positives": 0, "aggregate": {"f1": 0.6}, "regions": {"a": {"f1": 0.5}}},
|
||||
]
|
||||
}
|
||||
assert MODULE.select_calibration_threshold(report)["threshold"] == 0.2
|
||||
|
||||
|
||||
def test_threshold_lookup_is_exact() -> None:
|
||||
report = {"sweeps": [{"threshold": 0.25, "aggregate": {}}]}
|
||||
assert MODULE.find_threshold(report, 0.25)["threshold"] == 0.25
|
||||
|
||||
|
||||
def test_release_assessment_rejects_changed_inference_configuration() -> None:
|
||||
calibration = {field: None for field in MODULE.INFERENCE_CONFIG_FIELDS}
|
||||
calibration.update({"model": "/models/candidate.pt", "nms_iou": 0.3, "containment_nms": 0.95})
|
||||
test = dict(calibration)
|
||||
test["nms_iou"] = 0.4
|
||||
with pytest.raises(ValueError, match="nms_iou"):
|
||||
MODULE.assert_same_inference_config(calibration, test, "test")
|
||||
Reference in New Issue
Block a user