more testing and better pylint score
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m48s
Run linting on the backend code / Build (pull_request) Failing after 29s
Run testing on the backend code / Build (pull_request) Failing after 1m13s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 47s

This commit is contained in:
2024-11-30 17:55:33 +01:00
parent 4f169c483e
commit 41e2746d82
11 changed files with 192 additions and 134 deletions

View File

@@ -71,9 +71,11 @@ class Landmark(BaseModel) :
time to the next landmark (if available), and whether the landmark is secondary.
"""
time_to_next_str = f", time_to_next={self.time_to_reach_next}" if self.time_to_reach_next else ""
is_secondary_str = f", secondary" if self.is_secondary else ""
is_secondary_str = ", secondary" if self.is_secondary else ""
type_str = '(' + self.type + ')'
if self.type in ["start", "finish", "nature", "shopping"] : type_str += '\t '
if self.type in ["start", "finish", "nature", "shopping"] :
type_str += '\t '
return f'Landmark{type_str}: [{self.name} @{self.location}, score={self.attractiveness}{time_to_next_str}{is_secondary_str}]'
def distance(self, value: 'Landmark') -> float:

View File

@@ -11,7 +11,7 @@ class LinkedLandmarks:
to reference the next landmark in the list. This is not very efficient, but appropriate for the expected use case
("short" trips with onyl few landmarks).
"""
_landmarks = list[Landmark]
total_time: int = 0

View File

@@ -30,5 +30,5 @@ class Preferences(BaseModel) :
# Shopping (diriger plutôt vers des zones / rues commerçantes)
shopping : Preference
max_time_minute: Optional[int] = 6*60
max_time_minute: Optional[int] = 3*60
detour_tolerance_minute: Optional[int] = 0

View File

@@ -25,7 +25,7 @@ class Trip(BaseModel):
@classmethod
def from_linked_landmarks(self, landmarks: LinkedLandmarks, cache_client: Client) -> "Trip":
def from_linked_landmarks(cls, landmarks: LinkedLandmarks, cache_client: Client) -> "Trip":
"""
Initialize a new Trip object and ensure it is stored in the cache.
"""