Skip to content

Commit

Permalink
Tweaks to scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
QCaudron committed Nov 7, 2023
1 parent 5055b51 commit b8a93af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Binary file modified assets/programming_files/d878.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/templates/personal_results.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# {{ callsign }}

## Total Score : {{ score }}

{{ summary }}

---

## Full log

{{ logs }}
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
---

Expand Down
13 changes: 11 additions & 2 deletions scripts/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b8a93af

Please sign in to comment.