From 3710a476e8c1fde631e0836426b52ca12e419f03 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Fri, 27 Sep 2024 10:13:33 +0200 Subject: [PATCH] don't break when using sets --- backend/src/utils/take_most_important.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/utils/take_most_important.py b/backend/src/utils/take_most_important.py index 0fef17c..734532f 100644 --- a/backend/src/utils/take_most_important.py +++ b/backend/src/utils/take_most_important.py @@ -11,6 +11,6 @@ def take_most_important(landmarks: list[Landmark], n_important) -> list[Landmark """ # Sort landmarks by attractiveness (descending) - landmarks.sort(key=lambda x: x.attractiveness, reverse=True) + sorted_landmarks = sorted(landmarks, key=lambda x: x.attractiveness, reverse=True) - return landmarks[:n_important] + return sorted_landmarks[:n_important]