1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-14 01:50:51 +02:00
Commit Graph

844 Commits

Author SHA1 Message Date
155c2707ce add fn 2026-05-05 12:41:45 +02:00
a5e8beff69 prepare for documentation 2026-05-03 11:50:05 +02:00
0af3f84655 (v3.0.1.9057) website fix 2026-05-02 14:56:26 +02:00
Matthijs Berends
24f24ecaf8 Generalise interpretive rules for multi-guideline support (#268) (#283)
* 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>
2026-05-01 18:38:51 +01:00
Matthijs Berends
f7e9294bea Add parallel computing support to antibiogram() and wisca() (#281) (#282)
* 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>
2026-04-30 18:41:56 +01:00
Matthijs Berends
23beebc6c3 Migrate parallel computing in as.sir() from parallel:: to future/future.apply (#280)
* 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>
2026-04-30 08:57:19 +01:00
3f1b20c304 (v3.0.1.9052) fix NEWS 2026-04-25 16:21:31 +02:00
e7780b6d5f (v3.0.1.9048) fix #275 2026-04-22 08:16:44 +02:00
e0f8cf0882 (v3.0.1.9047) fix #272 2026-04-21 22:11:40 +02:00
Matthijs Berends
8ff5d4472a Add add_if_missing parameter to control NA handling in interpretive rules (#264) 2026-04-21 21:53:43 +02:00
26613d774b (v3.0.1.9042) add EUCAST breakpoint table v16 to interpretive_rules() 2026-04-02 11:42:19 +02:00
3a736bc484 (v3.0.1.9041) add breakpoints 2026 2026-03-30 10:01:49 +02:00
3d1412e8c9 (v3.0.1.9037) improve cli messages 2026-03-22 20:44:37 +01:00
4dc3ec0008 (v3.0.1.9034) Add amr_course() 2026-03-11 16:07:31 +01:00
353eaa3f38 (v3.0.1.9033) add ionophores(), clorobiocin, aminocoumarins group 2026-03-09 11:57:36 +01:00
b6f8584994 (v3.0.1.9031) fix MDRO for non-RStudio terminal 2026-03-08 11:30:18 +01:00
daab605ca4 (v3.0.1.9028) fix unique CIDs 2026-03-06 18:53:42 +01:00
c0a394008e (v3.0.1.9027) Fixes #252 and add documentation update regarding #253 2026-03-06 13:10:33 +01:00
60e8f2bae6 (v3.0.1.9026) fix ab_group(NA) 2026-03-06 12:41:27 +01:00
b6211931f8 (v3.0.1.9022) add ceftibuten/avibactam (CTA), kasugamycin (KAS), ostreogrycin (OST), thiostrepton (THS), xeruborbactam (XER), zorbamycin (ZOR) 2026-03-03 15:41:08 +01:00
12cf144b19 (v3.0.1.9021) add guideline to resistance() and susceptibility() 2026-02-12 20:34:06 +01:00
499c830ee7 (v3.0.1.9020) unit test fixes 2026-02-09 13:16:36 +01:00
ba4c159154 (v3.0.1.9019) Wildtype/Non-wildtype support, and start with interpretive_rules()
Fixes #246
Fixes #254
Fixes #255
Fixes #256
2026-02-08 23:15:40 +01:00
2df2911cf4 (v3.0.1.9018) fixes #249
updates AB groups
2026-01-16 10:57:03 +01:00
fd50c51543 (v3.0.1.9017) fix documentation 2026-01-08 14:03:02 +01:00
cfbbfb4fa5 (v3.0.1.9007) fix #246 2026-01-06 23:08:50 +01:00
151af21f38 (v3.0.1.9005) re-add tidymodels implementation 2025-12-21 12:19:43 +01:00
225c73f7e7 (v3.0.1.9004) Revamp as.sir() interpretation for capped MICs
Fixes #243
Fixes #244
2025-12-15 13:18:13 +01:00
ba30b08f76 (v3.0.1.9003) Add taniborbactam and cefepime/taniborbactam 2025-11-24 11:24:02 +01:00
0b24967b23 (v3.0.1.9001) fix antibiogram 2025-09-30 10:54:07 +02:00
adee419f1c v3.0.1 2025-09-20 17:14:07 +01:00
10ba36821e (v3.0.0.9034) fix MycoBank synonyms 2025-09-18 13:58:34 +01:00
3ba1b8a10a (v3.0.0.9022) postpone new features - we like a clearly focussed bugfix release first 2025-09-03 15:39:44 +02:00
60bd631e1a (v3.0.0.9019) Fixes #229, #230, #227, #225 2025-09-01 16:56:55 +02:00
9b07a8573a (v3.0.0.9018) keep all reasons in mdro(), fixed #227 2025-08-07 16:23:47 +02:00
6cb724a208 (v3.0.0.9015) plotting fix 2025-07-19 14:06:36 +02:00
49274f010b (v3.0.0.9014) fix plot colours 2025-07-18 15:57:48 +02:00
39ea5f6597 (v3.0.0.9011) allow names for age_groups() 2025-07-17 19:32:46 +02:00
d94bdd2c6a (v3.0.0.9008) fix ggplot_sir(), support lighter green for SDD 2025-07-17 17:05:41 +02:00
8dab0a3730 (v3.0.0.9007) allow any tidyselect language in as.sir() 2025-07-17 14:29:35 +02:00
72db2b2562 (v3.0.0.9003) eucast_rules fix, new tidymodels integration 2025-06-13 14:03:21 +02:00
753f0e1ef9 (v3.0.0.9001) the first fixes 2025-06-04 13:10:20 +02:00
1710e220dd AMR v3.0\! 2025-06-02 12:11:00 +02:00
d384b492cf (v2.1.1.9289) unit test fix 2025-06-01 16:00:12 +02:00
5667ce3eae (v2.1.1.9287) fix antibiotics 2025-06-01 12:17:47 +02:00
e70f3de02e (v2.1.1.9286) deprecate antibiotics better, add ATC for ceftaroline 2025-06-01 11:54:40 +02:00
38cebc1541 (v2.1.1.9279) fix documentation, add foreign S3 exports to functions 2025-05-16 16:55:29 +02:00
139f79d372 (v2.1.1.9278) support AMR selectors in custom MDRO guideline 2025-05-16 11:20:19 +02:00
b8d7c8af7f (v2.1.1.9277) mdro fix 2025-05-15 13:07:47 +02:00
4b171745de (v2.1.1.9276) mdro() fix 2025-05-15 10:39:48 +02:00