-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: implements Trip and Emissions classes #192
base: main
Are you sure you want to change the base?
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.
Looks good in general, just some minor comments :)
"""Class for storing information on emissions""" | ||
|
||
co2e: float | ||
distance: float |
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.
Can you elaborate why the Emissions
class needs a distance property? It seems unnecessary for two reasons:
- The object already has the co2e calculated.
- I assume we reuse the Emissions class for Energy calculations as well. There, it would not make sense to store a distance attribute.
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.
True! We could also make it optional and add an optional "consumption" attribute as well. Then we could use it for both. I would like to keep it attached to the emission calculation results, since it is a good meta information which the user might want to retrieve in a later analysis. What do you think?
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.
Or we create child classes TripEmissions
and EnergyEmissions
.
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 am not quite sure if there is a need to keep it as a meta information because the user actually needs to provide the distance information in the first place for now (I agree that this might change once we implement/add the ORS). But we can keep it for now but would need to create child classes because it would be unclean to also use it for the energy emissions.
…alues, adapted tests accordingly
No description provided.