From f9d43e3ad99cc36be753bb84ba04d6d3cad29945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Sat, 28 Mar 2026 10:46:42 +0100 Subject: [PATCH] Deal better with additional label errors. --- correction.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/correction.py b/correction.py index d8d8598..ec56a1c 100644 --- a/correction.py +++ b/correction.py @@ -511,11 +511,13 @@ Here is a list of all possible labels. You need to answer with a list one of the tprint(f"\tHandling additional-answer for {pid} {label}") keep_error = False + error = "al:" for add_label in add_labels: if add_label == label: continue if add_label not in all_labels: - tprint(f"\t\t Inexistent label from additional-answer processing {pid} {label}. Ignoring") + tprint(f"\t\t Inexistent label ({add_label}) from additional-answer processing {pid} {label}. Ignoring") + error += f"{add_label}??" keep_error = True continue new_pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{add_label}.pdf" @@ -530,11 +532,13 @@ Here is a list of all possible labels. You need to answer with a list one of the add_label, False)) else: keep_error = True + error += f"{add_label}" tprint(f"\t\tAlready present (not copied) Copie{pid} : {label} -> {add_label}") - if not keep_error: res["error"] = "" + else: + res["error"] = error return new_tasks @@ -585,6 +589,9 @@ def process_single_task(task_tuple): yming, ymaxg, width_r = d_data[pid] pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{label}.pdf" + if !can_spawn_tasks and res["error"] == "additional-answer": + tprint("\tSwallowing an additional-answer from a subsequent task.") + res["error"]= "" if res["error"] != "": tprint("\tError :", res["error"], "for Copie", pid, group_name)