singularity-energy / open-grid-emissions

Tools for producing high-quality hourly generation and emissions data for U.S. electric grids
MIT License
67 stars 4 forks source link

Add operating and retirement dates to plant static attributes #367

Closed rouille closed 1 month ago

rouille commented 1 month ago

Purpose

Add operating and retirement dates to plant static attributes.

A bug is fixed when calculating the nameplate capacity at the plant level

This PR also fixes an issue for years < 2013 where missing BA codes were being assigned, resulting in inaccurate BA-level results.

What the code is doing

Create a new function that adds the operating and retirement dates of a plant to the plant static attributes data frame. The operating date of a plant is taken as the earliest date among all generators' operating date over all report dates. Likewise, the retirement date of a plant is taken as the latest date among all generators' retirement date over all report dates.

Testing

Successfully ran the 2013 pipeline.

Where to look

Usage Example/Visuals

Screenshot 2024-05-22 at 7 28 14 PM

Review estimate

10min

Future work

N/A

Checklist

rouille commented 1 month ago

Screen shot with new implementation

Screenshot 2024-05-23 at 9 30 11 AM
rouille commented 1 month ago

The calculation of the nameplate capacity was bugged and is fixed in the katest commit

rouille commented 1 month ago

Looks good, thanks. One small request would be to change the order of the columns so that we are grouping data together and make it easier to read. My suggestion for column order would be:

      "plant_id_eia", #identification columns
      "plant_name_eia",
       "capacity_mw", # what type of plant is this
      "plant_primary_fuel",
      "fuel_category",
      "fuel_category_eia930",
      "state", # where is it located
        "county",
        "city",
      "ba_code",
      "ba_code_physical",
     "latitude",
      "longitude",
      "plant_operating_date", #operational status columns
      "plant_retirement_date",
      "distribution_flag", #other random metadata
      "timezone",
      "data_availability",
      "shaped_plant_id",

Done