Skip to content

Commit

Permalink
Fixed benchmark "redefinition of constant" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
clizbe authored and abelsiqueira committed Oct 25, 2023
1 parent 8d75be0 commit 147e42e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ const SUITE = BenchmarkGroup()
SUITE["io"] = BenchmarkGroup()
SUITE["model"] = BenchmarkGroup()

const INPUT_FOLDER = joinpath(@__DIR__, "..", "test", "inputs", "Norse")
const OUTPUT_FOLDER = joinpath(@__DIR__, "..", "test", "outputs")
const INPUT_FOLDER_BM = joinpath(@__DIR__, "..", "test", "inputs", "Norse")
const OUTPUT_FOLDER_BM = joinpath(@__DIR__, "..", "test", "outputs")

SUITE["io"]["input"] = @benchmarkable begin
create_parameters_and_sets_from_file($INPUT_FOLDER)
create_parameters_and_sets_from_file($INPUT_FOLDER_BM)
end
parameters, sets = create_parameters_and_sets_from_file(INPUT_FOLDER)
parameters, sets = create_parameters_and_sets_from_file(INPUT_FOLDER_BM)

SUITE["io"]["graph"] = @benchmarkable begin
create_graph(
$(joinpath(INPUT_FOLDER, "assets-data.csv")),
$(joinpath(INPUT_FOLDER, "flows-data.csv")),
$(joinpath(INPUT_FOLDER_BM, "assets-data.csv")),
$(joinpath(INPUT_FOLDER_BM, "flows-data.csv")),
)
end
graph = create_graph(
joinpath(INPUT_FOLDER, "assets-data.csv"),
joinpath(INPUT_FOLDER, "flows-data.csv"),
joinpath(INPUT_FOLDER_BM, "assets-data.csv"),
joinpath(INPUT_FOLDER_BM, "flows-data.csv"),
)

SUITE["model"]["create_model"] = @benchmarkable begin
Expand All @@ -39,7 +39,7 @@ solution = solve_model(model)

SUITE["io"]["output"] = @benchmarkable begin
save_solution_to_file(
$OUTPUT_FOLDER,
$OUTPUT_FOLDER_BM,
$(sets.assets_investment),
$(solution.assets_investment),
$(parameters.assets_unit_capacity),
Expand Down

0 comments on commit 147e42e

Please sign in to comment.