From 4111d205c9c107cc81c527cadcd2a0d406be8823 Mon Sep 17 00:00:00 2001 From: lbonaldo Date: Tue, 27 Aug 2024 11:19:00 -0400 Subject: [PATCH] Fix formatting --- src/write_outputs/write_charge.jl | 8 ++++---- src/write_outputs/write_co2.jl | 5 +++-- src/write_outputs/write_outputs.jl | 5 +++-- src/write_outputs/write_storage.jl | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/write_outputs/write_charge.jl b/src/write_outputs/write_charge.jl index 3b8130cad..f8de471ed 100644 --- a/src/write_outputs/write_charge.jl +++ b/src/write_outputs/write_charge.jl @@ -36,11 +36,11 @@ function write_charge(path::AbstractString, inputs::Dict, setup::Dict, EP::Model push!(charge, value.(EP[:vCHARGE_VRE_STOR])) push!(charge_ids, VS_STOR) end - charge = reduce(vcat, charge, init=zeros(0, T)) - charge_ids = reduce(vcat, charge_ids, init=Int[]) - + charge = reduce(vcat, charge, init = zeros(0, T)) + charge_ids = reduce(vcat, charge_ids, init = Int[]) + charge *= scale_factor - + df = DataFrame(Resource = resources[charge_ids], Zone = zones[charge_ids]) df.AnnualSum = charge * weight diff --git a/src/write_outputs/write_co2.jl b/src/write_outputs/write_co2.jl index 6b5da8c5a..5a2860d19 100644 --- a/src/write_outputs/write_co2.jl +++ b/src/write_outputs/write_co2.jl @@ -27,7 +27,7 @@ function write_co2_emissions_plant(path::AbstractString, emissions_plant *= scale_factor df = DataFrame(Resource = resources, - Zone = zones, + Zone = zones, AnnualSum = zeros(G)) df.AnnualSum .= emissions_plant * weight @@ -54,7 +54,8 @@ function write_co2_capture_plant(path::AbstractString, inputs::Dict, setup::Dict df.AnnualSum .= emissions_captured_plant * weight - write_temporal_data(df, emissions_captured_plant, path, setup, "captured_emissions_plant") + write_temporal_data( + df, emissions_captured_plant, path, setup, "captured_emissions_plant") end return nothing end diff --git a/src/write_outputs/write_outputs.jl b/src/write_outputs/write_outputs.jl index f384100b8..3aaf4eac2 100644 --- a/src/write_outputs/write_outputs.jl +++ b/src/write_outputs/write_outputs.jl @@ -484,7 +484,7 @@ end # END output() Internal function for writing annual outputs. """ function write_annual(fullpath::AbstractString, dfOut::DataFrame) - push!(dfOut, ["Total" 0 sum(dfOut[!, :AnnualSum], init=0.0)]) + push!(dfOut, ["Total" 0 sum(dfOut[!, :AnnualSum], init = 0.0)]) CSV.write(fullpath, dfOut) return nothing end @@ -504,7 +504,8 @@ function write_fulltimeseries(fullpath::AbstractString, Symbol("AnnualSum"); [Symbol("t$t") for t in 1:T]] rename!(dfOut, auxNew_Names) - total = DataFrame(["Total" 0 sum(dfOut[!, :AnnualSum], init=0.0) fill(0.0, (1, T))], auxNew_Names) + total = DataFrame( + ["Total" 0 sum(dfOut[!, :AnnualSum], init=0.0) fill(0.0, (1, T))], auxNew_Names) total[!, 4:(T + 3)] .= sum(dataOut, dims = 1, init = 0.0) dfOut = vcat(dfOut, total) diff --git a/src/write_outputs/write_storage.jl b/src/write_outputs/write_storage.jl index 67519a490..4e64c0f9b 100644 --- a/src/write_outputs/write_storage.jl +++ b/src/write_outputs/write_storage.jl @@ -32,7 +32,7 @@ function write_storage(path::AbstractString, inputs::Dict, setup::Dict, EP::Mode if !isempty(VS_STOR) push!(stored, value.(EP[:vS_VRE_STOR])) end - stored = reduce(vcat, stored, init=zeros(0, T)) + stored = reduce(vcat, stored, init = zeros(0, T)) stored *= scale_factor stored_ids = convert(Vector{Int}, vcat(STOR_ALL, HYDRO_RES, FLEX, VS_STOR))