feat(accuracy): build hardened phase 4 evaluation harness
This commit is contained in:
@@ -35,11 +35,12 @@ def test_regional_dataset_balances_contexts_and_keeps_validation_closed() -> Non
|
||||
assert evidence["protected_samples_in_training"] == []
|
||||
|
||||
|
||||
def test_regional_dataset_rejects_protected_tiles() -> None:
|
||||
@pytest.mark.parametrize("protected_split", ["calibration", "test", "background-test", "challenge"])
|
||||
def test_regional_dataset_rejects_protected_tiles(protected_split: str) -> None:
|
||||
manifest = {"samples": [
|
||||
{"sample_slug": "f-cal", "region": "flanders", "split": "calibration", "context": "ribbon"},
|
||||
{"sample_slug": "f-cal", "region": "flanders", "split": protected_split, "context": "ribbon"},
|
||||
]}
|
||||
summary = {"tiles": [{"sample_slug": "f-cal", "split": "calibration", "image_path": "/cal.png"}]}
|
||||
summary = {"tiles": [{"sample_slug": "f-cal", "split": protected_split, "image_path": "/cal.png"}]}
|
||||
with pytest.raises(ValueError, match="protected"):
|
||||
module.build(
|
||||
summary=summary, manifest=manifest, region="flanders",
|
||||
|
||||
@@ -114,8 +114,9 @@ def test_classify_proposals_consumes_reference_once() -> None:
|
||||
assert [item[0] for item in miner.classify_proposals(proposals, reference, 0.25)] == ["positive", "negative"]
|
||||
|
||||
|
||||
def test_eligible_tiles_rejects_protected_manifest_split() -> None:
|
||||
manifest = {"samples": [{"sample_slug": "x", "region": "flanders", "split": "test"}]}
|
||||
@pytest.mark.parametrize("protected_split", ["calibration", "test", "background-test", "challenge"])
|
||||
def test_eligible_tiles_rejects_protected_manifest_split(protected_split: str) -> None:
|
||||
manifest = {"samples": [{"sample_slug": "x", "region": "flanders", "split": protected_split}]}
|
||||
summary = {"tiles": [{"sample_slug": "x", "split": "train", "image_path": "x.png"}]}
|
||||
with pytest.raises(ValueError, match="protected"):
|
||||
miner.eligible_tiles(summary, manifest, "flanders")
|
||||
|
||||
Reference in New Issue
Block a user