Skip to content

Commit 6d30f0e

Browse files
AnHeuermannclaude
andauthored
More times, more links (#9)
* Add times to failed stages * Add links to simulation result CSV * Add timings to summary.json Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c541cb9 commit 6d30f0e

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

src/report.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import Printf: @sprintf
55

66
function _status_cell(ok::Bool, t::Float64, logFile::Union{String,Nothing})
77
link = isnothing(logFile) ? "" : """ <a href="$(logFile)">(log)</a>"""
8+
time = t > 0 ? @sprintf("%.2f", t) * " s" : ""
89
if ok
9-
return """<td class="ok">&#10003; $(@sprintf "%.2f" t) s$link</td>"""
10+
return """<td class="ok">&#10003;$(time)$(link)</td>"""
1011
else
11-
return """<td class="fail">&#10007;$link</td>"""
12+
return """<td class="fail">&#10007;$(time)$(link)</td>"""
1213
end
1314
end
1415

@@ -18,12 +19,17 @@ function _cmp_cell(r::ModelResult, results_root::String)
1819
end
1920
n, p = r.cmp_total, r.cmp_pass
2021
if p == n
21-
return """<td class="ok">&#10003; $p/$n</td>"""
22+
# No diff CSV when all signals pass — link the sim CSV instead
23+
short = split(r.name, ".")[end]
24+
sim_csv = joinpath("files", r.name, "$(short)_sim.csv")
25+
csv_link = isfile(joinpath(results_root, sim_csv)) ? """ <a href="$sim_csv">(CSV)</a>""" : ""
26+
return """<td class="ok">&#10003; $p/$n$(csv_link)</td>"""
2227
else
2328
# Link to the interactive diff HTML (next to the CSV, same name, .html extension)
2429
diff_html = replace(r.cmp_csv, r"\.csv$" => ".html")
2530
rel = relpath(isfile(diff_html) ? diff_html : r.cmp_csv, results_root)
26-
return """<td class="fail"><a href="$rel">$p/$n</a></td>"""
31+
csv_link = isempty(r.cmp_csv) ? "" : """ <a href="$(relpath(r.cmp_csv, results_root))">(CSV)</a>"""
32+
return """<td class="fail"><a href="$rel">$p/$n</a>$(csv_link)</td>"""
2733
end
2834
end
2935

src/summary.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ function write_summary(
3737
print(io,
3838
" {\"name\":\"$(_esc_json(r.name))\"," *
3939
"\"export\":$(r.export_success)," *
40+
"\"export_time\":$(@sprintf "%.3f" r.export_time)," *
4041
"\"parse\":$(r.parse_success)," *
42+
"\"parse_time\":$(@sprintf "%.3f" r.parse_time)," *
4143
"\"sim\":$(r.sim_success)," *
44+
"\"sim_time\":$(@sprintf "%.3f" r.sim_time)," *
4245
"\"cmp_total\":$(r.cmp_total)," *
4346
"\"cmp_pass\":$(r.cmp_pass)}$sep\n")
4447
end
@@ -112,15 +115,18 @@ function load_summary(results_root::String)::Union{RunSummary,Nothing}
112115

113116
models = Dict{String,Any}[]
114117
for m in eachmatch(
115-
r"\{\"name\":\"([^\"]*)\",\"export\":(true|false),\"parse\":(true|false),\"sim\":(true|false),\"cmp_total\":(\d+),\"cmp_pass\":(\d+)\}",
118+
r"\{\"name\":\"([^\"]*)\",\"export\":(true|false),\"export_time\":([\d.]+),\"parse\":(true|false),\"parse_time\":([\d.]+),\"sim\":(true|false),\"sim_time\":([\d.]+),\"cmp_total\":(\d+),\"cmp_pass\":(\d+)\}",
116119
txt)
117120
push!(models, Dict{String,Any}(
118-
"name" => string(m.captures[1]),
119-
"export" => m.captures[2] == "true",
120-
"parse" => m.captures[3] == "true",
121-
"sim" => m.captures[4] == "true",
122-
"cmp_total" => parse(Int, m.captures[5]),
123-
"cmp_pass" => parse(Int, m.captures[6]),
121+
"name" => string(m.captures[1]),
122+
"export" => m.captures[2] == "true",
123+
"export_time" => parse(Float64, m.captures[3]),
124+
"parse" => m.captures[4] == "true",
125+
"parse_time" => parse(Float64, m.captures[5]),
126+
"sim" => m.captures[6] == "true",
127+
"sim_time" => parse(Float64, m.captures[7]),
128+
"cmp_total" => parse(Int, m.captures[8]),
129+
"cmp_pass" => parse(Int, m.captures[9]),
124130
))
125131
end
126132
return RunSummary(

0 commit comments

Comments
 (0)