Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# canClimateData (development version)

- `projectedClimateYears` now defaults to 2017:2100 instead of 2011:2100. The projected archive for tile 39 (CNRM-ESM2-1 ssp370) has no 2013-2016 files, and observed climate now covers 1901-2024, so projections before 2017 are not needed.

# canClimateData 1.1.0

canClimateData now uses the current climateData package to prepare its climate layers. It can run hindcasts as well as forecasts, it returns historical and projected climate as named lists, and a shared output folder can be set for climate files. The manual was updated, with links for exploring and comparing climate scenarios.
Expand Down
7 changes: 5 additions & 2 deletions canClimateData.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ defineModule(sim, list(
defineParameter("projectedClimatePeriod", "character", NULL, NA, NA,
paste("period to use for projected climate normals",
"if `climateVariables` not supplied.")),
defineParameter("projectedClimateYears", "numeric", 2011:2100, NA, NA,
defineParameter("projectedClimateYears", "numeric", 2017:2100, NA, NA,
paste("range of years captured by the projected climate data",
"if `climateVariables` not supplied.")),
"if `climateVariables` not supplied.",
"Starts in 2017 because the projected archive for tile 39",
"(CNRM-ESM2-1 ssp370) lacks 2013-2016, and observed climate",
"now covers 1901-2024, so earlier projections are not needed.")),
defineParameter("projectedType", "character", "forecast", NA, NA,
paste("one of 'forecast' or 'hindcast' to prepare either projected future,",
"or sampled historical data for hindcast studies, respectively.")),
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ test_that("parameters are the expected names", {
"projectedClimateYears", "projectedType", "quickCheck"))
)
})

test_that("projected climate years start in 2017", {
md <- SpaDES.core::moduleMetadata(module = moduleName, path = modulePath)
pars <- stats::setNames(md$parameters$default, md$parameters$paramName)
expect_identical(pars[["projectedClimateYears"]], 2017:2100)
})