Skip to content

Commit

Permalink
last correction on as_weak_order
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkho committed Jan 30, 2025
1 parent 6a79553 commit dc04014
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions whalrus/ballots/ballot_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ def as_dict(self) -> NiceDict:
@cached_property
def as_weak_order(self) -> list:
if isinstance(self.scale, ScaleFromList):
return [NiceSet(k for k in self.as_dict.keys() if self.as_dict[k] == list(self.as_dict.values())[v])
for v in self.scale.argsort(list(set(self.as_dict.values())), reverse=True)]
present_val = list(set(self.as_dict.values()))
return [NiceSet(k for k in self.as_dict.keys() if self.as_dict[k] == present_val[v])
for v in self.scale.argsort(present_val, reverse = True)]
return [NiceSet(k for k in self.as_dict.keys() if self.as_dict[k] == v)
for v in sorted(set(self.as_dict.values()), reverse=True)]

Expand Down

0 comments on commit dc04014

Please sign in to comment.