1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-19 19:02:27 +01:00
Commit Graph

71 Commits

Author SHA1 Message Date
Claude
51f689b069 Pre-evaluate inline expressions, add format_inline_(), fix print.ab
- All bare {variable}/{expression} in message_()/warning_()/stop_() calls
  are now pre-evaluated via paste0(), so users without cli/glue never see
  raw template syntax (mo_source.R, first_isolate.R, join_microorganisms.R,
  antibiogram.R, atc_online.R)
- Add format_inline_() helper: formats a cli-markup string and returns it
  (not emits it), using cli::format_inline() when available and cli_to_plain()
  otherwise
- Rewrite .onAttach to use format_inline_() for all packageStartupMessage
  calls; also adds {.topic} link and {.code} markup for option names
- print.ab: pre-evaluate function_name via paste0 (no .envir needed),
  apply highlight_code() to each example bullet for R syntax highlighting
- join_microorganisms: pre-evaluate {type} and {nrow(...)} expressions

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b
2026-03-19 10:39:26 +00:00
Claude
3928a3de55 Fix {.help} markup to use correct cli link format [{.fun fn}](AMR::fn)
Replace all instances of {.help AMR::fn}() (incorrect format with manual
parentheses outside the link) with {.help [{.fun fn}](AMR::fn)} which is
the correct cli hyperlink syntax: the display text [{.fun fn}] renders the
function name with parentheses automatically, and (AMR::fn) is the link target.

Also update the plain-text fallback handler in aa_helper_functions.R to
extract the display text from the [text](topic) markdown link format,
so that non-cli environments show just the function name (e.g. `fn()`),
not the raw link markup.

Dynamic cases in amr_selectors.R and mo_property.R also updated.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b
2026-03-18 22:37:46 +00:00
Claude
0cc154257a Qualify all {.help} tags with AMR:: and convert backtick ?func references
- Add AMR:: namespace prefix and trailing () to all {.help} cli markup
  so they render as clickable help links (e.g. {.help AMR::as.sir}())
- Convert `?funcname` backtick-quoted help references to {.help AMR::funcname}()
  in aa_helper_functions.R, custom_eucast_rules.R, interpretive_rules.R,
  key_antimicrobials.R, mo.R, plotting.R, resistance_predict.R, and sir.R
- Skipped `?proportion` in sir_calc.R as 'proportion' is not exported

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b
2026-03-18 20:06:52 +00:00
Claude
4798d2c55e Replace {.fun} with {.help} for all exported functions in messaging
All function names referenced via {.fun …} in cli-style messages are
exported in NAMESPACE, so {.help …} is the appropriate markup — it
renders as a clickable help link rather than plain function styling.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b
2026-03-18 16:06:30 +00:00
Claude
ad31fba556 Modernise messaging infrastructure with cli support
Rewrites message_(), warning_(), stop_() to use cli::cli_inform(),
cli::cli_warn(), and cli::cli_abort() when the cli package is available,
with a fully functional plain-text fallback for environments without cli.

Key changes:
- New cli_to_plain() helper converts cli inline markup ({.fun}, {.arg},
  {.val}, {.field}, {.cls}, {.pkg}, {.href}, {.url}, etc.) to readable
  plain-text equivalents for the non-cli fallback path
- word_wrap() simplified: drops add_fn, ANSI re-index algorithm, RStudio
  link injection, and operator spacing hack; returns pasted input unchanged
  when cli is available
- stop_() no longer references AMR_env$cli_abort; uses pkg_is_available()
  directly; passes sys.call() objects to cli::cli_abort() call= argument
- Removed add_fn parameter from message_(), warning_(), and word_wrap()
- All call sites across R/ updated: add_fn arguments removed, some paste0-
  based string construction converted to cli glue syntax ({.fun as.mo},
  {.arg col_mo}, {n} results, etc.)
