Skip to content

Commit

Permalink
don't delete CA_forest_VLCE2 raster
Browse files Browse the repository at this point in the history
fix #110
  • Loading branch information
achubaty committed Dec 23, 2024
1 parent 5062d90 commit 503f425
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Description: Utilities for 'LandR' suite of landscape simulation models.
URL:
https://landr.predictiveecology.org,
https://github.com/PredictiveEcology/LandR
Date: 2024-11-13
Version: 1.1.5.9026
Date: 2024-12-22
Version: 1.1.5.9027
Authors@R: c(
person("Eliot J B", "McIntire", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6914-8316")),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- `columnsForPixelGroups` is now a function (i.e., use `columnsForPixelGroups()` for consistent `pixelGroup` definitions);
- new function `cohortDefinitionCols()` to ensure consistent cohort definitions;
- new function `lccMapGenerator()` to calculate landcover classes from `cohortData` and `pixelGroupMap`;
- don't delete `CA_forest_VLCE2` raster in `prepInputs_NTEMS_LCC_FAO()` (#110);

# LandR 1.1.5

Expand Down
9 changes: 5 additions & 4 deletions R/prepInputs_NTEMS.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ prepInputs_NTEMS_LCC_FAO <- function(year = 2010, disturbedCode = 1, resampleMet
lccURL <- paste0("https://opendata.nfis.org/downloads/forest_change/CA_forest_VLCE2_", year, ".zip")
lccTF <- paste0("CA_forest_VLCE2_", year, ".tif")
lcc <- prepInputs(url = lccURL, targetFile = lccTF, method = resampleMethod, ...)
## unlink this file as it is 24 GB
toUnlink <- ifelse(is.null(dots$destinationPath), lccTF,
file.path(dots$destinationPath, lccTF))
unlink(toUnlink)
## 2024-12: see #110; don't delete CA_forest_VLCE2 raster even though it's 24GB
## deleteing it results in redownload every time and breaks parallel sims (race condition)
# toUnlink <- ifelse(is.null(dots$destinationPath), lccTF,
# file.path(dots$destinationPath, lccTF))
# unlink(toUnlink)

## 1 is forest, 2 is disturbed forest
## do not pass dots, or the filename is passed and is overwritten
Expand Down
9 changes: 8 additions & 1 deletion man/prepInputs_NTEMS_LCC_FAO.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 503f425

Please sign in to comment.