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

Add cruise gCO2 calculator #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FatemaBohra
Copy link

Adding a cruise gCO2 calculator, to pair with the ferry and flight calculators.

I've added the relevant sources as a JSON, and a test in the tester.py file.

@J0ANMM
Copy link
Owner

J0ANMM commented Jan 9, 2022

Thanks for the proposal @FatemaBohra and apologies for taking so long to reply.

I am concerned about changing the input in def estimate_distance_from_duration of carbon_ferry.py (see here ), mainly for two reasons:

  • For ferries, it seems more natural to provide the time in hours, since most people taking ferries are in trips of less than one day. As it is good practice to avoid decimals, the function uses minutes as input. Converting hours (or days) into minutes is straightforward.
  • This change would break the calculator at Travelinho, where the interface shows the input in hours and it is converted into minutes to avoid decimals in the calculations.

I understand that for cruises an input in days seems more appropriate. Does it make sense keeping def estimate_distance_from_duration as is and creating an additional function for cruises that takes input in days and converts it into minutes before retrieving def estimate_distance_from_duration?

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