diff --git a/validator/weight_setting/winner_selection.py b/validator/weight_setting/winner_selection.py index 21d50d00..1df065dd 100644 --- a/validator/weight_setting/winner_selection.py +++ b/validator/weight_setting/winner_selection.py @@ -34,13 +34,17 @@ def get_contestant_ranks(scores: dict[Key, float]) -> dict[Key, int]: scores = list(sorted(scores.items(), key=itemgetter(1), reverse=True)) score_values = list(map(itemgetter(1), scores)) - deviation = median(score_values[i] - score_values[i + 1] for i in range(len(score_values) - 1)) + deviation = median( + score_values[i] - score_values[i + 1] + for i in range(len(score_values) - 1) + if score_values[i + 1] > 0 and score_values[i] - score_values[i + 1] > 0.0001, + ) scores = iter(scores) hotkey, last_score = next(scores) - ranks = {hotkey: rank} + ranks = { hotkey: rank } for hotkey, score in scores: difference = last_score - score