Answer architecture round 1: delete question-bench, keep its run's results in item 77 citing the commit that held it, and correct item 85's mention of item 78
This commit is contained in:
@@ -22,29 +22,17 @@ class ScoringRun:
|
||||
heading: str
|
||||
commit: str
|
||||
places: list[Place]
|
||||
overall: float | None
|
||||
|
||||
|
||||
def scoring_runs(history: str) -> list[ScoringRun]:
|
||||
"""Each scoring run in a comprehension history, with the places its seats named, as they wrote them, and the seats' mean overall score; paired rulings name what changed, not what is hard, and are left out."""
|
||||
"""Each scoring run in a comprehension history, with the places its seats named, as they wrote them; paired rulings name what changed, not what is hard, and are left out."""
|
||||
runs = []
|
||||
for heading, bodies in sections(history).items():
|
||||
if (named := RUN.match(heading)) and ", against " not in heading:
|
||||
runs.append(ScoringRun(heading, named.group(3), [place for body in bodies for place in seat_places(body)], mean_overall("\n".join(bodies))))
|
||||
runs.append(ScoringRun(heading, named.group(3), [place for body in bodies for place in seat_places(body)]))
|
||||
return runs
|
||||
|
||||
|
||||
def mean_overall(body: str) -> float | None:
|
||||
"""The last cell of the table's `Mean` row."""
|
||||
for line in body.splitlines():
|
||||
if line.startswith("| Mean |"):
|
||||
try:
|
||||
return float(line.strip().strip("|").split("|")[-1])
|
||||
except ValueError:
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def seat_places(body: str) -> list[Place]:
|
||||
places = []
|
||||
listing = False
|
||||
|
||||
Reference in New Issue
Block a user