Bug: lapply() over a factor yields length-1 factor elements (integer
codes), while for() over a factor yields character strings. The job
list stored j\$group as a factor integer, but the reassembly loop
compared it with identical(j\$group, g) where g was character -- always
FALSE, so no simulation chunks were ever assembled and coverage stayed
NA throughout.
Fix: convert unique_groups to character before building jobs so both
the job list and the reassembly loop use the same type.
Tests: replaced na.rm = TRUE guards with explicit anyNA() checks so the
test suite would have caught the all-NA result immediately.
Also adds a sequential-mode performance hint (analogous to sir.R
lines 1116-1127) when simulations >= 500 and >= 3 regimens.
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
For WISCA: simulations are distributed across (group, chunk) job pairs
via future.apply::future_lapply(), keeping all workers active even when
the regimen count is smaller than nbrOfWorkers(). Sequential fallback
with progress ticker is preserved when parallel = FALSE or workers = 1.
For grouped antibiograms: each group is processed by a separate worker,
mirroring the row-batch approach in as.sir().
Same gate pattern as as.sir() (PR #280): requires a non-sequential
future::plan() to be active; auto-upgrades to parallel = TRUE when a
parallel plan is detected; throws an informative error otherwise.
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF