new: 8th campaign CSV download and preprocessing

This commit is contained in:
Wataru Otsubo 2025-05-15 18:30:27 +09:00
parent a42bf07e7c
commit b4760aed58
6 changed files with 216 additions and 18 deletions

View file

@ -58,4 +58,8 @@ function download_jathub_csv(outfile::AbstractString = tempname())
Downloads.download(URL_JATHUB_CSV, outfile)
end
function download_second_run_csv(outfile::AbstractString = tempname())
URL_SECOND_CSV::String = "https://docs.google.com/spreadsheets/u/0/d/128qOseOy4QDotehYe4Wf2jj88tnwiXGVdR3NHrjcDYU/export?format=csv&id=128qOseOy4QDotehYe4Wf2jj88tnwiXGVdR3NHrjcDYU&gid=717277847"
Downloads.download(URL_SECOND_CSV, outfile)
end
end # module DownloadCSVs

View file

@ -22,7 +22,10 @@ using .DispatchChecker
export create_database
@deprecate create_database_from_exported_csvs(dbpath::AbstractString; kw...) create_database(dbpath; kw...) false
@deprecate create_database_from_exported_csvs(dbpath::AbstractString; kw...) create_database(
dbpath;
kw...,
) false
"""
create_database(
@ -78,13 +81,15 @@ function create_database(
runlist_table,
dispatch_table,
extra_100test_result_df,
jathubs_table =
jathubs_table,
eighth_campaign_df =
map((
(:single_run_csv, DownloadCSVs.download_single_run_csv),
(:runlist_csv, DownloadCSVs.download_runlist_csv),
(:dispatch_csv, DownloadCSVs.download_dispatch_csv),
(:hundred_csv, DownloadCSVs.download_hundred_run_csv),
(:jathubs_csv, DownloadCSVs.download_jathub_csv),
(:eighth_campaign_df, DownloadCSVs.download_second_run_csv),
)) do (key, dlfunc)
if !haskey(kw, key)
Channel{DataFrame}(1) do ch
@ -122,6 +127,8 @@ function create_database(
add_skew_from_slave_clk_logs(db, slavelog_dir)
add_slavelog_result(db, slavelog_dir, jld2_slavelog)
add_eighth_campaign_result(db, eighth_campaign_df)
if !isnothing(jld2_slavelog)
close(jld2_slavelog)
end

View file

@ -976,3 +976,23 @@ function add_slavelog_result(
nothing
end
function prepare_eighth_campaign_result(result_df)
# counting
popat!(result_df, 1)
popat!(result_df, 1)
popat!(result_df, 1)
transform!(
result_df,
:motherboard_id => ByRow(passmissing(id -> parse(Int64, id))) => :motherboard_id,
)
falied_boards = [895, 896, 1142, 1276, 1094, 1095]
result_df
end
function add_eighth_campaign_result(db, result_df)
nothing
end

View file

@ -176,3 +176,11 @@ AS
qaqc_runs.id ASC,
qaqc_positions.id;
CREATE TABLE qaqc_eighth_run_results(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
runid INTEGER NOT NULL,
psboard_id INTEGER NOT NULL,
position INTEGER NOT NULL,
qspip INTEGER NOT NULL,
note TEXT
);