Skip to content

Commit

Permalink
Fix get_contestant_ranks when only one score is available
Browse files Browse the repository at this point in the history
  • Loading branch information
MsRandom committed Nov 29, 2024
1 parent 5d6008c commit e27e804
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion validator/weight_setting/winner_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ def get_contestant_ranks(scores: dict[Key, float]) -> dict[Key, int]:
if not scores:
return {}

i = 0
rank = 0

if len(scores) == 1:
hotkey = next(iter(scores))

return { hotkey: rank }

i = 0

scores = list(sorted(scores.items(), key=itemgetter(1), reverse=True))
score_values = list(map(itemgetter(1), scores))

Expand Down

0 comments on commit e27e804

Please sign in to comment.