diff --git a/DESCRIPTION b/DESCRIPTION index b53ab99..479be17 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: cffdrs Title: Canadian Forest Fire Danger Rating System -Version: 1.9.0 +Version: 1.9.2 Date: 2024-01-19 Authors@R: c( person("Xianli", "Wang", email = "Xianli.Wang@nrcan-rncan.gc.ca", role = "aut"), @@ -27,12 +27,12 @@ URL: https://github.com/cffdrs/cffdrs_r BugReports: https://github.com/cffdrs/cffdrs_r/issues/new/choose Depends: + R (>= 3.5) +Imports: + sf, + terra, data.table, foreach, - R (>= 3.5), - sf, - terra -Imports: doParallel, geosphere, methods, @@ -42,4 +42,4 @@ Suggests: Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index 2349144..ad685d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# cffdrs 1.9.2 + # version 1.9.0 --- diff --git a/R/cffdrs-package.R b/R/cffdrs-package.R index cc72690..f71a793 100644 --- a/R/cffdrs-package.R +++ b/R/cffdrs-package.R @@ -33,7 +33,7 @@ #' major vegetation types in Canada. #' #' \tabular{ll}{ Package: \tab cffdrs\cr Type: \tab Package\cr Version: \tab -#' 1.8.16\cr Date: \tab 2020-05-26\cr License: \tab GPL-2\cr } This package +#' 1.9.2\cr Date: \tab 2025-07-09\cr License: \tab GPL-2\cr } This package #' includes eleven functions. Seven functions, \code{\link{fwi}}, #' \code{\link{fwiRaster}}, \code{\link{hffmc}}, \code{\link{hffmcRaster}}, #' \code{\link{sdmc}}, \code{\link{gfmc}}, and @@ -58,11 +58,10 @@ #' #' @name cffdrs-package #' @aliases cffdrs-package cffdrs -#' @docType package #' @author Xianli Wang, Alan Cantin, Marc-André Parisien, Mike Wotton, Kerry #' Anderson, Brett Moore, Tom Schiks, and Mike Flannigan #' -#' Maintainer: Alan Cantin \email{Alan.Cantin@nrcan-rncan.gc.ca} +#' Maintainer: Brett Moore \email{Brett.Moore@nrcan-rncan.gc.ca} #' @seealso \code{\link{fbp}}, \code{\link{fire_season}}, \code{\link{fwi}}, #' \code{\link{fwiRaster}}, \code{\link{gfmc}}, \code{\link{hffmc}}, #' \code{\link{hffmcRaster}}, \code{\link{lros}}, \code{\link{pros}}, @@ -198,6 +197,7 @@ #' # end date, and using overwintered DC #' fwi_withFSwDC #' +"_PACKAGE" NULL diff --git a/R/fbpRaster.r b/R/fbpRaster.r index 7fa4ab1..3c68035 100644 --- a/R/fbpRaster.r +++ b/R/fbpRaster.r @@ -270,6 +270,7 @@ #' # The dataset is the standard test data for FBP system #' # provided by Wotton et al (2009), and randomly assigned #' # to a stack of raster layers +#' require(terra) #' test_fbpRaster <- rast( #' system.file("extdata", "test_fbpRaster.tif", package = "cffdrs") #' ) diff --git a/R/gfmcRaster.R b/R/gfmcRaster.R index c520954..9c67325 100644 --- a/R/gfmcRaster.R +++ b/R/gfmcRaster.R @@ -32,6 +32,7 @@ #' @export gfmcRaster #' #' @examples +#' require(terra) #' set.seed(5123) #' test_gfmc_r <- rast( #' nrows = 25, diff --git a/man/cffdrs-package.Rd b/man/cffdrs-package.Rd index 9699863..dba23ca 100644 --- a/man/cffdrs-package.Rd +++ b/man/cffdrs-package.Rd @@ -40,7 +40,7 @@ outputs. Sixteen fuel types are included in the FBP System, covering mainly major vegetation types in Canada. \tabular{ll}{ Package: \tab cffdrs\cr Type: \tab Package\cr Version: \tab -1.8.16\cr Date: \tab 2020-05-26\cr License: \tab GPL-2\cr } This package +1.9.1\cr Date: \tab 2025-07-09\cr License: \tab GPL-2\cr } This package includes eleven functions. Seven functions, \code{\link{fwi}}, \code{\link{fwiRaster}}, \code{\link{hffmc}}, \code{\link{hffmcRaster}}, \code{\link{sdmc}}, \code{\link{gfmc}}, and @@ -206,6 +206,6 @@ Inf. Rep. NOR-X-417. Xianli Wang, Alan Cantin, Marc-André Parisien, Mike Wotton, Kerry Anderson, Brett Moore, Tom Schiks, and Mike Flannigan -Maintainer: Alan Cantin \email{Alan.Cantin@nrcan-rncan.gc.ca} +Maintainer: Brett Moore \email{Brett.Moore@nrcan-rncan.gc.ca} } \keyword{package} diff --git a/man/fbpRaster.Rd b/man/fbpRaster.Rd index f3095e8..d42ec32 100644 --- a/man/fbpRaster.Rd +++ b/man/fbpRaster.Rd @@ -248,6 +248,7 @@ will still work. # The dataset is the standard test data for FBP system # provided by Wotton et al (2009), and randomly assigned # to a stack of raster layers +require(terra) test_fbpRaster <- rast( system.file("extdata", "test_fbpRaster.tif", package = "cffdrs") ) diff --git a/man/gfmcRaster.Rd b/man/gfmcRaster.Rd index 135bffd..b8da666 100644 --- a/man/gfmcRaster.Rd +++ b/man/gfmcRaster.Rd @@ -34,6 +34,7 @@ also an equivalent Grass Fuel Moisture Code. All equations come from Wotton (2009) as cited below unless otherwise specified. } \examples{ +require(terra) set.seed(5123) test_gfmc_r <- rast( nrows = 25, diff --git a/tests/testthat/test_fbp.r b/tests/testthat/test_fbp.r index 41f6f33..f87016a 100644 --- a/tests/testthat/test_fbp.r +++ b/tests/testthat/test_fbp.r @@ -40,8 +40,10 @@ test_that("fbp_10", { return(actual) }) }) +## Returns NA and warns ad nauseum test_that("fbp_11", { - fct_test_fbp("fbp_11", + expect_warning( + fct_test_fbp("fbp_11", function(test_fbp) { non_fuel <- copy(test_fbp) non_fuel$FuelType <- "NF" @@ -49,10 +51,12 @@ test_that("fbp_11", { # HACK: for now change type here actual$FD <- as.logical(actual$FD) return(actual) - }) + }),"NaNs produced") }) +## Returns NA and warns ad nauseum test_that("fbp_12", { - fct_test_fbp("fbp_12", + expect_warning( + fct_test_fbp("fbp_12", function(test_fbp) { water <- copy(test_fbp) water$FuelType <- "WA" @@ -60,5 +64,5 @@ test_that("fbp_12", { # HACK: for now change type here actual$FD <- as.logical(actual$FD) return(actual) - }) + }),"NaNs produced") })