working split
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m46s
Run linting on the backend code / Build (pull_request) Successful in 2m31s
Run testing on the backend code / Build (pull_request) Failing after 12m37s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 29s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m46s
Run linting on the backend code / Build (pull_request) Successful in 2m31s
Run testing on the backend code / Build (pull_request) Failing after 12m37s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 29s
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
"""Helper function to return only the major landmarks from a large list."""
|
||||
from ..structs.landmark import Landmark
|
||||
|
||||
def take_most_important(landmarks: list[Landmark], n_important) -> list[Landmark]:
|
||||
def take_most_important(
|
||||
landmarks: list[Landmark],
|
||||
n_important: int
|
||||
) -> list[Landmark]:
|
||||
"""
|
||||
Given a list of landmarks, return the n_important most important landmarks
|
||||
Given a list of landmarks, return the most important landmarks based on their attractiveness.
|
||||
|
||||
Args:
|
||||
landmarks: list[Landmark] - list of landmarks
|
||||
n_important: int - number of most important landmarks to return
|
||||
landmarks (list[Landmark]): List of landmarks that needs to be truncated
|
||||
n_important (int): Number of most important landmarks to return
|
||||
|
||||
Returns:
|
||||
list[Landmark] - list of the n_important most important landmarks
|
||||
list[Landmark]: List of the n_important most important landmarks
|
||||
"""
|
||||
if n_important == 0 :
|
||||
raise ValueError('Number of landmarks to keep cannot be zero.')
|
||||
|
||||
# Sort landmarks by attractiveness (descending)
|
||||
sorted_landmarks = sorted(landmarks, key=lambda x: x.attractiveness, reverse=True)
|
||||
|
||||
Reference in New Issue
Block a user