-
Notifications
You must be signed in to change notification settings - Fork 31
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
stopovers; added airports.csv #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evgeniiaraz Great that you got this to work! I just have a few comments. Also, could you please add some test stories?
actions.py
Outdated
message = f"The trip from {departure_airport} ({departure_iata}) to {destination_airport} ({destination_iata}) "\ | ||
f"via {stopover_airport} ({stopover_iata}) emits {co2_in_tons[2]+co2_in_tons[3]:.1f} of CO2. " \ | ||
f"The first leg emits {co2_in_tons[0]} of CO2. " \ | ||
f"The second leg emits {co2_in_tons[1]} of CO2." \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think users would want to know these specifics. You can leave this out for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it only because Alan proposed it in the initial issue. Should I remove it? or reformat the message somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really important. You may choose either way :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better! Just a few more small comments.
}.get(unit) | ||
|
||
if not kilos_per_unit: | ||
raise ValueError(f"Unknown unit: '{unit}'") | ||
|
||
unit_string = "kg" if unit == "kilograms" else "tons" | ||
|
||
co2 = f"{ceil(10 * co2_kg / kilos_per_unit) * 0.1:.1f} {unit_string}" | ||
co2 = (f"{ceil(10 * co2_kg / kilos_per_unit) * 0.1:.1f} {unit_string}",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
actions.py
Outdated
def clarify_stopover(departure, stopover, destination, dispatcher, tracker): | ||
""" | ||
Informs the user about the discovered stopover trip; | ||
Appears right before the offset calculations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
actions.py
Outdated
Returns: | ||
a boolean flag of whether a connecting flight was found; | ||
if it was found: | ||
a tuple of ((departure airport name, departure IATA code), (stopover airport name, stopover IATA code), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: You could use a named tuple here, for more clarity.
…the clarification message to reduce the readload
Intent Cross-Validation Results (5 folds)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙂👍
For #10:
The only thing which I'll give another try a bit later today is the double message when giving the second route straight up.
Thanks a lot! and I hope it's not too scary :)