diff --git a/.github/workflows/check-current-testthat.yaml b/.github/workflows/check-current-testthat.yaml index be69d5abb..a33ddb311 100644 --- a/.github/workflows/check-current-testthat.yaml +++ b/.github/workflows/check-current-testthat.yaml @@ -86,7 +86,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rcmdcheck, any::pkgload + extra-packages: any::rcmdcheck needs: check upgrade: 'TRUE' diff --git a/DESCRIPTION b/DESCRIPTION index 04cff6d1c..01f679750 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9141 +Version: 2.1.1.9142 Date: 2025-02-07 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 1d47cfa65..ab670e3d7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9141 +# AMR 2.1.1.9142 *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)* diff --git a/PythonPackage/AMR/AMR.egg-info/PKG-INFO b/PythonPackage/AMR/AMR.egg-info/PKG-INFO index 9cf5ed913..07d00dadb 100644 --- a/PythonPackage/AMR/AMR.egg-info/PKG-INFO +++ b/PythonPackage/AMR/AMR.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.2 Name: AMR -Version: 2.1.1.9141 +Version: 2.1.1.9142 Summary: A Python wrapper for the AMR R package Home-page: https://github.com/msberends/AMR Author: Matthijs Berends diff --git a/PythonPackage/AMR/dist/AMR-2.1.1.9141-py3-none-any.whl b/PythonPackage/AMR/dist/AMR-2.1.1.9142-py3-none-any.whl similarity index 85% rename from PythonPackage/AMR/dist/AMR-2.1.1.9141-py3-none-any.whl rename to PythonPackage/AMR/dist/AMR-2.1.1.9142-py3-none-any.whl index 4fe0a786c..e8d2f2843 100644 Binary files a/PythonPackage/AMR/dist/AMR-2.1.1.9141-py3-none-any.whl and b/PythonPackage/AMR/dist/AMR-2.1.1.9142-py3-none-any.whl differ diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9141.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9141.tar.gz deleted file mode 100644 index 9e221074e..000000000 Binary files a/PythonPackage/AMR/dist/amr-2.1.1.9141.tar.gz and /dev/null differ diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9142.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9142.tar.gz new file mode 100644 index 000000000..e6d0a2557 Binary files /dev/null and b/PythonPackage/AMR/dist/amr-2.1.1.9142.tar.gz differ diff --git a/PythonPackage/AMR/setup.py b/PythonPackage/AMR/setup.py index 828e19a18..03d90f6e9 100644 --- a/PythonPackage/AMR/setup.py +++ b/PythonPackage/AMR/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='AMR', - version='2.1.1.9141', + version='2.1.1.9142', packages=find_packages(), install_requires=[ 'rpy2', diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 2a83872b8..0b7319ac7 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -460,16 +460,14 @@ eucast_rules <- function(x, # >>> Apply Other rules: enzyme inhibitors <<< ------------------------------------------ if (any(c("all", "other") %in% rules)) { if (isTRUE(info)) { - cat("\n") + cat(paste0("\n", font_grey(strrep("-", 0.95 * getOption("width", 100))), "\n")) cat(word_wrap( - font_bold(paste0( - "Rules by this AMR package (", - font_red(paste0( - "v", utils::packageDescription("AMR")$Version, ", ", - format(as.Date(utils::packageDescription("AMR")$Date), format = "%Y") - )), "), see `?eucast_rules`\n" - )) + paste0("Rules by the ", + font_bold(paste0("AMR package v", utils::packageDescription("AMR")$Version)), + " (", format(as.Date(utils::packageDescription("AMR")$Date), format = "%Y"), + "), see `?eucast_rules`\n") )) + cat("\n\n") } ab_enzyme <- subset(AMR::antibiotics, name %like% "/")[, c("ab", "name"), drop = FALSE] colnames(ab_enzyme) <- c("enzyme_ab", "enzyme_name") @@ -495,8 +493,8 @@ eucast_rules <- function(x, ## Set base to R where base + enzyme inhibitor is R ---- rule_current <- paste0( - ab_enzyme$base_name[i], " ('", font_bold(col_base), "') = R if ", - tolower(ab_enzyme$enzyme_name[i]), " ('", font_bold(col_enzyme), "') = R" + ab_enzyme$base_name[i], " (`", col_base, "`) = R if ", + tolower(ab_enzyme$enzyme_name[i]), " (`", col_enzyme, "`) = R" ) if (isTRUE(info)) { cat(word_wrap(rule_current, @@ -536,8 +534,8 @@ eucast_rules <- function(x, ## Set base + enzyme inhibitor to S where base is S ---- rule_current <- paste0( - ab_enzyme$enzyme_name[i], " ('", font_bold(col_enzyme), "') = S if ", - tolower(ab_enzyme$base_name[i]), " ('", font_bold(col_base), "') = S" + ab_enzyme$enzyme_name[i], " (`", col_enzyme, "`) = S if ", + tolower(ab_enzyme$base_name[i]), " (`", col_base, "`) = S" ) if (isTRUE(info)) { @@ -559,7 +557,8 @@ eucast_rules <- function(x, original_data = x.bak, warned = warned, info = info, - verbose = verbose + verbose = verbose, + overwrite = overwrite ) n_added <- n_added + run_changes$added n_changed <- n_changed + run_changes$changed @@ -1037,9 +1036,9 @@ eucast_rules <- function(x, cat(paste0(font_grey(strrep("-", 0.95 * getOption("width", 100))), "\n")) if (isFALSE(verbose) && total_n_added + total_n_changed > 0) { - cat("\n", word_wrap("Use ", font_bold("eucast_rules(..., verbose = TRUE)"), " (on your original data) to get a data.frame with all specified edits instead."), "\n\n", sep = "") + cat("\n", word_wrap("Use `eucast_rules(..., verbose = TRUE)` (on your original data) to get a data.frame with all specified edits instead."), "\n\n", sep = "") } else if (isTRUE(verbose)) { - cat("\n", word_wrap("Used 'Verbose mode' (", font_bold("verbose = TRUE"), "), which returns a data.frame with all specified edits.\nUse ", font_bold("verbose = FALSE"), " to apply the rules on your data."), "\n\n", sep = "") + cat("\n", word_wrap("Used 'Verbose mode' (`verbose = TRUE`), which returns a data.frame with all specified edits.\nUse `verbose = FALSE` to apply the rules on your data."), "\n\n", sep = "") } } diff --git a/data-raw/gpt_training_text_v2.1.1.9141.txt b/data-raw/gpt_training_text_v2.1.1.9142.txt similarity index 99% rename from data-raw/gpt_training_text_v2.1.1.9141.txt rename to data-raw/gpt_training_text_v2.1.1.9142.txt index e20604b69..f09d09aab 100644 --- a/data-raw/gpt_training_text_v2.1.1.9141.txt +++ b/data-raw/gpt_training_text_v2.1.1.9142.txt @@ -1,6 +1,6 @@ This knowledge base contains all context you must know about the AMR package for R. You are a GPT trained to be an assistant for the AMR package in R. You are an incredible R specialist, especially trained in this package and in the tidyverse. -First and foremost, you are trained on version 2.1.1.9141. Remember this whenever someone asks which AMR package version you’re at. +First and foremost, you are trained on version 2.1.1.9142. Remember this whenever someone asks which AMR package version you’re at. Below are the contents of the file, the file, and all the files (documentation) in the package. Every file content is split using 100 hypens. ---------------------------------------------------------------------------------------------------- diff --git a/tests/testthat/test-zzz.R b/tests/testthat/test-zzz.R index 70bc10801..3a704b403 100644 --- a/tests/testthat/test-zzz.R +++ b/tests/testthat/test-zzz.R @@ -141,8 +141,7 @@ call_functions <- c( import_functions <- c(import_functions, call_functions) -suggests <- tryCatch(strsplit(pkgload::pkg_desc()$get_field("Suggests"), "[,\n ]+")[[1]], - error = function(e) unname(import_functions)) +suggests <- strsplit(utils::packageDescription("AMR")$Suggests, "[,\n ]+")[[1]] for (i in seq_len(length(import_functions))) { fn <- names(import_functions)[i] pkg <- unname(import_functions[i])