From 24e87100423ac8423b0c2ff2a1959ab6e7972451 Mon Sep 17 00:00:00 2001 From: Kurt Nordback Date: Fri, 30 Dec 2022 16:37:55 -0700 Subject: [PATCH] Proof of concept for GH bug #509. This particular field may or may not actually want to change --- src/pudl/metadata/fields.py | 4 ++++ src/pudl/metadata/resources/eia923.py | 1 + src/pudl/transform/eia923.py | 9 +++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pudl/metadata/fields.py b/src/pudl/metadata/fields.py index 560cde902f..03fdc0a7c6 100644 --- a/src/pudl/metadata/fields.py +++ b/src/pudl/metadata/fields.py @@ -263,6 +263,10 @@ "description": "Average monthly coincident peak (CP) demand (for requirements purchases, and any transactions involving demand charges). Monthly CP demand is the metered demand during the hour (60-minute integration) in which the supplier's system reaches its monthly peak. In megawatts.", "unit": "MW", }, + "combined_heat_power": { + "type": "boolean", + "description": "Indicates whether the generator is a combined heat and power system", + }, "conductor_size_and_material": { "type": "string", "description": "Size of transmission conductor and material of the transmission line.", diff --git a/src/pudl/metadata/resources/eia923.py b/src/pudl/metadata/resources/eia923.py index 3b1ba314d2..48eb6c07b8 100644 --- a/src/pudl/metadata/resources/eia923.py +++ b/src/pudl/metadata/resources/eia923.py @@ -15,6 +15,7 @@ "fuel_mmbtu_per_unit", "sulfur_content_pct", "ash_content_pct", + "combined_heat_power", ], "primary_key": [ "plant_id_eia", diff --git a/src/pudl/transform/eia923.py b/src/pudl/transform/eia923.py index 6d5badfc9f..504087c28e 100644 --- a/src/pudl/transform/eia923.py +++ b/src/pudl/transform/eia923.py @@ -759,7 +759,13 @@ def _aggregate_duplicate_boiler_fuel_keys(boiler_fuel_df: pd.DataFrame) -> pd.Da relative_cols = ["ash_content_pct", "sulfur_content_pct", "fuel_mmbtu_per_unit"] key_cols = ["boiler_id", "energy_source_code", "plant_id_eia", "report_date"] - expected_cols = set(quantity_cols + relative_cols + key_cols + ["prime_mover_code"]) + expected_cols = set( + quantity_cols + + relative_cols + + key_cols + + ["prime_mover_code"] + + ["combined_heat_power"] + ) actual_cols = set(boiler_fuel_df.columns) difference = actual_cols.symmetric_difference(expected_cols) @@ -829,7 +835,6 @@ def boiler_fuel(eia923_dfs, eia923_transformed_dfs): # Need to stop dropping fields that contain harvestable entity attributes. # See https://github.com/catalyst-cooperative/pudl/issues/509 cols_to_drop = [ - "combined_heat_power", "plant_name_eia", "operator_name", "operator_id",