From 4ffb06fbc715c9ece7b6deedb95eb74575826ac6 Mon Sep 17 00:00:00 2001 From: han16nah Date: Sun, 5 May 2024 16:42:52 +0200 Subject: [PATCH] remove conversion factor TJ to kWh --- co2calculator/calculate.py | 9 ++------- co2calculator/constants.py | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/co2calculator/calculate.py b/co2calculator/calculate.py index 378620e..5ef3753 100644 --- a/co2calculator/calculate.py +++ b/co2calculator/calculate.py @@ -20,7 +20,6 @@ from ._types import Kilogram, Kilometer from .constants import ( - KWH_TO_TJ, Size, CarFuel, BusFuel, @@ -68,9 +67,7 @@ def calc_co2_electricity( # Get the co2 factor co2e = emission_factors.get(params.dict()) - # co2 equivalents for heating and electricity refer to a consumption of 1 TJ - # so consumption needs to be converted to TJ - return consumption * energy_share / KWH_TO_TJ * co2e + return consumption * energy_share * co2e def calc_co2_heating( @@ -110,9 +107,7 @@ def calc_co2_heating( else: consumption_kwh = consumption - # co2 equivalents for heating and electricity refer to a consumption of 1 TJ - # so consumption needs to be converted to TJ - return consumption_kwh * area_share / KWH_TO_TJ * co2e + return consumption_kwh * area_share / co2e def calc_co2_businesstrip( diff --git a/co2calculator/constants.py b/co2calculator/constants.py index f89c54a..9e79d73 100644 --- a/co2calculator/constants.py +++ b/co2calculator/constants.py @@ -7,7 +7,6 @@ import iso3166 import pandas as pd -KWH_TO_TJ = 277777.77777778 DF_AIRPORTS = pd.read_csv( "https://davidmegginson.github.io/ourairports-data/airports.csv"