INNER CODE UNIT · Python
partition_groups
ayghri/i-have-adhd · scripts/judge.py:26
def partition_groups(
groups: dict[tuple, dict[str, str]], required: set[str]
) -> tuple[list[tuple], list[tuple]]:
"""Split groups into those covering every required condition and those not.
Conditions are only comparable when judged on identical rows, so a group
that is missing a condition cannot be scored. Callers report the incomplete
ones rather than dropping them quietly.
"""
complete, incomplete = [], []
for key, responses in groups.items():
target = complete if required.issubset(responses) else incomplete
target.append(key)
return complete, incomplete
def grader_rubric(rubric: str) -> str:
"""Return only the grader-facing slice of the rubric document.