edwindj / ffbase

Basic (statistical) functionality for R package ff
github.com/edwindj/ffbase/wiki
35 stars 15 forks source link

Package ‘ffbase’ was removed from the CRAN repository. #62

Open rdiaz02 opened 2 years ago

rdiaz02 commented 2 years ago

I just noticed that ffbase has been removed from CRAN: https://cran.r-project.org/web/packages/ffbase/index.html (a BioConductor package I maintain is failing to install, test, etc: https://master.bioconductor.org/checkResults/3.15/bioc-LATEST/ADaCGH2/nebbiolo1-install.html).

Is there any intention to have ffbase again on CRAN, or should we look for an alternative? Any suggestions in case we need to look for an alternative?

Thanks!!

jwijffels commented 2 years ago

What was the reason. Can't find it in the R CMD check page at https://cran-archive.r-project.org/web/checks/2022/2022-04-04_check_results_ffbase.html?

rdiaz02 commented 2 years ago

All I know is what is given in the URL above: https://cran.r-project.org/web/packages/ffbase/index.html (for what is worth, I can't find the R CMD results from the page you link either)

jwijffels commented 2 years ago

Probably @edwindj got a message from CRAN about the cause.

rdiaz02 commented 2 years ago

This is specific to the issues with my package, ADaCGH2, (and does not solve the underlying issue) but just for the record of what I finally did.

