* Generalise interpretive rules for multi-guideline support (#268)
- Rename data-raw/eucast_rules.tsv → interpretive_rules.tsv; add rule.provider
column (value: "EUCAST") to distinguish future CLSI rows
- Rename EUCAST_RULES_DF → INTERPRETIVE_RULES_DF in _pre_commit_checks.R;
filter by rule.provider == guideline when applying rules in interpretive_rules()
- Rename custom_eucast_rules() → custom_interpretive_rules() with new S3 class
"custom_interpretive_rules"; old function becomes a deprecated wrapper in
zz_deprecated.R; backward-compat S3 dispatch shims added for old class
- Remove stop_if(guideline == "CLSI", ...) so clsi_rules() no longer errors
- Add .onLoad shim in zzz.R to create INTERPRETIVE_RULES_DF from EUCAST_RULES_DF
for transitional compatibility until sysdata.rda is regenerated
https://claude.ai/code/session_01D46BTsfJSPo3HnLWp3PRkP
* Fix namespace load failure: remove assignInNamespace from .onLoad (#268)
assignInNamespace cannot add NEW bindings to a locked package namespace
(R locks namespace bindings before .onLoad runs). Replace the .onLoad
shim with a runtime fallback inside interpretive_rules(): if
INTERPRETIVE_RULES_DF is absent (pre-regeneration sysdata.rda), derive
it from EUCAST_RULES_DF by adding the rule.provider column. This also
fixes the screening_abx line to reuse the already-resolved
interpretive_rules_df_total instead of a bare INTERPRETIVE_RULES_DF
reference.
https://claude.ai/code/session_01D46BTsfJSPo3HnLWp3PRkP
* fixes
* fixes
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add parallel computing support to antibiogram() and wisca() (#281)
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
* Fix version to 3.0.1.9055 and update CLAUDE.md version formula
Uses origin/${defaultbranch} (with a fetch) instead of the local
branch ref so the commit count is never stale after a merge.
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
* Fix non-ASCII characters in antibiogram.R
Replace en/em dashes and non-breaking spaces with ASCII equivalents
to satisfy R CMD check portability requirement.
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
* Update auto-generated Rd files after documentation rebuild
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
* Move parallel gate to top of antibiogram.default() like sir.R
The gate was inside the wisca==TRUE block, so parallel=TRUE with a
sequential plan was silently ignored for non-WISCA antibiograms.
Now the gate runs unconditionally at the top of the function,
identical to the as.sir() pattern: error on explicit parallel=TRUE
with sequential plan, auto-upgrade when a non-sequential plan is
already active.
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
* Fix parallel WISCA returning all NA; strengthen tests; add sequential hint
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
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Migrate parallel computing in as.sir() from parallel:: to future/future.apply
Replace parallel::mclapply() and parallel::parLapply() with
future.apply::future_lapply(), enabling transparent support for any
future backend (multisession, multicore, mirai_multisession, cluster)
on all platforms including Windows.
When parallel = TRUE the function now: (1) respects an active
future::plan() set by the user without overriding it on exit, or
(2) sets a temporary multisession plan with parallelly::availableCores()
and tears it down on exit. The max_cores argument controls worker count
only when no user plan is active.
future and future.apply are added to Suggests in DESCRIPTION.
https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8
* Require user plan() for parallel=TRUE; fix as_wt_nwt false-positive warnings
- parallel = TRUE now errors with a cli-styled message if no non-sequential
future::plan() is active; users must call e.g. future::plan(future::multisession)
before using parallel = TRUE (breaking change)
- Removed auto-setup/teardown of multisession plan inside as.sir(), which was
slow and caused version-mismatch issues with load_all() workflows
- Added as_wt_nwt to the exclusion list in as_sir_method() to suppress
false-positive "no longer used" warnings during parallel runs
- Fixed pieces_per_col row-batch calculation to use n_workers (total available
workers from the active plan) instead of n_cores (workers clipped to n_cols),
so row-batch mode activates correctly when n_cols < n_workers
- Updated @param parallel and @param max_cores roxygen docs; regenerated man/as.sir.Rd
- Updated sequential-mode hint to instruct users to set plan() first
https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8
* fix parallel
* fix parallel
* unit tests
* unit tedts
---------
Co-authored-by: Claude <noreply@anthropic.com>