chihacknight / decarbonize-my-state

What does it take to decarbonize your state?
https://decarbmystate.com/
MIT License
13 stars 1 forks source link

re-added power generation data to pipeline, adds to state detail page #186

Closed derekeder closed 1 year ago

derekeder commented 1 year ago

Overview

For the power plant overview in https://github.com/chihacknight/decarbonize-my-state/issues/184#issuecomment-1430754415, this re-adds the power generation data by state from the EIA that @swatland610 originally prepped. This data includes data from 2001 to 2020.

Grabs this data for a given state and makes the 2020 year available in a console.log statement:

all_solar: 506
coal: 31237.9
hydro_electric: 135
natural_gas: 24516.1
nuclear: 100246.1
petro_liquids: 30.3
wind: 16225.9
year: 2020

Not doing any data prep to determine how much is 'clean' vs other. We may want to do that work in the data prep script here: https://github.com/chihacknight/decarbonize-my-state/blob/main/data/scripts/utils.py#L49

Testing Instructions

netlify[bot] commented 1 year ago

Deploy Preview for decarb-my-state ready!

Name Link
Latest commit af237832d40179af93130e8ea9413e770f8ea475
Latest deploy log https://app.netlify.com/sites/decarb-my-state/deploys/64094ef45c74000008d63385
Deploy Preview https://deploy-preview-186--decarb-my-state.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

vkoves commented 1 year ago

@derekeder - are you also passing through the all fuels value? Otherwise I don't think I could calculate a percentage. The clean % I can do on the front-end just fine

derekeder commented 1 year ago

@vkoves it looks like the percentages were being calculated in the make file, but just weren't being included in the final output. latest changes now has percent columns for all energy types. For example: coal_percent.

vkoves commented 1 year ago

@derekeder - I wanted to double check the percentages but they don't seem to be getting logged, so are they not passed through?

vkoves commented 1 year ago

It's also worth mentioning that it looks like all the JSON files changed, but I assume that's just something about regenerating - maybe we need to sort by state name or something so that regenerating the same data doesn't look like everything has changed

derekeder commented 1 year ago

@vkoves good catch. the query on the state-detail page needed to be updated to include the new values. they're showing up now:

all_solar: 506
all_solar_percent: 0
coal: 31237.9
coal_percent: 18
hydro_electric: 135
hydro_electric_percent: 0
natural_gas: 24516.1
natural_gas_percent: 14
nuclear: 100246.1
nuclear_percent: 58
petro_liquids: 30.3
petro_liquids_percent: 0
wind: 16225.9
wind_percent: 9
year: 2020
vkoves commented 1 year ago

@derekeder - sweet, thanks for the quick fix! One last question, why is it "all_solar"? Is that to clarify it's residential and industrial? It's not shown to user, just want to make sure we understand the data

Update: I'd be also curious to figure out what the unit is on the percentless data, e.g. wind - maybe MW?

derekeder commented 1 year ago

if you look at the source data, solar is split up into 3 categories utility_scale_solar utility_scale_photovoltaic and small_scale_photovoltaic. for our purposes this is a bit too detailed, so all_solar is all we probably care about.

And yes, I think they are in MW