From b8a93afdf1d7ae6065979f9d76755a98d8ca9f25 Mon Sep 17 00:00:00 2001 From: Quentin CAUDRON Date: Tue, 7 Nov 2023 10:33:04 -0800 Subject: [PATCH] Tweaks to scoring --- assets/programming_files/d878.zip | Bin 7683 -> 7683 bytes assets/templates/personal_results.md | 4 ++-- index.md | 2 +- scripts/score.py | 13 +++++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/assets/programming_files/d878.zip b/assets/programming_files/d878.zip index 152a0f58ea11a1621b116783933fcd3da832a234..70bbb7f719c7461a4d9cdc112805aa79a4daa15e 100644 GIT binary patch delta 57 zcmZp+X|~}B@MdNaVE_Tnkc~VIB21hioBKp|vIFVKo-#i{l#8qhh^msc1yMU?y#RII B4iW$W delta 57 zcmZp+X|~}B@MdNaVE}>cfg5=mM3}Y*ZtfG=$qu9^d&>L-Q7*D3AgW5%7DVlo^#TCZ CbrKW+ diff --git a/assets/templates/personal_results.md b/assets/templates/personal_results.md index 047f0fa..7abe2ca 100644 --- a/assets/templates/personal_results.md +++ b/assets/templates/personal_results.md @@ -1,9 +1,9 @@ # {{ callsign }} -## Total Score : {{ score }} - {{ summary }} +--- + ## Full log {{ logs }} \ No newline at end of file diff --git a/index.md b/index.md index 22f12d1..1799f33 100644 --- a/index.md +++ b/index.md @@ -16,7 +16,7 @@ The Repeater Roundabout is a weekend-long event held on many of our local repeat Anyone with a ham radio license can participate ! You don't even have to be local; stations may participate over Echolink, Allstar, or IRLP if they are available. -> This page was last updated on Tuesday November 07 at 10:13. +> This page was last updated on Tuesday November 07 at 10:32. --- diff --git a/scripts/score.py b/scripts/score.py index 2370ebb..d94d455 100644 --- a/scripts/score.py +++ b/scripts/score.py @@ -105,14 +105,22 @@ def write_personal_results_md(logs: pd.DataFrame, summary: dict, callsign: str) logs = logs[["Group", "Contact", "Report", "Band", "QRP", "Club Connaisseur", "Band Hog"]] for col in ["QRP", "Club Connaisseur", "Band Hog"]: logs[col] = logs[col].apply(lambda x: "X" if x else "") + + # Format the summary table + total_score = summary["Total Score"] + summary_df = pd.DataFrame( + index=summary.keys(), + data=summary.values(), + columns=[total_score], + ).drop("Total Score") + summary_df.index = summary_df.index.rename("Total Score") # Fill it in colalign = ["right", "left", "right", "center", "right", "center", "center", "center"] template = ( template .replace("{{ callsign }}", f"[{callsign}](https://www.qrz.com/db/{callsign})") - .replace("{{ score }}", str(summary["Total Score"])) - .replace("{{ summary }}", pd.Series(summary).drop("Total Score").rename("").to_markdown()) + .replace("{{ summary }}", summary_df.to_markdown()) .replace("{{ logs }}", logs.to_markdown(colalign=colalign)) ) @@ -248,6 +256,7 @@ def score_competition(repeaters: pd.DataFrame, logs_dir: str = "logs") -> Tuple[ write_personal_results_md(logs, summary, callsign) # Save the contest scores + breakpoint() leaderboard = ( pd.DataFrame(contest_scores) .T.sort_values(["Total Score", "Total Contacts"], ascending=False)