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

replacing unit by in_kwh parameter for heating - fixes #223 #227

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

han16nah
Copy link
Collaborator

No description provided.

@han16nah han16nah requested review from redfrexx and Milli97 February 16, 2025 15:14
@han16nah
Copy link
Collaborator Author

Nice solution! I agree that it is important that the unit can be returned in the end 👍

…and get_options() to _EnergyFromHeating to return unit of each fuel_type
"""
if unit is not None and not isinstance(unit, str):
raise ValueError("unit must be a string")
if self.fuel_type is None and not in_kwh:
Copy link
Member

Choose a reason for hiding this comment

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

Looking at it again, I feel like it would be more intuitive for the user if we pass all parameters in the from_heating function. So the Energy class wouldn't take any parameters and would only be a container for the methods.

def get_options(self):
"""Return fuel type options and their corresponding units as a table."""

options = {
Copy link
Member

Choose a reason for hiding this comment

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

btw Are the fuel_type options the same for electricity and heating?

Copy link
Member

@redfrexx redfrexx left a comment

Choose a reason for hiding this comment

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

Looks good, just some questions we can discuss later. Thanks! :)

@@ -101,6 +100,7 @@ def test_compare_enums_with_data(column_name, enum, emission_category, subcatego
pytest.param(TrainEmissionParameters, id="train"),
pytest.param(FerryEmissionParameters, id="ferry"),
pytest.param(MotorbikeEmissionParameters, id="motorbike"),
pytest.param(HeatingEmissionParameters, id="plane"),
Copy link
Member

@redfrexx redfrexx Mar 13, 2025

Choose a reason for hiding this comment

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

Suggested change
pytest.param(HeatingEmissionParameters, id="plane"),
pytest.param(PlaneEmissionParameters, id="plane"),

Copy link
Member

Choose a reason for hiding this comment

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

or is it supposed to be PlaneEmissionParameters?

han16nah and others added 10 commits March 13, 2025 17:09
…, removed in_kwh from output to mitigate repetition
…and get_options() to _EnergyFromHeating to return unit of each fuel_type
…ething off with the distance calculations. Needs to get checked again. Related to #228
…) method. So Energy class is only container for methods.
TransportEmission() class now returns start and destination location and the associated coordinates
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.

4 participants