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

refactory energy calculation #185

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

refactory energy calculation #185

wants to merge 12 commits into from

Conversation

codingfabi
Copy link
Contributor

No description provided.

@codingfabi
Copy link
Contributor Author

@han16nah @redfrexx can you maybe have another look? I needed to adjust the tests to a working state and I am not sure if we still need KwH to TJ conversion or not (the emission factors seem not to need it so I removed it).

@codingfabi codingfabi requested review from redfrexx and han16nah June 22, 2024 19:17
Copy link
Collaborator

@han16nah han16nah left a comment

Choose a reason for hiding this comment

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

See comments, other wise lgtm 👍

We should also update the docstrings eventually

@@ -3,5 +3,5 @@
1,liquid_gas,kg,14.1
2,coal,kg,6.0
3,pellet,kg,5.4
4,woodchips,kg,5.2
4,wood chips,kg,5.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep it as one word - or alternatively "wood_chips" (similar to "liquid_gas"

@@ -122,8 +122,9 @@ def get(self, fuel_type, unit):
:return:
:rtype:
"""
print(f'fuel_type == "{fuel_type.value}" & unit == "{unit}"')
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall this print statement be kept here?

consumption_kwh = consumption

# co2 equivalents for heating and electricity refer to a consumption of 1 TJ
# so consumption needs to be converted to TJ
Copy link
Collaborator

Choose a reason for hiding this comment

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

These comments can be removed as we are not converting to TJ anymore


# co2 equivalents for heating and electricity refer to a consumption of 1 TJ
# so consumption needs to be converted to TJ
return consumption * params.energy_share / co2e
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be multiplication not division! (I think we had this fixed somewhere before already?)

and comments can be removed, as we are not converting to TJ anymore (with the new emission factors)

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.

3 participants