Skip to content

Commit

Permalink
Account for ties in leaderboards
Browse files Browse the repository at this point in the history
  • Loading branch information
QCaudron committed Nov 20, 2023
1 parent 5595490 commit 14d272a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Binary file modified assets/programming_files/d878.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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 Sunday November 19 at 12:00.
> This page was last updated on Monday November 20 at 09:41.
---

Expand Down
8 changes: 5 additions & 3 deletions scripts/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def score_competition(
}
)
)
leaderboard.index = leaderboard.index + 1
leaderboard["Callsign"] = leaderboard["Callsign"].apply(
lambda call: f"[{call}](/results/{call})"
)
Expand All @@ -286,6 +285,9 @@ def score_competition(
]
leaderboard["Full House"] = leaderboard["Full House"].apply(lambda x: "X" if x else "")

# Set a new index with leaderboard positions, but accounting for ties
leaderboard.index = leaderboard["Total Score"].rank(method='min', ascending=False).astype(int)

# Merge all logs with repeater data
repeater_cols = ["RR#", "Long Name", "Output (MHz)", "Location", "Website"]
logs_df = (
Expand Down Expand Up @@ -323,7 +325,7 @@ def score_competition(
.reset_index(drop=True)
.round({"Readability": 2})
)
by_repeater.index = by_repeater.index + 1
by_repeater.index = by_repeater["Activations"].rank(method='min', ascending=False).astype(int)
by_repeater["Frequency"] = by_repeater["Frequency"].apply(at_least_three_decimals)

# Calculate the number of activations per club
Expand All @@ -334,7 +336,7 @@ def score_competition(
.sort_values(["Activations", "Group"], ascending=[False, True])
.reset_index(drop=False) # index contains the club name
)
by_club.index = by_club.index + 1
by_club.index = by_club["Activations"].rank(method='min', ascending=False).astype(int)

# Some stats :
total_contacts = sum([scores["Total Contacts"] for scores in contest_scores.values()])
Expand Down

0 comments on commit 14d272a

Please sign in to comment.