Minor fixes

This commit is contained in:
Jake Poznanski 2025-02-28 15:10:51 -08:00
parent 361ed2a038
commit 1148b475e9
2 changed files with 4 additions and 3 deletions

View File

@ -134,7 +134,7 @@ def compare_votes_for_file(base_pdf_file: str, base_pdf_page: int, base_text: st
diff_entry = {
"base": b_sentence,
"variants": Counter(variant_votes),
"vote_count": len(variant_votes)
"vote_count": len(variant_votes),
}
diffs.append(diff_entry)
@ -186,7 +186,7 @@ def main():
parser.add_argument(
"--max-diffs",
type=int,
default=4,
default=5,
help="Maximum number of diffs to display per file."
)
parser.add_argument(
@ -228,7 +228,6 @@ def main():
# Output test candidates for review after each file, in case there are errors
save_tests(all_tests, args.output)
break
if __name__ == "__main__":
main()

View File

@ -42,6 +42,8 @@ class BasePDFTest:
checked: Optional[TestChecked] = None
def __post_init__(self):
self.threshold = float(self.threshold)
if not self.pdf:
raise ValidationError("PDF filename cannot be empty")
if not self.id: