Skip to content

Commit

Permalink
[fixup] Missed a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsiqueira committed Nov 8, 2024
1 parent 1edc06e commit ded14f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/expressions/multi-year.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@timeit to "multi-year investment expressions" begin
function create_multi_year_expressions!(model, graph, sets, variables)
function create_multi_year_expressions!(model, graph, sets, variables)
@timeit to "multi-year investment expressions" begin
# Unpacking
assets_investment = variables[:assets_investment].lookup
assets_decommission_simple_method = variables[:assets_decommission_simple_method].lookup
Expand Down
29 changes: 14 additions & 15 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,21 +477,20 @@ function save_solution_to_file(output_folder, graph, dataframes, solution)
end
CSV.write(output_file, output_table)

# TODO: Re-enable this output
# output_file = joinpath(output_folder, "flows-investments.csv")
# output_table = DataFrame(;
# from_asset = String[],
# to_asset = String[],
# year = Int[],
# InstalUnits = Float64[],
# InstalCap_MW = Float64[],
# )
#
# for ((y, (u, v)), investment) in solution.flows_investment
# capacity = graph[u, v].capacity
# push!(output_table, (u, v, y, investment, capacity * investment))
# end
# CSV.write(output_file, output_table)
output_file = joinpath(output_folder, "flows-investments.csv")
output_table = DataFrame(;
from_asset = String[],
to_asset = String[],
year = Int[],
InstalUnits = Float64[],
InstalCap_MW = Float64[],
)

for ((y, (u, v)), investment) in solution.flows_investment
capacity = graph[u, v].capacity
push!(output_table, (u, v, y, investment, capacity * investment))
end
CSV.write(output_file, output_table)

#=
In both cases below, we select the relevant columns from the existing dataframes,
Expand Down

0 comments on commit ded14f2

Please sign in to comment.