Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add hybrid_score to trip model #346

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions mytoyota/models/trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@

return 0.0

@property
def score(self) -> float:
"""The (hybrid) score for the trip.

Returns
-------
float: The hybrid score for the trip

"""
if self._trip.scores and self._trip.scores.global_:
return self._trip.scores.global_

Check warning on line 179 in mytoyota/models/trips.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/models/trips.py#L178-L179

Added lines #L178 - L179 were not covered by tests

return 0.0

Check warning on line 181 in mytoyota/models/trips.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/models/trips.py#L181

Added line #L181 was not covered by tests

@property
def route(self) -> Optional[List[Tuple[float, float]]]:
"""The route taken.
Expand Down