Answer stability round 1: 1 🔴, 0 🟡; sort record.py's imports and build the tally after the surplus check
This commit is contained in:
@@ -6,11 +6,11 @@ from comprehension_history import appended, DIMENSIONS, FLOOR, heading, Heading,
|
|||||||
from git_repo import commit_exists, top
|
from git_repo import commit_exists, top
|
||||||
from larv_review.ruling import counted, overall, ruling, split, surplus, votes
|
from larv_review.ruling import counted, overall, ruling, split, surplus, votes
|
||||||
from failure import Failure
|
from failure import Failure
|
||||||
|
from larv_review.seats import FIRST_SEATS, scores, seats_file, SeatsFile
|
||||||
from larv_review.scoring import means, under_floor
|
from larv_review.scoring import means, under_floor
|
||||||
from larv_review.plan import plan_reasons
|
from larv_review.plan import plan_reasons
|
||||||
import rank_todo
|
import rank_todo
|
||||||
from file_writes import replace_file
|
from file_writes import replace_file
|
||||||
from larv_review.seats import FIRST_SEATS, scores, seats_file, SeatsFile
|
|
||||||
|
|
||||||
|
|
||||||
def record_ruling(votes_file: pathlib.Path) -> Failure | None:
|
def record_ruling(votes_file: pathlib.Path) -> Failure | None:
|
||||||
@@ -22,10 +22,10 @@ def record_ruling(votes_file: pathlib.Path) -> Failure | None:
|
|||||||
if isinstance(written, Failure):
|
if isinstance(written, Failure):
|
||||||
return written
|
return written
|
||||||
counts = counted(seats_read.seats, written)
|
counts = counted(seats_read.seats, written)
|
||||||
tally = ", ".join(f"{seat.name} {vote_text(DIMENSIONS[-1], overall(written[seat.name]), overall(counts[seat.name]))}" for seat in seats_read.seats)
|
|
||||||
overall_votes = [overall(each) for each in counts.values()]
|
overall_votes = [overall(each) for each in counts.values()]
|
||||||
if surplus(overall_votes):
|
if surplus(overall_votes):
|
||||||
return Failure(f"{' and '.join(FIRST_SEATS)} both count as {overall_votes[0]} overall, which settles the ruling; drop the other seats' lines")
|
return Failure(f"{' and '.join(FIRST_SEATS)} both count as {overall_votes[0]} overall, which settles the ruling; drop the other seats' lines")
|
||||||
|
tally = ", ".join(f"{seat.name} {vote_text(DIMENSIONS[-1], overall(written[seat.name]), overall(counts[seat.name]))}" for seat in seats_read.seats)
|
||||||
if split(overall_votes):
|
if split(overall_votes):
|
||||||
print(f"Split: {tally}. Launch the maintainability senior and Junior A together, add their lines to the votes file, and run this again.")
|
print(f"Split: {tally}. Launch the maintainability senior and Junior A together, add their lines to the votes file, and run this again.")
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user