chihacknight / decarbonize-my-state

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

Bringing in emissions and power generation data in one json file #9

Closed derekeder closed 2 years ago

derekeder commented 2 years ago

Now that we have data for emissions on the website, lets do the same for power generation.

Instead of having two separate files as I originally outlined, it would be a lot easier to work with all data rolled up by state in Gatsby. This will give us a pattern for easily adding more data for each state as we make it.

Here's what I see as the next steps to take:

  1. rename final/emissions.json to final/state_data.json
  2. in that file, the data should be formatted as:
{
  "illinois": {
    "emissions": [
      {
        "year": "2001",
        "dirty_power": 1000000,
        "buildings": 1000000,
        "transportation": 1000000,
        "dumps, farms, industrial": 1000000
      },
      {
        "year": "2002",
        "dirty_power": 1000000,
        "buildings": 1000000,
        "transportation": 1000000,
        "dumps, farms, industrial": 1000000
      },
      {
        "year": "2003",
        "dirty_power": 1000000,
        "buildings": 1000000,
        "transportation": 1000000,
        "dumps, farms, industrial": 1000000
      },
      ...
    ],
    "power_generation": [
      {
        "year": "2001",
        "coal": 1000000,
        "natural_gas": 1000000,
        "petro_liquids": 1000000,
        "nuclear": 1000000,
        "hydro": 1000000,
        "solar": 1000000,
        "wind": 1000000
      },
      {
        "year": "2002",
        "coal": 1000000,
        "natural_gas": 1000000,
        "petro_liquids": 1000000,
        "nuclear": 1000000,
        "hydro": 1000000,
        "solar": 1000000,
        "wind": 1000000
      },
      {
        "year": "2003",
        "coal": 1000000,
        "natural_gas": 1000000,
        "petro_liquids": 1000000,
        "nuclear": 1000000,
        "hydro": 1000000,
        "solar": 1000000,
        "wind": 1000000
      },
      ...
    ]
  },
  "indiana": {  
    ...
  }
}
derekeder commented 2 years ago

based on the conversation in https://github.com/chihacknight/state-by-state-decarbonization/pull/35#issuecomment-1079053261, we will be keeping the files separate for our own sanity.