1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-31 23:41:42 +02:00
Commit Graph

21 Commits

Author SHA1 Message Date
Claude
6ece73cb22 Fix as.sir() data.frame: preserve already-<sir> columns, exclude metadata
Issue #278: two related bugs in the column-detection / type-assignment pipeline.

Bug 1 – already-<sir> columns deleted on re-run
  Line 886 excluded already-sir columns from the type assignment (they
  stayed type "") causing the result loop to do x[,col] <- NULL, deleting
  them.  Fix: drop the !is.sir() guard so all untyped columns fall through
  to type "sir" and are re-processed correctly.

Bug 2 – metadata columns treated as antibiotics
  as.ab("patient") -> OXY, as.ab("ward") -> PRU.  The column detector
  accepted any column whose name matched an antibiotic code, regardless of
  content.  Fix: for name-matched columns that do not already carry an AMR
  class, also verify content looks like AMR data (all_valid_mics, all-
  numeric, or any SIR-like string).  all_valid_disks() is intentionally
  avoided here because it strips letters from strings (as.disk("Pt_1")==1).

Also adds tools/benchmark_parallel.R: a standalone script that times
sequential vs parallel as.sir() across n=20/200/2000/20000 rows and
saves a ggplot2 PNG to tools/benchmark_parallel.png.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR
2026-04-24 21:30:21 +00:00
Claude
ce79dd1f75 Add parallel computing tests to test-sir.R
Eight targeted tests verify correctness of the parallel as.sir() path:
identical SIR output vs sequential, matching log row counts, no
pre-existing history duplication, reproducibility across runs, results
consistency across max_cores values, single-column fallback, and no
per-column worker messages leaking when info = TRUE. All pass when only
1 core is available (parallel silently falls back to sequential).

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR
2026-04-24 20:42:27 +00:00
3a736bc484 (v3.0.1.9041) add breakpoints 2026 2026-03-30 10:01:49 +02:00
499c830ee7 (v3.0.1.9020) unit test fixes 2026-02-09 13:16:36 +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
4d7c4ca52c (v3.0.0.9027) skimr update and as.ab warning - fixes #234, fixes #232 2025-09-10 13:32:52 +02:00
5e6bbdf3d1 (v2.1.1.9267) update ATCs 2025-05-01 11:48:49 +02:00
d2b3937a90 (v2.1.1.9257) adjust unit tests 2025-04-27 09:58:19 +02:00
f340e257fa (v2.1.1.9256) unit tests 2025-04-26 21:29:50 +02:00
be13934fe7 (v2.1.1.9249) unit test 2025-04-20 17:49:47 +02:00
492fe6872f (v2.1.1.9244) automated GPT training data 2025-04-19 15:57:12 +02:00
579025f678 (v2.1.1.9241) fix sir 2025-04-18 13:25:59 +02:00
40d7a971c3 (v2.1.1.9236) documentation 2025-04-12 11:46:42 +02:00
36fd99e1f4 (v2.1.1.9235) New website! 2025-04-08 15:54:30 +01:00
8deaf2c8eb (v2.1.1.9224) skip tests on cran 2025-03-20 23:29:21 +01:00
58d7aa8790 (v2.1.1.9199) fix eucast 2025-03-14 13:43:22 +01:00
861331b1df (v2.1.1.9196) fix eucast, unit tests 2025-03-13 15:38:39 +01:00
9aab129ea6 (v2.1.1.9195) add BTL-S, fix ranks in unknown microorganisms 2025-03-13 14:30:14 +01:00
f7938289eb (v2.1.1.9186) replace antibiotics with antimicrobials! 2025-03-07 20:43:26 +01:00
07efc292bc (v2.1.1.9163) cleanup 2025-02-27 14:04:29 +01:00
f03933940c (v2.1.1.9131) implement testthat 2025-01-27 21:43:10 +01:00