update(DispatchChecker): add new criteria for campaign 6

New THRESHOLD_INSUFFICIENT_RESET_WITH_10 (from 10 to 5) #16
This commit is contained in:
Wataru Otsubo 2024-12-12 13:11:05 +09:00
parent 2aedfaf380
commit 4924c5fdd6

View file

@ -24,16 +24,19 @@ mutable struct DbConnection
db::SQLite.DB db::SQLite.DB
df_single_result::DataFrame df_single_result::DataFrame
df_extra_results::DataFrame df_extra_results::DataFrame
df_runs::DataFrame
function DbConnection(db::SQLite.DB) function DbConnection(db::SQLite.DB)
df_single_results = df_single_results =
DBInterface.execute(db, sql"select * from qaqc_single_run_results") |> DataFrame DBInterface.execute(db, sql"select * from qaqc_single_run_results") |> DataFrame
df_extra_results = df_extra_results =
DBInterface.execute(db, sql"select * from qaqc_extra_run_results") |> DataFrame DBInterface.execute(db, sql"select * from qaqc_extra_run_results") |> DataFrame
new(db, df_single_results, df_extra_results) df_runs = DBInterface.execute(db, sql"select * from qaqc_runs") |> DataFrame
new(db, df_single_results, df_extra_results, df_runs)
end end
end end
THRESHOLD_INSUFFICIENT_RESET_WITH_10 = 0.1 THRESHOLD_INSUFFICIENT_RESET_WITH_10_CAMPAIGN_1to5 = 0.1
THRESHOLD_INSUFFICIENT_RESET_WITH_10_CAMPAIGN_6 = 0.05
THRESHOLD_RESET_FAILED_THOUGH_RECONFIG_DONE = 0.1 THRESHOLD_RESET_FAILED_THOUGH_RECONFIG_DONE = 0.1
THRESHOLD_ALWAYS_HIT_FLAG_TRUE = 0.1 THRESHOLD_ALWAYS_HIT_FLAG_TRUE = 0.1
THRESHOLD_BCID_FAIL = 0.1 THRESHOLD_BCID_FAIL = 0.1
@ -75,9 +78,21 @@ function is_dispatchable(conn::DbConnection, psbid::Int64)
nrow(extra_results) == 1 && let nrow(extra_results) == 1 && let
extra_result = Tables.rowtable(extra_results) |> first extra_result = Tables.rowtable(extra_results) |> first
f1 = f1 =
!ismissing(extra_result.insufficient_reset_with_10) && !ismissing(extra_result.insufficient_reset_with_10) && begin
campaign_id =
filter(:id => ==(extra_result.runid), conn.df_runs).campaign_id
@assert length(campaign_id) == 1
campaign_id = first(campaign_id)
if campaign_id 5
extra_result.insufficient_reset_with_10 >= extra_result.insufficient_reset_with_10 >=
extra_result.num_tests * THRESHOLD_INSUFFICIENT_RESET_WITH_10 extra_result.num_tests *
THRESHOLD_INSUFFICIENT_RESET_WITH_10_CAMPAIGN_1to5
else
extra_result.insufficient_reset_with_10 >=
extra_result.num_tests *
THRESHOLD_INSUFFICIENT_RESET_WITH_10_CAMPAIGN_6
end
end
f2 = f2 =
!ismissing(extra_result.reset_failed_though_reconfig_done) && !ismissing(extra_result.reset_failed_though_reconfig_done) &&
extra_result.reset_failed_though_reconfig_done >= extra_result.reset_failed_though_reconfig_done >=