singularity-energy / open-grid-emissions

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

Validate subplants have both combined cycle parts #297

Closed grgmiller closed 1 year ago

grgmiller commented 1 year ago

This PR fixes CAR-1909.

Combined cycle generators contain a steam part (CA) and turbine part (CT) that are linked together. Thus, our subplant groups that contain one part of a combined cycle plant should always in theory contain the other part as well. This PR adds a test that checks that both parts exist in a subplant if one exists.

Besides CT and CA prime movers, there is also CS prime movers which represent a "single shaft" combined cycle unit where the steam and turbine parts share a single generator. These prime movers are allowed to be by themselves in a subplant, as are CC prime movers, which represent a "total unit."

This PR adds a prime_mover_code column to the subplant crosswalk table to help validating this.

This PR also updates the code to export the subplant crosswalk using output_intermediate_data instead of just exporting using pd.to_csv() which bypassed our column checks.

The warning looks like this: image