Skip to main content

judge.run_keys

judge.run_keys(protocol, *conditions)

The keys that a run.toml of protocol has when the conditions hold.

Parameters

Name Type Description Default
protocol str "regeneration", "canary" or "score". required
*conditions str Which of "aborted", "completed", "final", "report_error", "wrote" and "unwritten" hold. The keys that are always written need none. ()

Returns

Name Type Description
dict[str, tuple[str, …]] dict[str, tuple[str, …]]: Table name ("run" for the top level) to its keys, in the order of RUN_KEYS; tables without a key are left out.

Raises

Name Type Description
ValueError If protocol is not one of the three.

Examples

from babregen.judge import run_keys

keys = run_keys("score", "completed", "final", "wrote")
print(list(keys))
print(keys["run"])
['run', 'base', 'tool', 'inputs', 'attempt', 'final']
('unit', 'protocol', 'babregen_version', 'started', 'finished', 'status', 'accepted', 'rule')