-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Christina Ludwig <[email protected]>
…4future/co2calculator into gen_start_dest_input_#205
Gen start dest input #205
…, removed in_kwh from output to mitigate repetition
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
co2calculator/api/energy.py
Outdated
""" | ||
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: |
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.
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 = { |
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.
btw Are the fuel_type options the same for electricity and heating?
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, 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"), |
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.
pytest.param(HeatingEmissionParameters, id="plane"), | |
pytest.param(PlaneEmissionParameters, id="plane"), |
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 is it supposed to be PlaneEmissionParameters
?
…, 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.
… of the trip class
…and the associated coordinates
TransportEmission() class now returns start and destination location and the associated coordinates
No description provided.