Skip to content

Commit

Permalink
Simplify, fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cfe316 committed Dec 13, 2023
1 parent 2c5202e commit 7f65bcd
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/write_outputs/write_net_revenue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::
# Add investment cost to the dataframe
dfNetRevenue.Inv_cost_MW = dfGen[!,:Inv_Cost_per_MWyr] .* dfCap[1:G,:NewCap]
dfNetRevenue.Inv_cost_MWh = dfGen[!,:Inv_Cost_per_MWhyr] .* dfCap[1:G,:NewEnergyCap]

inv_cost_charge = :Inv_Cost_Charge_per_MWyr
inv_cost_charge_rev = :Inv_cost_charge_MW
dfNetRevenue[!, inv_cost_charge_rev] = zeros(G)
if hasproperty(dfGen, inv_cost_charge)
dfNetRevenue[!, inv_cost_charge_rev] = dfGen[!, inv_cost_charge] .* dfCap[1:G,:NewChargeCap]
end
dfNetRevenue.Inv_cost_charge_MWh = dfGen[!,:Inv_Cost_per_MWhyr] .* dfCap[1:G,:NewChargeCap]

if !isempty(VRE_STOR)
# Doesn't include charge capacities
Expand All @@ -59,13 +53,7 @@ function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::
# Add operations and maintenance cost to the dataframe
dfNetRevenue.Fixed_OM_cost_MW = dfGen[!,:Fixed_OM_Cost_per_MWyr] .* dfCap[1:G,:EndCap]
dfNetRevenue.Fixed_OM_cost_MWh = dfGen[!,:Fixed_OM_Cost_per_MWhyr] .* dfCap[1:G,:EndEnergyCap]

fixed_om_cost_charge = :Fixed_OM_Cost_Charge_per_MWyr
fixed_om_cost_charge_rev = :Fixed_OM_cost_charge_MW
dfNetRevenue[!, fixed_om_cost_charge_rev] = zeros(G)
if hasproperty(dfGen, fixed_om_cost_charge)
dfNetRevenue[!, fixed_om_cost_charge_rev] = dfGen[!, inv_cost_charge] .* dfCap[1:G,:EndChargeCap]
end
dfNetRevenue.Fixed_OM_cost_charge_MW = dfGen[!, :Fixed_OM_Cost_Charge_per_MWyr] .* dfGen[1:G, :EndChargeCap]

dfNetRevenue.Var_OM_cost_out = (dfGen[!,:Var_OM_Cost_per_MWh]) .* dfPower[1:G,:AnnualSum]
if !isempty(VRE_STOR)
Expand Down

0 comments on commit 7f65bcd

Please sign in to comment.