- cli already listed in Suggests; no DESCRIPTION dependency changes needed

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b
2026-03-18 12:10:17 +00:00
151af21f38 (v3.0.1.9005) re-add tidymodels implementation 2025-12-21 12:19:43 +01: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
1fdab84103 (v2.1.1.9233) chore: make all argument texts full sentences 2025-03-31 14:53:24 +02:00
63099cd81e (v2.1.1.9232) is.mic() iteration, documentation cleanup 2025-03-31 10:51:31 +02: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
640888f408 (v2.1.1.9064) update all microbial taxonomy, add mycobank, big documentation update 2024-07-16 14:53:17 +02:00
bc4f8515e2 new Norwegian link 2024-03-03 23:24:57 +01:00
7be4dabbc0 support veterinary MIC/disk translation 2024-02-24 15:16:52 +01:00
acb534102b new species groups, updated clinical breakpoints 2023-07-08 17:30:05 +02:00
9591688811 documentation update 2023-05-27 10:39:22 +02:00
1a0dc4bf46 revert back to pre-antibiogram 2023-02-09 13:07:39 +01:00
9e99e66f01 use dplyr where available, new antibiogram() for WISCA, fixed Salmonella Typhi/Paratyphi 2023-02-06 11:57:22 +01:00
593d740b84 documentation, file permissions 2023-01-19 12:54:53 +01:00
f619fb683b support new mo codes 2022-12-27 15:16:15 +01:00
Dr. Matthijs Berends
cd2acc4a29 New mo algorithm, prepare for 2.0 2022-10-05 09:12:22 +02:00
4d050aef7c styled, unit test fix 2022-08-28 10:31:50 +02:00
303d61b473 new tibble export 2022-08-27 20:49:37 +02:00
952d16de33 new, automated website 2022-08-21 16:37:20 +02:00
b84d647cac (v1.8.1.9012) update prevalence of some genera 2022-06-03 13:28:55 +02:00
3b2b2be5f8 (v1.8.0.9002) as.rsi() cleanup, more informative warnings 2022-03-02 15:38:55 +01:00
25cef46c59 (v1.8.0) prerelease 1.8.0 2021-12-23 18:56:28 +01:00
8f5e5a3fc2 (v1.7.1.9050) fix for as.mo 2021-10-05 14:00:35 +02:00
2ab21b7af3 (v1.7.1.9026) updated DDDs 2021-08-19 23:43:02 +02:00
a44283f998 (v1.7.1.9024) unit tests 2021-08-17 14:34:11 +02:00
4fbf9e1720 (v1.6.0.9064) prepare new release 2021-05-24 09:34:08 +02:00
a13fd98e8b (v1.6.0.9063) prepare new release 2021-05-24 09:00:11 +02:00
04ef5b28e7 (v1.6.0.9050) printing NA in custom_eucast_rules() 2021-05-20 10:10:40 +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
8b52f9b1be (v1.4.0.9047) unit tests 2020-12-27 00:30:28 +01:00
128ebcfd62 (v1.4.0.9043) documentation update 2020-12-22 00:51:17 +01:00
15c732703d (v1.4.0.9015) bugfix 2020-11-10 16:35:56 +01:00
5a607abb36 (v1.4.0.9011) message formatting 2020-10-27 15:56:51 +01:00
4e9ccb4435 (v1.4.0.9001) is_gram_positive(), is_gram_negative(), parameter hardening 2020-10-19 17:09:19 +02:00
28e77680c5 (v1.4.0) matching score update 2020-10-08 11:16:03 +02:00
4e0374af29 (v1.3.0.9035) mdro() for EUCAST 3.2, examples cleanup 2020-09-29 23:35:46 +02:00
68e6e1e329 (v1.3.0.9034) eucast_rules summary fix 2020-09-29 10:40:25 +02:00
4e40e42011 (v1.3.0.9022) mo_matching_score(), poorman update, as.rsi() fix 2020-09-18 16:05:53 +02:00
c4b87fe241 (v1.3.0.9014) as.mo() speed improvement 2020-09-03 12:31:48 +02:00
6ab468362d (v1.2.0.9034) code cleaning 2020-07-13 09:17:24 +02:00
76fc8e1b14 (v1.2.0.9026) move to github 2020-07-08 14:48:06 +02:00
93a158aebd (v1.2.0.9011) mo_domain(), improved error handling 2020-06-22 11:18:40 +02:00