-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement custom electricity emissions backend #135
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for radiant-cucurucho-d09bae failed.
|
result = df.copy() | ||
|
||
# Convert kBtu to kWh (1 kBtu = 0.293071 kWh) | ||
result['ElectricityUseKWh'] = result['ElectricityUse'] * 0.293071 |
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.
It doesn't make sense to store this, since it's calculatable from electricity use in kBTUs, including at run-time. In fact, we already do that in common-functions.js:estimateUtilitySpend
to make a rough approximation of how much buildings might be spend on electricity.
@@ -0,0 +1,11 @@ | |||
carbon_intensity_factors: | |||
2014: 137 |
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 add a data source? If we're adding a new source we need to maintain year-over-year, we'll need to have that noted, and make sure that it errors out if the latest year's intensity is missing
@MisterClean - super exciting to see you tackle this, but the site doesn't build: https://app.netlify.com/sites/radiant-cucurucho-d09bae/deploys/673bd488331ff400089ac331 I also just ran the Python tests and those look to be hitting errors too. |
Description
Issue #121
Introduces a feature to calculate and append electricity emissions to the building benchmarking dataset. The calculation uses electricity usage data and year-specific carbon intensity factors to estimate CO₂ emissions.
The annual emissions factors are configurable in the emissions.yml file.
NOTE: The current configuration file has incorrect values right now. We will need to calculate the accurate version of the emissions factor using EIA data. I eyeballed 2023 using slide 28 of the PJM Illinois annual report
This only impacts the data backend. We will still need to come up with a new building emissions calculation that combines non-electricity emissions with the new custom electricity emissions estimate to determine the new total building emissions estimate.
Here’s how it works:
Key Changes
New Column:
ElectricityEmissions
Supporting Column:
ElectricityUseKWh
ElectricityUse
from kBtu to kWh for accurate emissions calculations.Carbon Intensity Factors
emissions.yml
) and specify the grams of CO₂ emitted per kWh for each year.How It Works
Data Preparation:
ElectricityUse
) is converted from kBtu to kWh using the factor:1 kBtu = 0.293071 kWh
.Emissions Calculation:
Integration:
calculate_building_emissions
function is used to add theElectricityEmissions
andElectricityUseKWh
columns to the dataset.Output:
Example Output
Given the following input:
The output includes:
Why This Matters
Let me know if you need further details or edits for this summary!
Testing Instructions
Build data with
python src/data/scripts/process_data.py
Test data with
python tests/data/scripts/test_emissions.py
A successful test will look like this
Checklist: