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

40 Commits

Author SHA1 Message Date
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
1710e220dd AMR v3.0\! 2025-06-02 12:11:00 +02:00
08a27922a8 new SDD and N for as.sir() 2024-05-20 15:27:04 +02:00
830c67f1bf documentation, unit tests 2023-01-24 10:20:27 +01:00
593d740b84 documentation, file permissions 2023-01-19 12:54:53 +01:00
268ec31d92 unit tests 2023-01-05 18:21:48 +01:00
77d9cf1936 documentation 2022-12-30 13:02:37 +01:00
952d16de33 new, automated website 2022-08-21 16:37:20 +02:00
1b84564d36 (v1.8.1.9011) update prevalence of some genera 2022-06-03 12:43:25 +02:00
2c5bc73ed6 (v1.8.1.9009) random when pkg not loaded 2022-05-16 09:29:46 +02:00
6de5375256 (v1.8.1.9007) website update 2022-05-11 10:10:31 +02:00
152db9d1b5 (v1.8.1.9002) fix for table() on MICs 2022-05-09 17:08:40 +02:00
18e8525d10 (v1.8.0.9001) as.mo improvement, fixes #52 2022-02-26 21:58:23 +01:00
bef0f42f66 (v1.7.0.9001) CLSI 2020 guideline 2021-06-01 15:33:06 +02:00
29dbfa2f49 (v1.6.0.9021) join functions update 2021-05-12 18:15:03 +02:00
2eca8c3f01 (v1.5.0.9014) only_rsi_columns, is.rsi.eligible improvement 2021-02-02 23:57:35 +01:00
4eab095306 (v1.5.0.9006) major documentation update 2021-01-18 16:57:56 +01:00
81af41da3a (v1.4.0.9041) updates based on review 2020-12-17 16:22:25 +01:00
28e77680c5 (v1.4.0) matching score update 2020-10-08 11:16:03 +02:00
1b65d76cfb (v1.2.0.9037) survey on website 2020-07-28 18:39:57 +02:00
76fc8e1b14 (v1.2.0.9026) move to github 2020-07-08 14:48:06 +02:00
e467cc103e (v1.1.0.9017) as.ab() update, added ab_url() 2020-05-22 20:15:19 +02:00
5e2b294351 (v0.9.0.9026) update documentation 2020-02-17 14:38:01 +01:00
ced1a7b7fa (v0.9.0.9008) Happy new year! Add lifecycles 2020-01-05 17:22:09 +01:00
9feef53bde (v0.8.0.9037) complete documentation rewrite 2019-11-28 23:00:37 +01:00
c5f00f4a9f (v0.8.0.9036) complete documentation rewrite 2019-11-28 22:32:17 +01:00
e2d05cb1b0 (v0.8.0.9017) keywords update 2019-11-06 14:43:23 +01:00
493ae2ba0c (v0.6.1.9044) first_isolate fix for species 2019-05-31 14:25:11 +02:00
68a9a35ed6 algorithm update 2019-02-21 18:55:52 +01:00
3efb54d016 freq update 2019-01-29 20:20:09 +01:00
5aad26035c edited g.test 2019-01-12 11:06:58 +01:00
6b2d464f8c big website update, licence txt update 2019-01-02 23:24:07 +01:00
a100d07da6 removed ratio, better rsi_calc, update for freq 2018-08-24 11:08:20 +02:00
1ba7d883fe new ggplot enhancement 2018-08-11 21:30:00 +02:00
b6655f6454 Welcome C++! 2018-07-13 17:23:46 +02:00
f63414d519 new g.test, extra unit tests 2018-07-10 12:27:07 +02:00
3d0d21f322 rename vector2ratio to ratio 2018-07-02 11:14:20 +02:00
3527894b49 new g.test() and edited freq() 2018-07-01 21:40:37 +02:00