Matthew Ford
feat: v11.6 repair/enrichment scripts + independent-candidate prep + integrity tests
1bb570d | import importlib.util | |
| import json | |
| from pathlib import Path | |
| PATH = Path(__file__).parents[1] / "scripts" / "prepare_independent_candidate.py" | |
| SPEC = importlib.util.spec_from_file_location("prepare_independent_candidate", PATH) | |
| MOD = importlib.util.module_from_spec(SPEC) | |
| SPEC.loader.exec_module(MOD) | |
| def test_identity_prefers_registry_key_and_normalizes_case(): | |
| assert MOD.identity({"cas": " 106-22-9 ", "smiles": "ignored"}) == "106-22-9" | |
| assert MOD.identity({"smiles": " cco "}) == "CCO" | |
| def test_protocol_forbids_reusing_frozen_evaluation(): | |
| protocol = json.loads( | |
| (Path(__file__).parents[1] / "artifacts" / "pimt_candidate_20260716_a_evaluation_protocol.json").read_text() | |
| ) | |
| assert protocol["status"].startswith("preregistered_before_training") | |
| assert len(protocol["separation"]["candidate_must_not_be_scored_on"]) == 3 | |
| assert protocol["fresh_evaluation"]["one_confirmatory_run"] is True | |