Since the deadline for passing checks in BioC is this coming Friday, 22 April, I've added functions min.ff, max.ff, and checkRange to the ADaCGH2 code (both packages are GPL-3). I've added all of you, @edwindj , @jwijffels , @djvanderlaan , the three authors listed as authors of ffbase (in https://github.com/edwindj/ffbase/blob/master/pkg/DESCRIPTION) as authors of ADaCGH2 in the Authors field in the DESCRIPTION file (https://github.com/rdiaz02/adacgh2/blob/master/ADaCGH2/DESCRIPTION) , and have given further details in the file README.code.authors (https://github.com/rdiaz02/adacgh2/blob/master/ADaCGH2/README.code.authors) as well as the header of file from-ffbase.R (https://github.com/rdiaz02/adacgh2/blob/master/ADaCGH2/R/from-ffbase.R). This is also shown in the README file itself (https://github.com/rdiaz02/adacgh2#licenses-and-copyright). (The new code is not yet in the BioC Software page, but I expect it to be there in 24 to 48 hours).

edwindj commented 2 years ago

Thanks for reporting and reminding!

The reason that ffbase removed from CRAN was due to an extra check in which the || and && operators should not work with logical with LENGTH > 1.

The email escaped my attention, looking into it and will try to fix it, BTW no problem if you want to copy code to your package!

Best,

Edwin

edwindj commented 2 years ago
 • Calling && or || with either argument of length greater than one

now gives a warning (which it is intended will become an error) and checks with this made into a fatal error can be seen at https://www.stats.ox.ac.uk/pub/bdr/LENGTH1/

jwijffels commented 2 years ago

Error coming from ff package upstream?

* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ffbase.Rcheck’
* using R Under development (unstable) (2022-04-03 r82074)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option ‘--no-stop-on-test-error’
* checking for file ‘ffbase/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘ffbase’ version ‘0.13.3’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘ffbase’ can be installed ... [11s/16s] OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [20s/25s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking pragmas in C/C++ headers and code ... OK
* checking compilation flags used ... OK
* checking compiled code ... OK
* checking examples ... ERROR
Running examples in ‘ffbase-Ex.R’ failed
The error most likely occurred in:

> ### Name: is.na.ff
> ### Title: 'Not Available' / Missing Values for ff vectors
> ### Aliases: is.na.ff is.na<-.ff
> 
> ### ** Examples
> 
> is.na.ff(ff(c(NA, 1:100)), BATCHBYTES=20)
ff (open) logical length=101 (112)
  [1]   [2]   [3]   [4]   [5]   [6]   [7]   [8]        [94]  [95]  [96]  [97] 
 TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE     : FALSE FALSE FALSE FALSE 
 [98]  [99] [100] [101] 
FALSE FALSE FALSE FALSE 
> ## S3 generic
> is.na(ff(c(NA, 1:100)))
ff (open) logical length=101 (112)
  [1]   [2]   [3]   [4]   [5]   [6]   [7]   [8]        [94]  [95]  [96]  [97] 
 TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE     : FALSE FALSE FALSE FALSE 
 [98]  [99] [100] [101] 
FALSE FALSE FALSE FALSE 
> ## Assign a missing value
> x <- ff(c(NA, 1:100))
> is.na(x) <- ff(c(3,5))
 ----------- FAILURE REPORT -------------- 
 --- failure: length > 1 in coercion to logical ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ff
 --- call from context --- 
set.ff(x = x, i = value[i], value = NA, add = FALSE)
 --- call from argument --- 
!is.integer(i) || i < 1
 --- R stacktrace ---
where 1: set.ff(x = x, i = value[i], value = NA, add = FALSE)
where 2: `is.na<-.ff`(`*tmp*`, value = list())
where 3: `is.na<-`(`*tmp*`, value = list())

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, i, value, add = FALSE) 
{
    open(x, assert = TRUE)
    if (is.readonly(x)) 
        stop("ff is readonly")
    if (length(i)) {
        if (is.double(i)) 
            i <- as.integer(i)
        if (!is.integer(i) || i < 1 || i > length(x)) 
            stop("illegal index")
        if (!is.null(vw(x))) 
            stop("please use '[' to access ff with vw")
        if (!is.null(physical(x)$na.count)) 
            stop("use readwrite.ff instead to maintain na.count (or deactivate na.count(x)<-NULL)")
        vm <- vmode(x)
        if (add) 
            attr(x, "physical") <- .Call(C_addset_vec, .ffmode[vm], 
                attr(x, "physical"), i, length(i), as.vmode(value, 
                  vm), PACKAGE = "ff")
        else attr(x, "physical") <- .Call(C_set_vec, .ffmode[vm], 
            attr(x, "physical"), i, length(i), as.vmode(value, 
                vm), PACKAGE = "ff")
    }
    x
}
<bytecode: 0x3284968>
<environment: namespace:ff>
 --- function search by body ---
Function set.ff in namespace ff has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: length > 1 in coercion to logical
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’ [8s/10s]
 [8s/11s] ERROR
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > #library(ffbase)
  > library(testthat)
  > 
  > test_check("ffbase")
  Loading required package: ffbase
  Loading required package: ff
  Loading required package: bit

  Attaching package: 'bit'

  The following object is masked from 'package:base':

      xor

  Attaching package ff
  - getOption("fftempdir")=="/tmp/Rtmp8mg79t/working_dir/RtmpzEygFN/ff"

  - getOption("ffextension")=="ff"

  - getOption("ffdrop")==TRUE

  - getOption("fffinonexit")==TRUE

  - getOption("ffpagesize")==65536

  - getOption("ffcaching")=="mmnoflush"  -- consider "ffeachflush" if your system stalls on large writes

  - getOption("ffbatchbytes")==16777216 -- consider a different value for tuning your system

  - getOption("ffmaxbytes")==536870912 -- consider a different value for tuning your system

  Attaching package: 'ff'

  The following objects are masked from 'package:utils':

      write.csv, write.csv2

  The following objects are masked from 'package:base':

      is.factor, is.ordered

  Registered S3 methods overwritten by 'ffbase':
    method   from
    [.ff     ff  
    [.ffdf   ff  
    [<-.ff   ff  
    [<-.ffdf ff  

  Attaching package: 'ffbase'

  The following objects are masked from 'package:base':

      %in%, table

   ----------- FAILURE REPORT -------------- 
   --- failure: length > 1 in coercion to logical ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ff
   --- call from context --- 
  set.ff(x = x, i = value, value = NA, add = FALSE)
   --- call from argument --- 
  !is.integer(i) || i < 1
   --- R stacktrace ---
  where 1: set.ff(x = x, i = value, value = NA, add = FALSE)
  where 2: `is.na<-.ff`(`*tmp*`, value = c(54L, 29L, 58L, 87L, 75L, 56L, 
  51L, 50L, 48L, 3L, 33L, 34L, 66L, 64L, 40L, 98L, 20L, 78L, 25L, 
  71L, 86L, 61L, 22L, 95L, 90L, 97L, 53L, 31L, 46L, 24L, 60L, 30L, 
  23L, 17L, 59L, 57L, 43L, 68L, 26L, 36L, 45L, 8L, 15L, 79L, 70L, 
  91L, 39L, 76L, 38L, 77L))
  where 3 at testisna.R#17: `is.na<-`(`*tmp*`, value = c(54L, 29L, 58L, 87L, 75L, 56L, 51L, 
  50L, 48L, 3L, 33L, 34L, 66L, 64L, 40L, 98L, 20L, 78L, 25L, 71L, 
  86L, 61L, 22L, 95L, 90L, 97L, 53L, 31L, 46L, 24L, 60L, 30L, 23L, 
  17L, 59L, 57L, 43L, 68L, 26L, 36L, 45L, 8L, 15L, 79L, 70L, 91L, 
  39L, 76L, 38L, 77L))
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame(), reporter = reporter)
  where 15 at testisna.R#6: test_that("isna works", {
      size <- 100
      x <- rnorm(size)
      x[sample(1:size, round(size/2))] <- NA
      test.ram <- is.na(x)
      test.ff <- is.na.ff(ff(x), by = 2)
      expect_equal(test.ram, test.ff[])
      x <- rnorm(size)
      x.ff <- as.ff(x)
      idx <- sample(1:size, round(size/2))
      is.na(x.ff) <- idx
      x[idx] <- NA
      test.ram <- is.na(x)
      test.ff <- is.na(x.ff)
      expect_equal(test.ram, test.ff[])
      x <- rnorm(size)
      x.ff <- as.ff(x)
      idx <- sample(1:size, round(size/2))
      x[idx] <- NA
      idx <- as.ff(idx)
      is.na(x.ff) <- idx
      test.ram <- is.na(x)
      test.ff <- is.na(x.ff)
      expect_equal(test.ram, test.ff[])
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, child_env(env), wrap = wrap)
  where 28: FUN(X[[i]], ...)
  where 29: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  where 30: doTryCatch(return(expr), name, parentenv, handler)
  where 31: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 32: tryCatchList(expr, classes, parentenv, handlers)
  where 33: tryCatch(code, testthat_abort_reporter = function(cnd) {
      cat(conditionMessage(cnd), "\n")
      NULL
  })
  where 34: with_reporter(reporters$multi, lapply(test_paths, test_one_file, 
      env = env, wrap = wrap))
  where 35: test_files(test_dir = test_dir, test_package = test_package, 
      test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, 
      env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap, load_package = load_package)
  where 36: test_files(test_dir = path, test_paths = test_paths, test_package = package, 
      reporter = reporter, load_helpers = load_helpers, env = env, 
      stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap, load_package = load_package, parallel = parallel)
  where 37: test_dir("testthat", package = package, reporter = reporter, 
      ..., load_package = "installed")
  where 38: test_check("ffbase")

   --- value of length: 50 type: logical ---
   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
  [49] FALSE FALSE
   --- function from context --- 
  function (x, i, value, add = FALSE) 
  {
      open(x, assert = TRUE)
      if (is.readonly(x)) 
          stop("ff is readonly")
      if (length(i)) {
          if (is.double(i)) 
              i <- as.integer(i)
          if (!is.integer(i) || i < 1 || i > length(x)) 
              stop("illegal index")
          if (!is.null(vw(x))) 
              stop("please use '[' to access ff with vw")
          if (!is.null(physical(x)$na.count)) 
              stop("use readwrite.ff instead to maintain na.count (or deactivate na.count(x)<-NULL)")
          vm <- vmode(x)
          if (add) 
              attr(x, "physical") <- .Call(C_addset_vec, .ffmode[vm], 
                  attr(x, "physical"), i, length(i), as.vmode(value, 
                    vm), PACKAGE = "ff")
          else attr(x, "physical") <- .Call(C_set_vec, .ffmode[vm], 
              attr(x, "physical"), i, length(i), as.vmode(value, 
                  vm), PACKAGE = "ff")
      }
      x
  }
  <bytecode: 0x59c7088>
  <environment: namespace:ff>
   --- function search by body ---
  Function set.ff in namespace ff has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: length > 1 in coercion to logical
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 2 ERRORs
See
  ‘/data/gannet/ripley/R/packages/tests-LENGTH1/ffbase.Rcheck/00check.log’
for details.

Command exited with non-zero status 1
Time 1:53.61, 71.86 + 7.83
jwijffels commented 2 years ago

https://github.com/truecluster/ff/issues/11

jwijffels commented 2 years ago

solution is upstream fix in package ff as indicated in pull request https://github.com/truecluster/ff/pull/12

achubaty commented 2 years ago

what is the ETA for getting a fixed version to CRAN? I currently depend on this package, but will need to remove the dependency if it's no longer being maintained.

jwijffels commented 2 years ago

what is the ETA for getting a fixed version to CRAN? I currently depend on this package, but will need to remove the dependency if it's no longer being maintained.

Good question. As the upstream fix in ff is accepted and CRAN has that fixed ff package (4.0.7), ffbase can be just put on CRAN again without any changes (expect bumping the version number). I performed R CMD check on winbuilder just now and it passed smoothly.