From 4eea471122ee26b54f8290bb62a16e1c8a334cb3 Mon Sep 17 00:00:00 2001 From: Eliot McIntire Date: Fri, 9 Oct 2026 10:18:49 -0700 Subject: [PATCH] projectedClimateYears defaults to 2017:2100 The tile 39 projected archive (CNRM-ESM2-1 ssp370, 2010 decade) lacks 2013-2016, and observed climate now covers 1901-2024, so projections before 2017 are not needed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv --- NEWS.md | 4 ++++ canClimateData.R | 7 +++++-- tests/testthat/test-metadata.R | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index ab016e3..626db9f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/canClimateData.R b/canClimateData.R index d84d294..a0846d9 100644 --- a/canClimateData.R +++ b/canClimateData.R @@ -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.")), diff --git a/tests/testthat/test-metadata.R b/tests/testthat/test-metadata.R index ce9aa30..42dfe74 100644 --- a/tests/testthat/test-metadata.R +++ b/tests/testthat/test-metadata.R @@ -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) +})