Skip to content
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

spades not caching properly. #251

Open
CeresBarros opened this issue Aug 17, 2023 · 1 comment
Open

spades not caching properly. #251

CeresBarros opened this issue Aug 17, 2023 · 1 comment

Comments

@CeresBarros
Copy link
Member

The second spades call below should not be retrieving the first cached call, according to the documentation

Require::Require("PredictiveEcology/SpaDES.core@fdeada6f692513bbffe22c665a7da5215b6eef4e")  ## development as of August 17th

options(spades.moduleCodeChecks = FALSE, 
        spades.debug = FALSE,
        reproducible.ask = FALSE)

tmpdir <- file.path(tempdir())
setPaths(cachePath = file.path(tmpdir, "cache"),
         modulePath = system.file("sampleModules", package = "SpaDES.core"),
         outputPath = file.path(tmpdir, "outputs"))
pths <- getPaths()

mySim <- simInit(
  times = list(start = 0.0, end = 1.0, timeunit = "year"),
  params = list(
    .globals = list(stackName = "landscape", burnStats = "nPixelsBurned"),
    # Turn off interactive plotting
    fireSpread = list(.plotInitialTime = NA),
    caribouMovement = list(.plotInitialTime = NA),
    randomLandscapes = list(.plotInitialTime = NA)
  ),
  modules = list("randomLandscapes", "fireSpread", "caribouMovement"),
  paths = pths,
  # Save final state of landscape and caribou
  outputs = data.frame(objectName = c("landscape", "caribou"),
                       stringsAsFactors = FALSE)
)

spades(Copy(mySim), replicate = 1, cache = TRUE, debug = FALSE,
       omitArgs = c("progress", "debug", ".plotInitialTime", ".saveInitialTime"))
spades(Copy(mySim), replicate = 2, cache = TRUE, debug = FALSE,
       omitArgs = c("progress", "debug", ".plotInitialTime", ".saveInitialTime"))

@CeresBarros
Copy link
Member Author

This is causing cache issues in experiment and experiment2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant