src/ei_mcoe/ei_mcoe.py
def fill_om_with_plant_avg(plant, pudl_out):
    """Fill in O&M with plant-fuel average."""
    plant_avg = fill_in_om_avg(plant)

    frc = pudl_out.frc_eia923()
    idx_plant_fuel = ['report_date', 'fuel_type_code_pudl', 'plant_id_pudl']
    frc_wtg = weighted_average(
        df=frc.loc[~frc.fuel_cost_from_eiaapi],
        wa_col_dict={'fuel_cost_per_mmbtu': 'fuel_consumed_mmbtu'},
        idx_cols=idx_plant_fuel
    ).drop_duplicates()

    mcoe_plant = (
        pd.merge(
            plant_avg,
            frc_wtg,
            on=idx_plant_fuel,
            validate='1:1',
            how='left'
        )
    )
    return mcoe_plant
Fill in O&M with plant-fuel average.
Fill in O&M with plant-fuel average.
Fill in O&M with plant - fuel average .
def fill_om_with_plant_avg(plant, pudl_out):
    plant_avg = fill_in_om_avg(plant)
    frc = pudl_out.frc_eia923()
    idx_plant_fuel = ['report_date', 'fuel_type_code_pudl', 'plant_id_pudl']
    frc_wtg = weighted_average(
        df=frc.loc[~frc.fuel_cost_from_eiaapi],
        wa_col_dict={'fuel_cost_per_mmbtu': 'fuel_consumed_mmbtu'},
        idx_cols=idx_plant_fuel
    ).drop_duplicates()
    mcoe_plant = (
        pd.merge(
            plant_avg,
            frc_wtg,
            on=idx_plant_fuel,
            validate='1:1',
            how='left'
        )
    )
    return mcoe_plant
def fill_om_with_plant_avg ( plant , pudl_out ) : plant_avg = fill_in_om_avg ( plant ) frc = pudl_out . frc_eia923 ( ) idx_plant_fuel = [ 'report_date' , 'fuel_type_code_pudl' , 'plant_id_pudl' ] frc_wtg = weighted_average ( df = frc . loc [ ~ frc . fuel_cost_from_eiaapi ] , wa_col_dict = { 'fuel_cost_per_mmbtu' : 'fuel_consumed_mmbtu' } , idx_cols = idx_plant_fuel ) . drop_duplicates ( ) mcoe_plant = ( pd . merge ( plant_avg , frc_wtg , on = idx_plant_fuel , validate = '1:1' , how = 'left' ) ) return mcoe_plant
Fill in O&M with plant-fuel average.
Fill in O&M with plant - fuel average .
"""Fill in O&M with plant-fuel average."""
plant
pudl_out