Skip to content

Commit

Permalink
(v2.1.1.9142) unit test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
msberends committed Feb 7, 2025
1 parent 8ba2e4e commit cc2bb15
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-current-testthat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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).)*

Expand Down
2 changes: 1 addition & 1 deletion PythonPackage/AMR/AMR.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file not shown.
Binary file removed PythonPackage/AMR/dist/amr-2.1.1.9141.tar.gz
Binary file not shown.
Binary file added PythonPackage/AMR/dist/amr-2.1.1.9142.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion PythonPackage/AMR/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='AMR',
version='2.1.1.9141',
version='2.1.1.9142',
packages=find_packages(),
install_requires=[
'rpy2',
Expand Down
29 changes: 14 additions & 15 deletions R/eucast_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
Expand Down Expand Up @@ -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)) {
Expand All @@ -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
Expand Down Expand Up @@ -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 = "")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
----------------------------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit cc2bb15

Please sign in to comment.