1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-31 13:41:42 +02:00
Files
AMR/R
Claude 4ad3812e13 Fix parallel computing in as.sir.data.frame
Six bugs in parallel = TRUE mode:

1. PSOCK workers (Windows / R < 4.0) never had AMR loaded, so every
   exported/AMR function call failed. Added clusterEvalQ(cl, library(AMR))
   with a graceful fallback to sequential when the package cannot be loaded
   (e.g. dev-only load_all() environments).

2. clusterExport'd AMR_env was a frozen serialised copy; as.sir() on the
   worker wrote to AMR:::AMR_env while run_as_sir_column read from the stale
   copy, so the captured log was always wrong. Fixed by resolving AMR_env
   dynamically via get("AMR_env", envir = asNamespace("AMR")) inside the
   worker function, and removing AMR_env from clusterExport.

3. In the fork-based (mclapply) path each worker inherited the parent's full
   sir_interpretation_history. Capturing the whole log then combining across
   workers duplicated every pre-existing entry. Fixed by recording the log
   row count before the as.sir() call and slicing only the new rows
   afterwards.

4. run_as_sir_column used non-exported internals (%pm>%, pm_pull,
   as.sir.default) that are inaccessible on PSOCK workers after library(AMR).
   Replaced pipe chains with direct as.mic(as.character(x[, col, drop=TRUE]))
   and as.disk(...) calls, and changed as.sir.default() to as.sir() which
   dispatches correctly via S3.

5. With info = TRUE, worker forks printed per-column progress messages
   simultaneously, producing garbled interleaved console output. Per-column
   messages are now suppressed inside workers (effective_info = FALSE) while
   the outer "Running in parallel" / "DONE" messages still appear.

6. Malformed Unicode escape \u00a (3 hex digits) in the "DONE" banner was
   parsed by R as U+00AD (soft hyphen) + "ONE"; corrected to  .

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR
2026-04-24 15:31:40 +00:00
..
2025-04-29 16:15:18 +02:00
2026-04-21 22:11:40 +02:00
2026-04-04 11:51:50 +02:00
2026-03-11 16:07:31 +01:00
2026-03-24 12:44:47 +01:00
2025-04-12 11:46:42 +02:00
2026-03-24 12:44:47 +01:00
2025-04-12 11:46:42 +02:00
2026-03-23 10:38:28 +01:00
2025-06-02 12:11:00 +02:00
2025-04-12 11:46:42 +02:00
2026-04-21 22:11:40 +02:00
2025-04-12 11:46:42 +02:00
2025-04-12 11:46:42 +02:00
2026-04-22 08:16:44 +02:00
2026-03-30 10:01:49 +02:00
2026-03-23 10:38:28 +01:00
2025-06-13 16:12:28 +02:00
2026-03-23 10:38:28 +01:00
2026-03-22 20:44:37 +01:00
2025-04-12 11:46:42 +02:00
2026-04-04 11:51:50 +02:00
2025-04-12 11:46:42 +02:00