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

stopovers; added airports.csv #12

Merged
merged 6 commits into from
Feb 10, 2020
Merged

stopovers; added airports.csv #12

merged 6 commits into from
Feb 10, 2020

Conversation

evgeniiaraz
Copy link
Contributor

For #10:

  • both with "via" and adding a second leg later and any combination of those, including starting with "I want to travel via New York" working!

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 :)

@evgeniiaraz evgeniiaraz marked this pull request as ready for review January 29, 2020 23:50
Copy link

@JEM-Mosig JEM-Mosig left a 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 Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
actions.py Outdated Show resolved Hide resolved
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." \

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.

Copy link
Contributor Author

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?

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 :)

actions.py Show resolved Hide resolved
Copy link

@JEM-Mosig JEM-Mosig left a 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}",)

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

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),

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.

actions.py Show resolved Hide resolved
actions.py Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Feb 7, 2020

Intent Cross-Validation Results (5 folds)

class support f1-score confused_with
micro avg 2543 0.6626 N/A
macro avg 2543 0.3520 N/A
weighted avg 2543 0.6448 N/A
faq 753 0.7666 inquire-ask_clarification-offsets(62), inform(32)
inform 621 0.9240 faq(10), inquire-ask_clarification-offsets(8)
affirm 255 0.7641 farewell(6), inform(5)
inquire-ask_clarification-offsets 124 0.4450 faq(27), farewell(3)
estimate_emissions 73 0.3234 faq(17), inquire-ask_clarification-offsets(15)
deny 69 0.3918 thank(12), affirm(10)
greet 63 0.5714 faq(9), farewell(7)
why 59 0.2353 inquire-ask_clarification-offsets(17), estimate_emissions(9)
inform_notunderstanding 58 0.2029 faq(14), inquire-ask_clarification-offsets(10), farewell(7)
farewell 57 0.2874 faq(10), express_positive-emo(5)
thank 54 0.4138 express_positive-emo(15), affirm(4)
express_positive-emo 48 0.3548 affirm(7), greet(5)
express_surprise 43 0.1852 farewell(7), affirm(5)
express_uncertainty 43 0.1961 affirm(9), thank(6), inquire-ask_clarification-offsets(5)
inquire-ask_clarification 38 0.1250 inquire-ask_clarification-offsets(13), faq(10), affirm(4)
buy_offsets 35 0.2273 inquire-ask_clarification-offsets(15), estimate_emissions(7)
how_calculated 29 0.3500 inquire-ask_clarification-offsets(10), estimate_emissions(5)
deny_flying 28 0.2857 farewell(5), inquire-ask_clarification-offsets(4)
express_negative-emo 25 0.1935 express_positive-emo(6), faq(5), affirm(3)
resolve_entity 20 0.3333 express_positive-emo(6), affirm(3)
restart 18 0.3636 affirm(5), thank(3)
meta_inform_problem_bad-link 12 0.2857 inform(3), inquire-ask_clarification-offsets(2)
SCENARIO 10 N/A express_positive-emo(3), inform(2), thank(2)
help 8 0.2222 faq(3), express_positive-emo(2), farewell(1)

Copy link

@JEM-Mosig JEM-Mosig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂👍

@evgeniiaraz evgeniiaraz merged commit 02920b7 into master Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants