New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergeCache #18

Merged
merged 2 commits into from Mar 29, 2018

Conversation

Projects
None yet
3 participants
@eliotmcintire
Contributor

eliotmcintire commented Mar 29, 2018

No description provided.

eliotmcintire added some commits Mar 29, 2018

@eliotmcintire eliotmcintire merged commit 92b4051 into development Mar 29, 2018

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@eliotmcintire eliotmcintire deleted the mergeCache branch Mar 29, 2018

@lintr-bot

This comment has been minimized.

lintr-bot commented Mar 29, 2018

inst/examples/example_Cache.R:171:1: style: Trailing blank lines are superfluous.

^

R/cache-helpers.R:952:3: style: Commented code should be removed.

# loadFromLocalRepoMem <- memoise::memoise(loadFromLocalRepo)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:99:69: style: Put spaces around all infix operators.

if (all(!is.na(rastersInRepo$artifact)) && NROW(rastersInRepo)>0) {
                                                                   ~^~

R/cache-tools.R:108:85: style: Do not place spaces around code in parentheses or square brackets.

dirLs <- unlist(lapply(basename(filesToRemove), grep, dirLs, value = TRUE) )
                                                                                    ^

R/cache-tools.R:127:69: style: Put spaces around all infix operators.

if (all(!is.na(rastersInRepo$artifact)) && NROW(rastersInRepo)>0) {
                                                                   ~^~

R/cache-tools.R:132:9: style: Commented code should be removed.

# fn <- unique(objsDT[tagKey == "memoisedFunction", tagValue])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:134:11: style: Commented code should be removed.

#   forget(.memoisedCacheFuns[[f]])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:279:1: style: Lines should not be more than 100 characters.

userTags <- cacheFromList[artifact][!tagKey %in% c("format", "name", "class", "date", "cacheId"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:151:1: style: Lines should not be more than 100 characters.

#'        object (from e.g., \code{asPath(filename)}) or it is a \code{Raster} with file-backing, then this will be
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:273:1: style: Lines should not be more than 100 characters.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:273:20: style: Only use double-quotes.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                   ^~~~~~~

R/cache.R:273:37: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                                    ^

R/cache.R:289:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!objOverride)) { # put into .reproEnv
                           ^

R/cache.R:311:26: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!prevVals)){ # don't override previous values -- except for userTags
                         ^

R/cache.R:325:27: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(objOverride)) { # get from .reproEnv
                          ^

R/cache.R:346:13: style: Commented code should be removed.

#       rawFunName <- deparse(substitute(FUN, env = whereInStack("Cache")))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:347:13: style: Commented code should be removed.

#       funName <- paste0("Cache_", rawFunName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:349:15: style: Commented code should be removed.

#         .memoisedCacheFuns[[funName]] <- CacheMem
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:353:17: style: Commented code should be removed.

#           forget(.memoisedCacheFuns[[funName]])
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:356:13: style: Commented code should be removed.

#       mc <- match.call(expand.dots = TRUE)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:357:13: style: Commented code should be removed.

#       mc[[1]] <- as.name(funName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:358:13: style: Commented code should be removed.

#       mc <- as.list(mc)
            ^~~~~~~~~~~~~~~~~

R/cache.R:359:13: style: Commented code should be removed.

#       mc$quick <- NA
            ^~~~~~~~~~~~~~

R/cache.R:360:13: style: Commented code should be removed.

#       mc[[1]] <- NULL
            ^~~~~~~~~~~~~~~

R/cache.R:361:13: style: Commented code should be removed.

#       mc$userTags <- c(paste0("memoisedFunction:",funName), mc$userTags)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:362:13: style: Commented code should be removed.

#       out <- do.call(.memoisedCacheFuns[[funName]], mc)#)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:365:17: style: Commented code should be removed.

#           md5Hash <- searchInLocalRepo(pattern = attr(out, "tags"), repoDir = cacheRepo)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:371:17: style: Commented code should be removed.

#           .cacheMessage("", paste("Memoised",rawFunName))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:374:13: style: Commented code should be removed.

#       return(out)
            ^~~~~~~~~~~

R/cache.R:379:9: style: Commented code should be removed.

#   quick <- TRUE
        ^~~~~~~~~~~~~

R/cache.R:538:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endHashTime, startHashTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:553:1: style: Lines should not be more than 100 characters.

preDigestUnlistNames <- unlist(lapply(strsplit(names(preDigestUnlist), split = "\\."), tail, 1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:556:1: style: Lines should not be more than 100 characters.

hashDetails$objSize[preDigestUnlistNames %in% hashObjectSizeNames] <- hashObjectSize[hashObjectSizeNames %in% preDigestUnlistNames]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:563:9: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​        {
        ^

R/cache.R:631:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endLoadTime, startLoadTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:749:18: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (FALSE) { # INCOMPLETE
                 ^

R/cache.R:755:58: style: Commas should always have a space after.

similarObjs <- loadFromLocalRepo(similar[1,artifact],
                                                         ^

R/cache.R:785:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endRunTime, startRunTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:793:1: style: Lines should not be more than 100 characters.

# on.exit({message("Running ", functionDetails$functionName, " took ", format(endRunTime - startRunTime))},
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:924:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endSaveTime, startSaveTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:986:3: style: Commented code should be removed.

# .memoisedCacheFuns <- new.env(parent = asNamespace("reproducible"))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:987:3: style: Commented code should be removed.

# CacheMem <- memoise::memoise(Cache)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:989:34: style: Place a space before left parenthesis, except in a function call.

​.formalsCache <- formals(Cache)[-(1:2)]
                                 ^

R/objectSize.R:29:1: style: Variable or function name should be lowerCamelCase.

objSize.list <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~

R/objectSize.R:36:1: style: Variable or function name should be lowerCamelCase.

objSize.environment <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~~~~~

R/objectSize.R:47:1: style: Variable or function name should be lowerCamelCase.

objSize.default <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~

R/objectSize.R:53:1: style: Variable or function name should be lowerCamelCase.

objSize.Path <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~

R/packages.R:121:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (is.name(subpackages)) { # single, non quoted object
                            ^

R/packages.R:123:1: style: Lines should not be more than 100 characters.

if (!exists(subpackages, envir = parent.frame())) # if it does exist, then it is not a name, but an object
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:145:31: style: Commented code should be removed.

nonLibPathPkgs <- ips # unlist(lapply(nonLibPathPaths, dir))
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Lines should not be more than 100 characters.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Variable or function name should be lowerCamelCase.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:85: style: Opening curly braces should never go on their own line and should always be followed by a new line.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
                                                                                    ^

R/packages.R:807:1: style: Lines should not be more than 100 characters.

#' @importFrom utils read.table available.packages installed.packages install.packages assignInMyNamespace
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:198:5: style: Commented code should be removed.

# isFirstElemAnObj <- exists(as.character(lhs[[1]][[1]]))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:200:7: style: Commented code should be removed.

#   lhs[[1]] <- lhs[[1]][[1]]
      ^~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:217:6: style: Commented code should be removed.

#rhss[[1]] <- rhss[[1]][-2]
     ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:254:3: style: Variable or function name should be lowerCamelCase.

RHS <- as.list(mc)[[1]]
  ^~~

R/RcppExports.R:17:11: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/RcppExports.R:17:60: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
                                                           ^~~~~~~~~~~~~~

R/RcppExports.R:19:1: style: Trailing blank lines are superfluous.

^

tests/testthat/helper-allEqual.R:1:1: style: Variable or function name should be lowerCamelCase.

all.equalWONewCache <- function(a, b) {
^~~~~~~~~~~~~~~~~~~

tests/testthat/helper-allEqual.R:4:15: style: Commas should always have a space after.

​  all.equal(a,b)
              ^

tests/testthat/test-cache.R:197:4: style: Commented code should be removed.

#b1 <- writeRaster(b1, file = tmpFile, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:215:4: style: Commented code should be removed.

#r2 <- raster(extent(0, 10, 0, 10), vals = sample(1:30, size = 100, replace = TRUE))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:217:4: style: Commented code should be removed.

#tmpFile2 <- tempfile()
   ^~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:219:4: style: Commented code should be removed.

#r2 <- writeRaster(r2, filename = tmpFile2, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:231:1: style: Lines should not be more than 100 characters.

​  expect_true(grepl("loading cached result from previous quickFun call, adding to memoised copy", mess1 ))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:231:104: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call, adding to memoised copy", mess1 ))
                                                                                                       ^

tests/testthat/test-cache.R:245:1: style: Lines should not be more than 100 characters.

​  expect_true(grepl("loading cached result from previous quickFun call, adding to memoised copy", mess1 ))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:245:104: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call, adding to memoised copy", mess1 ))
                                                                                                       ^

tests/testthat/test-cache.R:502:37: style: Commas should always have a space after.

​  expect_true(all.equalWONewCache(A,B))
                                    ^

tests/testthat/test-cache.R:611:1: style: Lines should not be more than 100 characters.

​  expect_true(all(unlist(lapply(c("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:612:1: style: Lines should not be more than 100 characters.

"No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:617:1: style: Lines should not be more than 100 characters.

​  expect_true(all(grepl("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)", out)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:625:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:628:1: style: Lines should not be more than 100 characters.

# check that the rnorm inside "outer" returns cached value even if outer "outer" function is changed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:634:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:643:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:652:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:655:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:712:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(bb$artifact))==1)
                                        ~^~~

tests/testthat/test-cache.R:713:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(cc$artifact))==3)
                                        ~^~~

tests/testthat/test-cache.R:732:43: style: Put spaces around all infix operators.

​  expect_true(NROW(.reproEnv$cacheTimings)==4)
                                         ~^~~

tests/testthat/test-cache.R:733:43: style: Put spaces around all infix operators.

​  expect_true(NCOL(.reproEnv$cacheTimings)==4)
                                         ~^~~

tests/testthat/test-cache.R:745:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( (20*out1Details$objSize[1]) < out2Details$objSize[1])
              ^

tests/testthat/test-cache.R:745:19: style: Put spaces around all infix operators.

​  expect_true( (20*out1Details$objSize[1]) < out2Details$objSize[1])
                 ~^~

tests/testthat/test-cache.R:784:36: style: Commas should always have a space after.

​  expect_true(all.equal(postCache[,createdDate:=NULL], preCacheRbindlist[,createdDate:=NULL]))
                                   ^

tests/testthat/test-cache.R:784:47: style: Put spaces around all infix operators.

​  expect_true(all.equal(postCache[,createdDate:=NULL], preCacheRbindlist[,createdDate:=NULL]))
                                             ~^~~

tests/testthat/test-cache.R:784:75: style: Commas should always have a space after.

​  expect_true(all.equal(postCache[,createdDate:=NULL], preCacheRbindlist[,createdDate:=NULL]))
                                                                          ^

tests/testthat/test-cache.R:784:86: style: Put spaces around all infix operators.

​  expect_true(all.equal(postCache[,createdDate:=NULL], preCacheRbindlist[,createdDate:=NULL]))
                                                                                    ~^~~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

tests/testthat/test-examples.R:12:6: style: Commented code should be removed.

#expect_true(length(warn)>0)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-packages.R:106:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-packages.R:107:1: style: Trailing blank lines are superfluous.

^
@coveralls

This comment has been minimized.

coveralls commented Mar 29, 2018

Coverage Status

Coverage increased (+0.3%) to 78.151% when pulling 393866e on mergeCache into 3d6764c on development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment