reproducible icon indicating copy to clipboard operation
reproducible copied to clipboard

`postProcess` operations not being cached when nested in `prepInputs` call?

Open CeresBarros opened this issue 4 months ago • 4 comments

I've noticed that my crop/mask/projection operations do not seem to be cached when running a prepInputs call:

reprex:

Require::Require("PredictiveEcology/reproducible")

options(reproducible.destinationPath = "~/reproducible_test/data",
        reproducible.cachePath = "~/reproducible_test/cache")

shpUrl <- "http://sis.agr.gc.ca/cansis/nsdb/ecostrat/zone/ecozone_shp.zip"

studyArea <- SpaDES.tools::randomStudyArea(size = 20000)

ecozoneFilename <- file.path(options("reproducible.cachePath"), "ecozones.shp")
ecozoneFiles <- c(
  "ecozones.dbf", "ecozones.prj",
  "ecozones.sbn", "ecozones.sbx", "ecozones.shp", "ecozones.shx"
)

shpEcozone <- prepInputs(
  url = shpUrl,
  targetFile = reproducible::asPath(ecozoneFilename),
  alsoExtract = reproducible::asPath(ecozoneFiles),
  to = studyArea
)

shpEcozone <- prepInputs(
  url = shpUrl,
  targetFile = reproducible::asPath(ecozoneFilename),
  alsoExtract = reproducible::asPath(ecozoneFiles),
  to = studyArea
)

CeresBarros avatar Feb 28 '24 20:02 CeresBarros