From 747c4cc133dd91b7932bca9a669e684775ba157c Mon Sep 17 00:00:00 2001 From: Wataru Otsubo Date: Wed, 22 Jan 2025 01:38:31 +0900 Subject: [PATCH] update(notebook): reexecute pllld_count (fixed) bypass two broken slave log files --- docs/src/assets/pllld_count.html | 12 ++-- examples/pllld_count.jl | 97 +++++++++++++++++++++++++------- 2 files changed, 84 insertions(+), 25 deletions(-) diff --git a/docs/src/assets/pllld_count.html b/docs/src/assets/pllld_count.html index fc3c53a..f77d51b 100644 --- a/docs/src/assets/pllld_count.html +++ b/docs/src/assets/pllld_count.html @@ -1,17 +1,17 @@ - - + -
\ No newline at end of file +
\ No newline at end of file diff --git a/examples/pllld_count.jl b/examples/pllld_count.jl index 5daeff5..e5546e8 100644 --- a/examples/pllld_count.jl +++ b/examples/pllld_count.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.20.2 +# v0.20.4 using Markdown using InteractiveUtils @@ -184,36 +184,95 @@ combine( ) # ╔═╡ a0baf37c-8b05-49c1-a6a4-027f3404f8b4 -df_reset_failed_though_reconfig_done = combine( - groupby(qaqc_extra_run_results, :id), - AsTable([:psboard_id, :runid]) => - ( - sdf -> begin - @assert nrow(sdf) == 1 +df_reset_failed_though_reconfig_done = transform( + qaqc_extra_run_results, + [:psboard_id, :runid] => + ByRow( + (psboard_id, runid) -> begin + broken_list = @NamedTuple{psbid::Int64, runid::Int64}[ + (psbid = 1050, runid = 385), + (psbid = 1113, runid = 392), + (psbid = 1121, runid = 392), + (psbid = 131, runid = 38), + (psbid = 133, runid = 38), + (psbid = 136, runid = 38), + (psbid = 137, runid = 38), + (psbid = 1545, runid = 474), + (psbid = 16959, runid = 48), + (psbid = 16959, runid = 59), + (psbid = 198, runid = 251), + (psbid = 202, runid = 45), + (psbid = 203, runid = 45), + (psbid = 205, runid = 45), + (psbid = 206, runid = 45), + (psbid = 206, runid = 57), + (psbid = 206, runid = 59), + (psbid = 208, runid = 45), + (psbid = 210, runid = 45), + (psbid = 214, runid = 45), + (psbid = 215, runid = 48), + (psbid = 221, runid = 55), + (psbid = 223, runid = 48), + (psbid = 224, runid = 48), + (psbid = 229, runid = 48), + (psbid = 231, runid = 48), + (psbid = 234, runid = 48), + (psbid = 235, runid = 48), + (psbid = 237, runid = 45), + (psbid = 238, runid = 45), + (psbid = 239, runid = 45), + (psbid = 263, runid = 69), + (psbid = 329, runid = 69), + (psbid = 339, runid = 69), + (psbid = 42, runid = 178), + (psbid = 488791279, runid = 63), + (psbid = 48879, runid = 47), + (psbid = 723, runid = 436), + ] + if (; psbid = psboard_id, runid) in broken_list + @error "broken file psbid: $(psboard_id), runid: $(runid)" + return (; + psboard_id, + runid, + reset_failed_though_reconfig_done = missing, + ) + end - logfilename = "$(sdf.psboard_id[1])_$(sdf.runid[1])_longrun.txt" + logfilename = "$(psboard_id)_$(runid)_longrun.txt" logfile = joinpath("../test/input/slavelogs/main/", logfilename) !ispath(logfile) && begin @warn "logfile $(logfile) not found" return ( - psboard_id = sdf.psboard_id[1], - runid = sdf.runid[1], + psboard_id = psboard_id, + runid = runid, reset_failed_though_reconfig_done = missing, ) end - if sdf.runid[1] == 99 + if runid == 99 @info "skipping runid 99 since it is not exactly 100 run" return ( - psboard_id = sdf.psboard_id[1], - runid = sdf.runid[1], + psboard_id = psboard_id, + runid = runid, reset_failed_though_reconfig_done = missing, ) end - slave_result = + if psboard_id == 1545 && runid == 474 + @info "skipping psbid 1545 runid 474 since it is broken" + return ( + psboard_id = psboard_id, + runid = runid, + reset_failed_though_reconfig_done = missing, + ) + end + slave_result = try PSBoardDataBase.SlaveLogParser.parse_slavelog_file(logfile) + catch e + @error "Failed to parse slavelog file: $(logfile)" + throw(e) + end return ( - psboard_id = sdf.psboard_id[1], - runid = sdf.runid[1], + psboard_id = psboard_id, + runid = runid, reset_failed_though_reconfig_done = count( slave_result.asdtp, ) do asdtp_result @@ -221,7 +280,7 @@ df_reset_failed_though_reconfig_done = combine( asdtp_result.pllld_fail_counter == 10 end, ) - end + end, ) => [:psboard_id, :runid, :reset_failed_though_reconfig_done], ) @@ -236,7 +295,7 @@ let end # ╔═╡ dfeb3900-539f-4d8d-8103-edb67cf4e890 -#CSV.write("reset_failed_though_reconfig_done.csv", df_reset_failed_though_reconfig_done) +#CSV.write("reset_failed_though_reconfig_done.csv", df_reset_failed_though_reconfig_done[:, [:psboard_id, :runid, :reset_failed_though_reconfig_done]]) # ╔═╡ 332b7481-f6dc-4027-a5c5-cf58d5b6acd3 md""" @@ -348,7 +407,7 @@ end barplot( asdtp_result_total_pp7_vs_ch, axis = (; - title = "Campaign 7 B-1-9 PP ASIC7 BCID fail count vs channels", + title = "Campaign 7 B-1-9 PP ASIC7 BCID fail count vs channels", xlabel = "PP ASIC 7 ch id", ylabel = "total number of BCID passed", ),