Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Aug 27, 2024
1 parent 87baf2b commit 4111d20
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/write_outputs/write_charge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/write_outputs/write_co2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
5 changes: 3 additions & 2 deletions src/write_outputs/write_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/write_outputs/write_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4111d20

Please sign in to comment.