src/ei_mcoe/ei_mcoe.py
def plot_heat_rate(pudl_out):
    """Plot the difference in heat rate for different fuel types."""
    raw_eia_df = prep_raw_eia(pudl_out)
    hr_df = compare_heatrate(raw_eia_df, pd.DataFrame, sd_mean_cols=True)
    fig, (coal_ax, gas_ax) = plt.subplots(ncols=2, nrows=1,
                                          figsize=(17, 8))
    xlabel = "Heat Rate"
    cost_range = (0, 100)
    nbins = 300
    pdf = True

    df_coal = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'coal']
    df_gas = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'gas']
    # df_oil = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'oil']
    # df_waste = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'waste']

    x_coal = df_coal.heat_rate_mmbtu_mwh
    x_gas = df_gas.heat_rate_mmbtu_mwh
    # x_oil = df_oil.heat_rate_mmbtu_mwh
    # x_waste = df_waste.heat_rate_mmbtu_mwh

    coal_ax.hist([x_coal],
                 histtype='bar',
                 range=cost_range,
                 bins=nbins,
                 weights=df_coal.capacity_mw,
                 label=['Coal'],
                 density=pdf,
                 color=['black'],
                 alpha=0.5)
    coal_ax.set_xlabel(xlabel)
    coal_ax.set_title('Coal Heat Rates')
    coal_ax.legend()

    gas_ax.hist([x_gas],
                histtype='bar',
                range=cost_range,
                bins=nbins,
                weights=df_gas.capacity_mw,
                label=['Gas'],
                density=pdf,
                color=['blue'],
                alpha=0.5)
    gas_ax.set_xlabel(xlabel)
    gas_ax.set_title('Gas Heat Rates')
    gas_ax.legend()
    # plt.savefig("ferc1_eia_fuel_pct_check.png")
    plt.tight_layout()
    plt.show()
Plot the difference in heat rate for different fuel types.
Plot the difference in heat rate for different fuel types.
Plot the difference in heat rate for different fuel types .
def plot_heat_rate(pudl_out):
    raw_eia_df = prep_raw_eia(pudl_out)
    hr_df = compare_heatrate(raw_eia_df, pd.DataFrame, sd_mean_cols=True)
    fig, (coal_ax, gas_ax) = plt.subplots(ncols=2, nrows=1,
                                          figsize=(17, 8))
    xlabel = "Heat Rate"
    cost_range = (0, 100)
    nbins = 300
    pdf = True
    df_coal = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'coal']
    df_gas = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'gas']
    x_coal = df_coal.heat_rate_mmbtu_mwh
    x_gas = df_gas.heat_rate_mmbtu_mwh
    coal_ax.hist([x_coal],
                 histtype='bar',
                 range=cost_range,
                 bins=nbins,
                 weights=df_coal.capacity_mw,
                 label=['Coal'],
                 density=pdf,
                 color=['black'],
                 alpha=0.5)
    coal_ax.set_xlabel(xlabel)
    coal_ax.set_title('Coal Heat Rates')
    coal_ax.legend()
    gas_ax.hist([x_gas],
                histtype='bar',
                range=cost_range,
                bins=nbins,
                weights=df_gas.capacity_mw,
                label=['Gas'],
                density=pdf,
                color=['blue'],
                alpha=0.5)
    gas_ax.set_xlabel(xlabel)
    gas_ax.set_title('Gas Heat Rates')
    gas_ax.legend()
    plt.tight_layout()
    plt.show()
def plot_heat_rate ( pudl_out ) : raw_eia_df = prep_raw_eia ( pudl_out ) hr_df = compare_heatrate ( raw_eia_df , pd . DataFrame , sd_mean_cols = True ) fig , ( coal_ax , gas_ax ) = plt . subplots ( ncols = 2 , nrows = 1 , figsize = ( 17 , 8 ) ) xlabel = "Heat Rate" cost_range = ( 0 , 100 ) nbins = 300 pdf = True df_coal = hr_df . loc [ hr_df [ 'fuel_type_code_pudl' ] == 'coal' ] df_gas = hr_df . loc [ hr_df [ 'fuel_type_code_pudl' ] == 'gas' ] x_coal = df_coal . heat_rate_mmbtu_mwh x_gas = df_gas . heat_rate_mmbtu_mwh coal_ax . hist ( [ x_coal ] , histtype = 'bar' , range = cost_range , bins = nbins , weights = df_coal . capacity_mw , label = [ 'Coal' ] , density = pdf , color = [ 'black' ] , alpha = 0.5 ) coal_ax . set_xlabel ( xlabel ) coal_ax . set_title ( 'Coal Heat Rates' ) coal_ax . legend ( ) gas_ax . hist ( [ x_gas ] , histtype = 'bar' , range = cost_range , bins = nbins , weights = df_gas . capacity_mw , label = [ 'Gas' ] , density = pdf , color = [ 'blue' ] , alpha = 0.5 ) gas_ax . set_xlabel ( xlabel ) gas_ax . set_title ( 'Gas Heat Rates' ) gas_ax . legend ( ) plt . tight_layout ( ) plt . show ( )
Plot the difference in heat rate for different fuel types.
Plot the difference in heat rate for different fuel types .
"""Plot the difference in heat rate for different fuel types.""" # df_oil = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'oil'] # df_waste = hr_df.loc[hr_df['fuel_type_code_pudl'] == 'waste'] # x_oil = df_oil.heat_rate_mmbtu_mwh # x_waste = df_waste.heat_rate_mmbtu_mwh # plt.savefig("ferc1_eia_fuel_pct_check.png")
pudl_out