diff --git a/..Rcheck/00check.log b/..Rcheck/00check.log new file mode 100644 index 0000000..7c0caba --- /dev/null +++ b/..Rcheck/00check.log @@ -0,0 +1,14 @@ +* using log directory ‘/home/runner/work/animl-r/animl-r/..Rcheck’ +* using R version 4.3.3 (2024-02-29) +* using platform: x86_64-pc-linux-gnu (64-bit) +* R was compiled by + gcc (Ubuntu 13.2.0-23ubuntu3) 13.2.0 + GNU Fortran (Ubuntu 13.2.0-23ubuntu3) 13.2.0 +* running under: Ubuntu 24.04.4 LTS +* using session charset: UTF-8 +* using options ‘--no-tests --no-manual --no-vignettes --no-build-vignettes’ +* checking for file ‘./DESCRIPTION’ ... ERROR +Required fields missing or empty: + ‘Author’ ‘Maintainer’ +* DONE +Status: 1 ERROR diff --git a/R/detection.R b/R/detection.R index 620ef6a..ce7562e 100644 --- a/R/detection.R +++ b/R/detection.R @@ -48,7 +48,7 @@ detect <- function(detector, resize_width, resize_height, letterbox=TRUE, - category_map=MD_LABELS, + category_map=list('0'='empty', '1'='animal', '2'='human', '3'='vehicle'), confidence_threshold=0.1, file_col='filepath', batch_size=1, diff --git a/R/file_management.R b/R/file_management.R index 659132e..e1c4800 100644 --- a/R/file_management.R +++ b/R/file_management.R @@ -120,7 +120,7 @@ save_data <- function(data, out_file, prompt=TRUE) { #' #' @examples #' \dontrun{ -#' loadData("path/to/newfile.csv") +#' load_data("path/to/newfile.csv") #' } load_data <- function(file) { diff --git a/R/install.R b/R/install.R index 1d64df8..29c8c02 100644 --- a/R/install.R +++ b/R/install.R @@ -1,6 +1,7 @@ # VARIABLE FOR VERSION ANIML_VERSION <- "3.3.2" +#' @noRd animl_module_installed <- function() { tryCatch( { diff --git a/R/zzz.R b/R/zzz.R index 4776c95..fd084a4 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -4,6 +4,10 @@ .onLoad <- function(libname, pkgname) { + # Skip Python loading during R CMD check to avoid interference with checks + if (nchar(Sys.getenv("_R_CHECK_PACKAGE_NAME_")) > 0L) { + return(invisible()) + } # Try to load animl-py, but don't fail if it's not available tryCatch( { @@ -14,16 +18,20 @@ # Store the error state so we can warn users later assign("animl_py_available", FALSE, envir = .animl_internal) }) - } +} .onAttach <- function(libname, pkgname) { - if (!exists("animl_py_available", envir = .animl_internal) || - !get("animl_py_available", envir = .animl_internal)) { - packageStartupMessage( - "Warning: animl-py is not installed.\n", - "animl functionality requires Python 3.12 and animl-py.\n", - "Run animl::animl_install() to set up the Python environment.\n", - "See ?animl::animl_install_instructions for more details." - ) - } - } \ No newline at end of file + # Skip startup message during R CMD check + if (nchar(Sys.getenv("_R_CHECK_PACKAGE_NAME_")) > 0L) { + return(invisible()) + } + if (!exists("animl_py_available", envir = .animl_internal) || + !get("animl_py_available", envir = .animl_internal)) { + packageStartupMessage( + "Warning: animl-py is not installed.\n", + "animl functionality requires Python 3.12 and animl-py.\n", + "Run animl::animl_install() to set up the Python environment.\n", + "See ?animl::animl_install_instructions for more details." + ) + } +} \ No newline at end of file diff --git a/man/detect.Rd b/man/detect.Rd index 2d47f71..8548ffe 100644 --- a/man/detect.Rd +++ b/man/detect.Rd @@ -10,7 +10,7 @@ detect( resize_width, resize_height, letterbox = TRUE, - category_map = MD_LABELS, + category_map = list("0" = "empty", "1" = "animal", "2" = "human", "3" = "vehicle"), confidence_threshold = 0.1, file_col = "filepath", batch_size = 1, diff --git a/man/load_data.Rd b/man/load_data.Rd index 5433820..1c4f159 100644 --- a/man/load_data.Rd +++ b/man/load_data.Rd @@ -17,6 +17,6 @@ Load .csv or .Rdata file } \examples{ \dontrun{ - loadData("path/to/newfile.csv") + load_data("path/to/newfile.csv") } }