Skip to content

Commit fc67523

Browse files
authored
Merge pull request #56 from control-toolbox/auto-juliaformatter-pr
[AUTO] JuliaFormatter.jl run
2 parents 243c6aa + 12f9b9c commit fc67523

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

docs/make.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ cp(
1515

1616
repo_url = "github.com/control-toolbox/CTBenchmarks.jl"
1717

18-
makedocs(;
18+
makedocs(;
1919
remotes=nothing,
2020
warnonly=:cross_references,
2121
sitename="CTBenchmarks",
22-
format=Documenter.HTML(;
22+
format=Documenter.HTML(;
2323
repolink="https://" * repo_url,
2424
prettyurls=false,
2525
size_threshold_ignore=["index.md"],
@@ -28,10 +28,7 @@ makedocs(;
2828
asset("https://control-toolbox.org/assets/js/documentation.js"),
2929
],
3030
),
31-
pages=[
32-
"Introduction" => "index.md",
33-
"Minimal benchmark" => "benchmark-minimal.md",
34-
],
31+
pages=["Introduction" => "index.md", "Minimal benchmark" => "benchmark-minimal.md"],
3532
)
3633

3734
deploydocs(; repo=repo_url * ".git", devbranch="main", push_preview=true)

src/benchmark-minimal.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ Each result is a NamedTuple with:
1212
- `time::Float64`: arbitrary execution time
1313
"""
1414
function generate_dummy_results()
15-
[
16-
(; problem = :toy_problem_1, time = 0.123),
17-
(; problem = :toy_problem_2, time = 0.456),
18-
]
15+
[(; problem=:toy_problem_1, time=0.123), (; problem=:toy_problem_2, time=0.456)]
1916
end
2017

2118
"""
@@ -44,7 +41,8 @@ Combine benchmark results and metadata into a JSON-friendly dictionary.
4441
function build_payload(results::Vector{<:NamedTuple}, meta::Dict)
4542
Dict(
4643
"metadata" => meta,
47-
"results" => [Dict("problem" => String(r.problem), "time" => r.time) for r in results],
44+
"results" =>
45+
[Dict("problem" => String(r.problem), "time" => r.time) for r in results],
4846
)
4947
end
5048

@@ -83,10 +81,14 @@ This function performs the following steps:
8381
# Returns
8482
- The `outpath` of the saved JSON file.
8583
"""
86-
function benchmark_minimal(; outpath::AbstractString = joinpath(normpath(@__DIR__, ".."), "docs", "src", "assets", "benchmark-minimal", "data.json"))
84+
function benchmark_minimal(;
85+
outpath::AbstractString=joinpath(
86+
normpath(@__DIR__, ".."), "docs", "src", "assets", "benchmark-minimal", "data.json"
87+
),
88+
)
8789
results = generate_dummy_results()
8890
meta = generate_metadata()
8991
payload = build_payload(results, meta)
9092
save_json(payload, outpath)
9193
return outpath
92-
end
94+
end

0 commit comments

Comments
 (0)