Skip to content

Commit

Permalink
Revert warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Jan 12, 2024
1 parent ffd052e commit 9d4d867
Show file tree
Hide file tree
Showing 25 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function write_reserve_margin_slack(path::AbstractString, inputs::Dict, setup::D
temp_ResMar_slack .*= ModelScalingFactor # Convert GW to MW
end
dfResMar_slack = hcat(dfResMar_slack, DataFrame(temp_ResMar_slack, [Symbol("t$t") for t in 1:T]))
CSV.write(joinpath(path, "ReserveMargin_prices_and_penalties.csv"), dftranspose(dfResMar_slack, false), header=false)
CSV.write(joinpath(path, "ReserveMargin_prices_and_penalties.csv"), dftranspose(dfResMar_slack, false), writeheader=false)
return dfResMar_slack
end

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ function write_virtual_discharge(path::AbstractString, inputs::Dict, setup::Dict
total[:, 4:T+3] .= sum(virtual_discharge, dims = 1)
rename!(total,auxNew_Names)
dfVirtualDischarge = vcat(dfVirtualDischarge, total)
CSV.write(joinpath(path, "virtual_discharge.csv"), dftranspose(dfVirtualDischarge, false), header=false)
CSV.write(joinpath(path, "virtual_discharge.csv"), dftranspose(dfVirtualDischarge, false), writeheader=false)
return dfVirtualDischarge
end
2 changes: 1 addition & 1 deletion src/write_outputs/hydrogen/write_hourly_matching_prices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function write_hourly_matching_prices(path::AbstractString, inputs::Dict, setup:
auxNew_Names=[Symbol("Zone");[Symbol("t$t") for t in 1:T]]
rename!(dfHourlyMatchPrices,auxNew_Names)

CSV.write(joinpath(path, "hourly_matching_prices.csv"), dftranspose(dfHourlyMatchPrices, false), header=false)
CSV.write(joinpath(path, "hourly_matching_prices.csv"), dftranspose(dfHourlyMatchPrices, false), writeheader=false)

return dfHourlyMatchPrices
end
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ function write_opwrap_lds_dstor(path::AbstractString, inputs::Dict, setup::Dict,
dfdStorage = hcat(dfdStorage, DataFrame(dsoc, :auto))
auxNew_Names=[Symbol("Resource");Symbol("Zone");[Symbol("w$t") for t in 1:W]]
rename!(dfdStorage,auxNew_Names)
CSV.write(joinpath(path, "dStorage.csv"), dftranspose(dfdStorage, false), header=false)
CSV.write(joinpath(path, "dStorage.csv"), dftranspose(dfdStorage, false), writeheader=false)
end
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ function write_opwrap_lds_stor_init(path::AbstractString, inputs::Dict, setup::D
dfStorageInit = hcat(dfStorageInit, DataFrame(socw, :auto))
auxNew_Names=[Symbol("Resource");Symbol("Zone");[Symbol("n$t") for t in 1:NPeriods]]
rename!(dfStorageInit,auxNew_Names)
CSV.write(joinpath(path, "StorageInit.csv"), dftranspose(dfStorageInit, false), header=false)
CSV.write(joinpath(path, "StorageInit.csv"), dftranspose(dfStorageInit, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/reserves/write_reg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ function write_reg(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
total[!, 4:T+3] .= sum(reg, dims = 1)
rename!(total,auxNew_Names)
dfReg = vcat(dfReg, total)
CSV.write(joinpath(path, "reg.csv"), dftranspose(dfReg, false), header=false)
CSV.write(joinpath(path, "reg.csv"), dftranspose(dfReg, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/reserves/write_rsv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ function write_rsv(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
rename!(total,auxNew_Names)
rename!(unmet,auxNew_Names)
dfRsv = vcat(dfRsv, unmet, total)
CSV.write(joinpath(path, "reg_dn.csv"), dftranspose(dfRsv, false), header=false)
CSV.write(joinpath(path, "reg_dn.csv"), dftranspose(dfRsv, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/transmission/write_transmission_flows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ function write_transmission_flows(path::AbstractString, inputs::Dict, setup::Dic
total[:, 3:T+2] .= sum(flow, dims = 1)
rename!(total,auxNew_Names)
dfFlow = vcat(dfFlow, total)
CSV.write(joinpath(path, "flow.csv"), dftranspose(dfFlow, false), header=false)
CSV.write(joinpath(path, "flow.csv"), dftranspose(dfFlow, false), writeheader=false)
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ function write_transmission_losses(path::AbstractString, inputs::Dict, setup::Di
total[:, 3:T+2] .= sum(tlosses, dims = 1)
rename!(total,auxNew_Names)
dfTLosses = vcat(dfTLosses, total)
CSV.write(joinpath(path, "tlosses.csv"), dftranspose(dfTLosses, false), header=false)
CSV.write(joinpath(path, "tlosses.csv"), dftranspose(dfTLosses, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/ucommit/write_commit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ function write_commit(path::AbstractString, inputs::Dict, setup::Dict, EP::Model
dfCommit = hcat(dfCommit, DataFrame(commit, :auto))
auxNew_Names=[Symbol("Resource");Symbol("Zone");[Symbol("t$t") for t in 1:T]]
rename!(dfCommit,auxNew_Names)
CSV.write(joinpath(path, "commit.csv"), dftranspose(dfCommit, false), header=false)
CSV.write(joinpath(path, "commit.csv"), dftranspose(dfCommit, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/ucommit/write_shutdown.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ function write_shutdown(path::AbstractString, inputs::Dict, setup::Dict, EP::Mod
total[:, 4:T+3] .= sum(shut, dims = 1)
rename!(total,auxNew_Names)
dfShutdown = vcat(dfShutdown, total)
CSV.write(joinpath(path, "shutdown.csv"), dftranspose(dfShutdown, false), header=false)
CSV.write(joinpath(path, "shutdown.csv"), dftranspose(dfShutdown, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/ucommit/write_start.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ function write_start(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
total[:, 4:T+3] .= sum(start, dims = 1)
rename!(total,auxNew_Names)
dfStart = vcat(dfStart, total)
CSV.write(joinpath(path, "start.csv"), dftranspose(dfStart, false), header=false)
CSV.write(joinpath(path, "start.csv"), dftranspose(dfStart, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_charge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ function write_charge(path::AbstractString, inputs::Dict, setup::Dict, EP::Model
total[:, 4:T+3] .= sum(charge, dims = 1)
rename!(total,auxNew_Names)
dfCharge = vcat(dfCharge, total)
CSV.write(joinpath(path, "charge.csv"), dftranspose(dfCharge, false), header=false)
CSV.write(joinpath(path, "charge.csv"), dftranspose(dfCharge, false), writeheader=false)
return dfCharge
end
4 changes: 2 additions & 2 deletions src/write_outputs/write_co2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function write_co2_emissions_plant(path::AbstractString, inputs::Dict, setup::Di
total = DataFrame(["Total" 0 sum(dfEmissions_plant[!, :AnnualSum]) fill(0.0, (1, T))], auxNew_Names)
total[!, 4:T+3] .= sum(emissions_plant, dims=1)
dfEmissions_plant = vcat(dfEmissions_plant, total)
CSV.write(joinpath(path, "emissions_plant.csv"), dftranspose(dfEmissions_plant, false), header=false)
CSV.write(joinpath(path, "emissions_plant.csv"), dftranspose(dfEmissions_plant, false), writeheader=false)
end

function write_co2_capture_plant(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
Expand All @@ -58,6 +58,6 @@ function write_co2_capture_plant(path::AbstractString, inputs::Dict, setup::Dict
total[!, 4:T+3] .= sum(emissions_captured_plant, dims=1)
dfCapturedEmissions_plant = vcat(dfCapturedEmissions_plant, total)

CSV.write(joinpath(path, "captured_emissions_plant.csv"), dftranspose(dfCapturedEmissions_plant, false), header=false)
CSV.write(joinpath(path, "captured_emissions_plant.csv"), dftranspose(dfCapturedEmissions_plant, false), writeheader=false)
end
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_curtailment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ function write_curtailment(path::AbstractString, inputs::Dict, setup::Dict, EP::
total[:, 4:T+3] .= sum(curtailment, dims = 1)
rename!(total,auxNew_Names)
dfCurtailment = vcat(dfCurtailment, total)
CSV.write(joinpath(path, "curtail.csv"), dftranspose(dfCurtailment, false), header=false)
CSV.write(joinpath(path, "curtail.csv"), dftranspose(dfCurtailment, false), writeheader=false)
return dfCurtailment
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_emissions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ function write_emissions(path::AbstractString, inputs::Dict, setup::Dict, EP::Mo
rename!(total,auxNew_Names)
dfEmissions = vcat(dfEmissions, total)
end
CSV.write(joinpath(path, "emissions.csv"), dftranspose(dfEmissions, false), header=false)
CSV.write(joinpath(path, "emissions.csv"), dftranspose(dfEmissions, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_fuel_consumption.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function write_fuel_consumption_ts(path::AbstractString, inputs::Dict, setup::Di
dfPlantFuel_TS = hcat(dfPlantFuel_TS,
DataFrame(tempts, [Symbol("t$t") for t in 1:T]))
CSV.write(joinpath(path, "FuelConsumption_plant_MMBTU.csv"),
dftranspose(dfPlantFuel_TS, false), header=false)
dftranspose(dfPlantFuel_TS, false), writeheader=false)
end


Expand Down
2 changes: 1 addition & 1 deletion src/write_outputs/write_nse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ function write_nse(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
rename!(total,auxNew_Names)
dfNse = vcat(dfNse, total)

CSV.write(joinpath(path, "nse.csv"), dftranspose(dfNse, false), header=false)
CSV.write(joinpath(path, "nse.csv"), dftranspose(dfNse, false), writeheader=false)
return dfNse
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ function write_power(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)

rename!(total,auxNew_Names)
dfPower = vcat(dfPower, total)
CSV.write(joinpath(path, "power.csv"), dftranspose(dfPower, false), header=false)
CSV.write(joinpath(path, "power.csv"), dftranspose(dfPower, false), writeheader=false)
return dfPower
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_power_balance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ function write_power_balance(path::AbstractString, inputs::Dict, setup::Dict, EP
dfPowerBalance = hcat(dfPowerBalance, DataFrame(powerbalance, :auto))
auxNew_Names = [Symbol("BalanceComponent"); Symbol("Zone"); Symbol("AnnualSum"); [Symbol("t$t") for t in 1:T]]
rename!(dfPowerBalance,auxNew_Names)
CSV.write(joinpath(path, "power_balance.csv"), dftranspose(dfPowerBalance, false), header=false)
CSV.write(joinpath(path, "power_balance.csv"), dftranspose(dfPowerBalance, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_price.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function write_price(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
rename!(dfPrice,auxNew_Names)

## Linear configuration final output
CSV.write(joinpath(path, "prices.csv"), dftranspose(dfPrice, false), header=false)
CSV.write(joinpath(path, "prices.csv"), dftranspose(dfPrice, false), writeheader=false)
return dfPrice
end

Expand Down
2 changes: 1 addition & 1 deletion src/write_outputs/write_reliability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ function write_reliability(path::AbstractString, inputs::Dict, setup::Dict, EP::
auxNew_Names=[Symbol("Zone");[Symbol("t$t") for t in 1:T]]
rename!(dfReliability,auxNew_Names)

CSV.write(joinpath(path, "reliability.csv"), dftranspose(dfReliability, false), header=false)
CSV.write(joinpath(path, "reliability.csv"), dftranspose(dfReliability, false), writeheader=false)

end
2 changes: 1 addition & 1 deletion src/write_outputs/write_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ function write_storage(path::AbstractString, inputs::Dict,setup::Dict, EP::Model
dfStorage = hcat(dfStorage, DataFrame(storagevcapvalue, :auto))
auxNew_Names=[Symbol("Resource");Symbol("Zone");[Symbol("t$t") for t in 1:T]]
rename!(dfStorage,auxNew_Names)
CSV.write(joinpath(path, "storage.csv"), dftranspose(dfStorage, false), header=false)
CSV.write(joinpath(path, "storage.csv"), dftranspose(dfStorage, false), writeheader=false)
end
2 changes: 1 addition & 1 deletion src/write_outputs/write_storagedual.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ function write_storagedual(path::AbstractString, inputs::Dict, setup::Dict, EP::
dfStorageDual=hcat(dfStorageDual, DataFrame(dual_values, :auto))
rename!(dfStorageDual,[Symbol("Resource");Symbol("Zone");[Symbol("t$t") for t in 1:T]])

CSV.write(joinpath(path, "storagebal_duals.csv"), dftranspose(dfStorageDual, false), header=false)
CSV.write(joinpath(path, "storagebal_duals.csv"), dftranspose(dfStorageDual, false), writeheader=false)
end
12 changes: 6 additions & 6 deletions src/write_outputs/write_vre_stor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function write_vre_stor_charge(path::AbstractString, inputs::Dict, setup::Dict,
total[:, 4:T+3] .= sum(charge_dc, dims = 1)
rename!(total,auxNew_Names)
dfCharge_DC = vcat(dfCharge_DC, total)
CSV.write(joinpath(path,"vre_stor_dc_charge.csv"), dftranspose(dfCharge_DC, false), header=false)
CSV.write(joinpath(path,"vre_stor_dc_charge.csv"), dftranspose(dfCharge_DC, false), writeheader=false)
end

# AC charging of battery dataframe
Expand All @@ -323,7 +323,7 @@ function write_vre_stor_charge(path::AbstractString, inputs::Dict, setup::Dict,
total[:, 4:T+3] .= sum(charge_ac, dims = 1)
rename!(total,auxNew_Names)
dfCharge_AC = vcat(dfCharge_AC, total)
CSV.write(joinpath(path,"vre_stor_ac_charge.csv"), dftranspose(dfCharge_AC, false), header=false)
CSV.write(joinpath(path,"vre_stor_ac_charge.csv"), dftranspose(dfCharge_AC, false), writeheader=false)
end
end

Expand Down Expand Up @@ -356,7 +356,7 @@ function write_vre_stor_discharge(path::AbstractString, inputs::Dict, setup::Dic
total[:, 4:T+3] .= sum(power_vre_stor, dims = 1)
rename!(total,auxNew_Names)
dfDischarge_DC = vcat(dfDischarge_DC, total)
CSV.write(joinpath(path, "vre_stor_dc_discharge.csv"), dftranspose(dfDischarge_DC, false), header=false)
CSV.write(joinpath(path, "vre_stor_dc_discharge.csv"), dftranspose(dfDischarge_DC, false), writeheader=false)
end

# AC discharging of battery dataframe
Expand All @@ -374,7 +374,7 @@ function write_vre_stor_discharge(path::AbstractString, inputs::Dict, setup::Dic
total[:, 4:T+3] .= sum(power_vre_stor, dims = 1)
rename!(total,auxNew_Names)
dfDischarge_AC = vcat(dfDischarge_AC, total)
CSV.write(joinpath(path, "vre_stor_ac_discharge.csv"), dftranspose(dfDischarge_AC, false), header=false)
CSV.write(joinpath(path, "vre_stor_ac_discharge.csv"), dftranspose(dfDischarge_AC, false), writeheader=false)
end

# Wind generation of co-located resource dataframe
Expand All @@ -392,7 +392,7 @@ function write_vre_stor_discharge(path::AbstractString, inputs::Dict, setup::Dic
total[:, 4:T+3] .= sum(vre_vre_stor, dims = 1)
rename!(total,auxNew_Names)
dfVP_VRE_STOR = vcat(dfVP_VRE_STOR, total)
CSV.write(joinpath(path,"vre_stor_wind_power.csv"), dftranspose(dfVP_VRE_STOR, false), header=false)
CSV.write(joinpath(path,"vre_stor_wind_power.csv"), dftranspose(dfVP_VRE_STOR, false), writeheader=false)
end

# Solar generation of co-located resource dataframe
Expand All @@ -410,6 +410,6 @@ function write_vre_stor_discharge(path::AbstractString, inputs::Dict, setup::Dic
total[:, 4:T+3] .= sum(vre_vre_stor, dims = 1)
rename!(total,auxNew_Names)
dfVP_VRE_STOR = vcat(dfVP_VRE_STOR, total)
CSV.write(joinpath(path,"vre_stor_solar_power.csv"), dftranspose(dfVP_VRE_STOR, false), header=false)
CSV.write(joinpath(path,"vre_stor_solar_power.csv"), dftranspose(dfVP_VRE_STOR, false), writeheader=false)
end
end

0 comments on commit 9d4d867

Please sign in to comment.