diff --git a/migrations/versions/ccdf68a30cbd_add_unit__to_heat_rate_mmbtu_per_mwh.py b/migrations/versions/ccdf68a30cbd_add_unit__to_heat_rate_mmbtu_per_mwh.py new file mode 100644 index 0000000000..ffd41d29eb --- /dev/null +++ b/migrations/versions/ccdf68a30cbd_add_unit__to_heat_rate_mmbtu_per_mwh.py @@ -0,0 +1,305 @@ +"""Add unit_ to heat_rate_mmbtu_per_mwh + +Revision ID: ccdf68a30cbd +Revises: 9edc4a11c809 +Create Date: 2023-11-15 14:09:59.541894 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "ccdf68a30cbd" +down_revision = "9edc4a11c809" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table( + "_out_eia__monthly_derived_generator_attributes", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_fuel_cost_by_generator", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_heat_rate_by_generator", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_heat_rate_by_unit", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_derived_generator_attributes", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_fuel_cost_by_generator", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_heat_rate_by_generator", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_heat_rate_by_unit", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table("mega_generators_eia", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table("out_eia__monthly_generators", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table("out_eia__yearly_generators", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "out_eia__yearly_generators_by_ownership", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table("out_eia__yearly_plant_parts", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + with op.batch_alter_table( + "out_pudl__yearly_assn_eia_ferc1_plant_parts", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh_eia", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh_ferc1", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Calculated from FERC reported fuel consumption and net generation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh_eia") + batch_op.drop_column("heat_rate_mmbtu_mwh_ferc1") + + with op.batch_alter_table("plant_parts_eia", schema=None) as batch_op: + batch_op.add_column( + sa.Column( + "unit_heat_rate_mmbtu_per_mwh", + sa.Float(), + nullable=True, + comment="Fuel content per unit of electricity generated. Coming from MCOE calculation.", + ) + ) + batch_op.drop_column("heat_rate_mmbtu_mwh") + + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table("plant_parts_eia", schema=None) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "out_pudl__yearly_assn_eia_ferc1_plant_parts", schema=None + ) as batch_op: + batch_op.add_column( + sa.Column("heat_rate_mmbtu_mwh_ferc1", sa.FLOAT(), nullable=True) + ) + batch_op.add_column( + sa.Column("heat_rate_mmbtu_mwh_eia", sa.FLOAT(), nullable=True) + ) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh_ferc1") + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh_eia") + + with op.batch_alter_table("out_eia__yearly_plant_parts", schema=None) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "out_eia__yearly_generators_by_ownership", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table("out_eia__yearly_generators", schema=None) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table("out_eia__monthly_generators", schema=None) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table("mega_generators_eia", schema=None) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_heat_rate_by_unit", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_heat_rate_by_generator", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_fuel_cost_by_generator", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__yearly_derived_generator_attributes", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_heat_rate_by_unit", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_heat_rate_by_generator", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_fuel_cost_by_generator", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + with op.batch_alter_table( + "_out_eia__monthly_derived_generator_attributes", schema=None + ) as batch_op: + batch_op.add_column(sa.Column("heat_rate_mmbtu_mwh", sa.FLOAT(), nullable=True)) + batch_op.drop_column("unit_heat_rate_mmbtu_per_mwh") + + # ### end Alembic commands ### diff --git a/src/pudl/analysis/eia_ferc1_record_linkage.py b/src/pudl/analysis/eia_ferc1_record_linkage.py index 874342202f..808c9146ea 100644 --- a/src/pudl/analysis/eia_ferc1_record_linkage.py +++ b/src/pudl/analysis/eia_ferc1_record_linkage.py @@ -209,7 +209,9 @@ def get_plants_ferc1(self, clobber: bool = False) -> pd.DataFrame: x.plant_id_report_year + "_" + x.utility_id_pudl.map(str) ), fuel_cost_per_mmbtu=lambda x: (x.fuel_cost / x.fuel_mmbtu), - heat_rate_mmbtu_mwh=lambda x: (x.fuel_mmbtu / x.net_generation_mwh), + unit_heat_rate_mmbtu_per_mwh=lambda x: ( + x.fuel_mmbtu / x.net_generation_mwh + ), ) .rename( columns={ @@ -419,9 +421,9 @@ def make_features( label="fuel_cost_per_mmbtu", ), Numeric( - "heat_rate_mmbtu_mwh", - "heat_rate_mmbtu_mwh", - label="heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", + "unit_heat_rate_mmbtu_per_mwh", + label="unit_heat_rate_mmbtu_per_mwh", ), Exact( "fuel_type_code_pudl", diff --git a/src/pudl/analysis/eia_ferc1_train.py b/src/pudl/analysis/eia_ferc1_train.py index f441219b3f..61b7ae3c81 100644 --- a/src/pudl/analysis/eia_ferc1_train.py +++ b/src/pudl/analysis/eia_ferc1_train.py @@ -103,7 +103,7 @@ "total_fuel_cost", "total_mmbtu", "fuel_cost_per_mmbtu", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", ] # -------------------------------------------------------------------------------------- diff --git a/src/pudl/analysis/mcoe.py b/src/pudl/analysis/mcoe.py index 8522d6abca..245b9b6b77 100644 --- a/src/pudl/analysis/mcoe.py +++ b/src/pudl/analysis/mcoe.py @@ -258,7 +258,7 @@ def heat_rate_by_unit(gen_fuel_by_energy_source: pd.DataFrame, bga: pd.DataFrame - unit_id_pudl - net_generation_mwh - fuel_consumed_for_electricity_mmbtu - - heat_rate_mmbtu_mwh + - unit_heat_rate_mmbtu_per_mwh """ gen_fuel_by_unit = pudl.helpers.date_merge( left=gen_fuel_by_energy_source, @@ -274,7 +274,7 @@ def heat_rate_by_unit(gen_fuel_by_energy_source: pd.DataFrame, bga: pd.DataFrame .sum() .convert_dtypes() .assign( - heat_rate_mmbtu_mwh=lambda x: x.fuel_consumed_for_electricity_mmbtu + unit_heat_rate_mmbtu_per_mwh=lambda x: x.fuel_consumed_for_electricity_mmbtu / x.net_generation_mwh ) ) @@ -299,7 +299,7 @@ def heat_rate_by_gen( Returns: DataFrame with columns report_date, plant_id_eia, unit_id_pudl, generator_id, - heat_rate_mmbtu_mwh, fuel_type_code_pudl, fuel_type_count, prime_mover_code. + unit_heat_rate_mmbtu_per_mwh, fuel_type_code_pudl, fuel_type_count, prime_mover_code. The output will have a time frequency corresponding to that of the input pudl_out. Output data types are set to their canonical values before returning. """ @@ -312,7 +312,7 @@ def heat_rate_by_gen( "report_date", "plant_id_eia", "unit_id_pudl", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", ], ] @@ -377,7 +377,7 @@ def fuel_cost( "generator_id", "unit_id_pudl", "report_date", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", ], ] gens = gens.loc[ @@ -488,7 +488,7 @@ def fuel_cost( "plant_id_eia", "report_date", "generator_id", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "fuel_cost_from_eiaapi", ] ], @@ -505,7 +505,7 @@ def fuel_cost( "report_date", "generator_id", "fuel_cost_per_mmbtu", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "fuel_cost_from_eiaapi", ] ] @@ -513,13 +513,14 @@ def fuel_cost( fc = ( pd.concat([one_fuel, multi_fuel], sort=True) .assign( - fuel_cost_per_mwh=lambda x: x.fuel_cost_per_mmbtu * x.heat_rate_mmbtu_mwh + fuel_cost_per_mwh=lambda x: x.fuel_cost_per_mmbtu + * x.unit_heat_rate_mmbtu_per_mwh ) .sort_values(["report_date", "plant_id_eia", "generator_id"]) ) out_df = ( - gen_w_ft.drop("heat_rate_mmbtu_mwh", axis=1) + gen_w_ft.drop("unit_heat_rate_mmbtu_per_mwh", axis=1) .drop_duplicates() .merge(fc, on=["report_date", "plant_id_eia", "generator_id"]) ) @@ -606,7 +607,7 @@ def mcoe( "unit_id_pudl", "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "fuel_cost_per_mwh", ], ], @@ -618,12 +619,12 @@ def mcoe( ) # Calculate a couple more derived values: .assign( - total_mmbtu=lambda x: x.net_generation_mwh * x.heat_rate_mmbtu_mwh, + total_mmbtu=lambda x: x.net_generation_mwh * x.unit_heat_rate_mmbtu_per_mwh, total_fuel_cost=lambda x: x.total_mmbtu * x.fuel_cost_per_mmbtu, ) .pipe( pudl.helpers.oob_to_nan_with_dependent_cols, - cols=["heat_rate_mmbtu_mwh"], + cols=["unit_heat_rate_mmbtu_per_mwh"], dependent_cols=["total_mmbtu", "fuel_cost_per_mwh"], lb=min_heat_rate, ub=None, diff --git a/src/pudl/analysis/plant_parts_eia.py b/src/pudl/analysis/plant_parts_eia.py index ff0a93d759..fcea7d5370 100644 --- a/src/pudl/analysis/plant_parts_eia.py +++ b/src/pudl/analysis/plant_parts_eia.py @@ -281,7 +281,7 @@ WTAVG_DICT = { "fuel_cost_per_mwh": "capacity_mw", - "heat_rate_mmbtu_mwh": "capacity_mw", + "unit_heat_rate_mmbtu_per_mwh": "capacity_mw", "fuel_cost_per_mmbtu": "capacity_mw", } """Dict: a dictionary of columns (keys) to perform weighted averages on and the weight diff --git a/src/pudl/metadata/fields.py b/src/pudl/metadata/fields.py index 56d1fb3bce..7bd14e5652 100644 --- a/src/pudl/metadata/fields.py +++ b/src/pudl/metadata/fields.py @@ -1231,17 +1231,17 @@ "description": "The energy contained in fuel burned, measured in million BTU.", "unit": "MMBtu", }, - "heat_rate_mmbtu_mwh": { + "unit_heat_rate_mmbtu_per_mwh": { "type": "number", "description": "Fuel content per unit of electricity generated. Coming from MCOE calculation.", "unit": "MMBtu_MWh", }, - "heat_rate_mmbtu_mwh_eia": { + "unit_heat_rate_mmbtu_per_mwh_eia": { "type": "number", "description": "Fuel content per unit of electricity generated. Coming from MCOE calculation.", "unit": "MMBtu_MWh", }, - "heat_rate_mmbtu_mwh_ferc1": { + "unit_heat_rate_mmbtu_per_mwh_ferc1": { "type": "number", "description": "Fuel content per unit of electricity generated. Calculated from FERC reported fuel consumption and net generation.", "unit": "MMBtu_MWh", diff --git a/src/pudl/metadata/resources/eia.py b/src/pudl/metadata/resources/eia.py index 96844449a3..bebf089c51 100644 --- a/src/pudl/metadata/resources/eia.py +++ b/src/pudl/metadata/resources/eia.py @@ -551,7 +551,7 @@ "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", "fuel_cost_per_mwh", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "net_generation_mwh", "total_fuel_cost", "total_mmbtu", @@ -651,7 +651,7 @@ "fuel_cost_per_mwh", "fuel_type_code_pudl", "generator_retirement_date", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "installation_year", "net_generation_mwh", "generator_operating_year", diff --git a/src/pudl/metadata/resources/ferc1_eia_record_linkage.py b/src/pudl/metadata/resources/ferc1_eia_record_linkage.py index 3c04c82ab0..1e338352d7 100644 --- a/src/pudl/metadata/resources/ferc1_eia_record_linkage.py +++ b/src/pudl/metadata/resources/ferc1_eia_record_linkage.py @@ -55,7 +55,7 @@ "fuel_cost_per_mwh", "fuel_type_code_pudl", "generator_retirement_date", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "installation_year", "net_generation_mwh", "generator_operating_year", @@ -107,7 +107,7 @@ "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", "fuel_cost_per_mwh", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "net_generation_mwh", "total_fuel_cost", "total_mmbtu", @@ -175,7 +175,7 @@ "capacity_mw_eia", "capacity_factor_eia", "total_mmbtu_eia", - "heat_rate_mmbtu_mwh_eia", + "unit_heat_rate_mmbtu_per_mwh_eia", "fuel_type_code_pudl_eia", "installation_year_eia", "plant_part_id_eia", @@ -258,7 +258,7 @@ "total_fuel_cost_ferc1", "total_mmbtu_ferc1", "fuel_type_code_pudl_ferc1", - "heat_rate_mmbtu_mwh_ferc1", + "unit_heat_rate_mmbtu_per_mwh_ferc1", ], "primary_key": ["record_id_ferc1"], }, diff --git a/src/pudl/metadata/resources/mcoe.py b/src/pudl/metadata/resources/mcoe.py index 2b738a3e3d..740506d7fd 100644 --- a/src/pudl/metadata/resources/mcoe.py +++ b/src/pudl/metadata/resources/mcoe.py @@ -24,7 +24,7 @@ "unit_id_pudl", "net_generation_mwh", "fuel_consumed_for_electricity_mmbtu", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", ], "primary_key": [ "report_date", @@ -53,7 +53,7 @@ "plant_id_eia", "unit_id_pudl", "generator_id", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "fuel_type_code_pudl", "fuel_type_count", "prime_mover_code", @@ -126,7 +126,7 @@ "fuel_type_code_pudl", "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "fuel_cost_per_mwh", ], "primary_key": [ @@ -165,7 +165,7 @@ "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", "fuel_cost_per_mwh", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "net_generation_mwh", "total_fuel_cost", "total_mmbtu", @@ -212,7 +212,7 @@ "fuel_cost_from_eiaapi", "fuel_cost_per_mmbtu", "fuel_cost_per_mwh", - "heat_rate_mmbtu_mwh", + "unit_heat_rate_mmbtu_per_mwh", "net_generation_mwh", "total_fuel_cost", "total_mmbtu", diff --git a/src/pudl/validate.py b/src/pudl/validate.py index 8a7278fe8e..d226f88420 100644 --- a/src/pudl/validate.py +++ b/src/pudl/validate.py @@ -2661,7 +2661,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_bound": 7.0, "hi_q": 0.50, "hi_bound": 7.5, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, { # EIA natural gas reporting really only becomes usable in 2015. @@ -2671,7 +2671,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_bound": 6.4, "hi_q": 0.95, "hi_bound": 13.0, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, ] @@ -2685,7 +2685,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_bound": 10.0, "hi_q": 0.50, "hi_bound": 11.0, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, { @@ -2695,7 +2695,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_bound": 9.0, "hi_q": 0.95, "hi_bound": 12.5, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, ] @@ -2861,7 +2861,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_q": 0.05, "mid_q": 0.50, "hi_q": 0.95, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, { @@ -2870,7 +2870,7 @@ def plot_vs_agg(orig_df, agg_df, validation_cases): "low_q": 0.05, "mid_q": 0.50, "hi_q": 0.95, - "data_col": "heat_rate_mmbtu_mwh", + "data_col": "unit_heat_rate_mmbtu_per_mwh", "weight_col": "net_generation_mwh", }, ] diff --git a/test/unit/analysis/plant_parts_eia_test.py b/test/unit/analysis/plant_parts_eia_test.py index 202822c442..9b234464bf 100644 --- a/test/unit/analysis/plant_parts_eia_test.py +++ b/test/unit/analysis/plant_parts_eia_test.py @@ -534,7 +534,7 @@ def test_one_to_many(): "net_generation_mwh": [100] * 8, "total_fuel_cost": [100] * 8, "fuel_cost_per_mwh": [1] * 8, - "heat_rate_mmbtu_mwh": [1] * 8, + "unit_heat_rate_mmbtu_per_mwh": [1] * 8, "fuel_cost_per_mmbtu": [1] * 8, "fuel_type_code_pudl": ["test"] * 8, "planned_generator_retirement_date": [2076] * 8, @@ -621,7 +621,7 @@ def test_one_to_many(): "net_generation_mwh": [100, 100, 100, 100, 100, 100, 100, 100, 200], "total_fuel_cost": [100, 100, 100, 100, 100, 100, 100, 100, 200], "fuel_cost_per_mwh": [1] * 9, - "heat_rate_mmbtu_mwh": [1] * 9, + "unit_heat_rate_mmbtu_per_mwh": [1] * 9, "fuel_cost_per_mmbtu": [1] * 9, "fuel_type_code_pudl": ["test"] * 9, "planned_generator_retirement_date": [2076] * 9,