Skip to content

Commit

Permalink
update cache path in CaDrA search
Browse files Browse the repository at this point in the history
  • Loading branch information
RC-88 committed Oct 31, 2023
2 parents e3ac52f + 082906d commit a026f5e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions R/cadra.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,17 @@ CaDrA <- function(
max_size = max_size)

####### CACHE CHECKING #######
if(cache == TRUE){

# Set cache root path
if(is.null(cache_path)){
cache_path <- file.path(Sys.getenv("HOME"), ".Rcache")
dir.create(cache_path, showWarnings = FALSE)
}

if(is.null(cache_path)){
cache_path <- file.path(Sys.getenv("HOME"), ".Rcache")
dir.create(cache_path, showWarnings = FALSE)
}
R.cache::setCacheRootPath(cache_path)

if(cache == TRUE){

R.cache::setCacheRootPath(cache_path)
message("Setting cache root path as: ", cache_path, "\n")

# Load perm_best_scores with the given key parameters
Expand Down Expand Up @@ -297,7 +300,7 @@ CaDrA <- function(
# Save computed scores to cache
verbose("Saving to cache...\n")
R.cache::saveCache(perm_best_scores, key=key)

} # end caching else statement block

# Return to using just a single core
Expand Down

0 comments on commit a026f5e

Please sign in to comment.