Skip to content

replaceAgeInFires(): use a startTime after 2023 - #3

Merged
eliotmcintire merged 2 commits into
developmentfrom
fix/replaceAgeInFires-startTime
Dec 3, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
fix/replaceAgeInFires-startTime

Conversation

@achubaty

@achubaty achubaty commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

replaceAgeInFires() treated any startTime after 2023 as missing, and dated each fire from the latest fire year in firePerimeters instead. prepInputsStandAgeMap() passes startTime = dataYear, so with a dataYear after 2023 every burned pixel came out too young by the years between the area's latest fire and dataYear. The exception is an area that burned in dataYear itself, where the two are the same. The same code is in LandR up to #302.

The upper limit is removed. A startTime earlier than 1950 still falls back to the latest fire year, because callers pass a simulation time such as 0 there. An upper limit tied to the current year would make results depend on the year the code is run.

  • R/standAge.R: the range check, its message, and a comment saying why 1950 stays.
  • man-roxygen/startTime.R and man/replaceAgeInFires.Rd: say when the fallback applies.
  • tests/testthat/test-standAge.R (new, paired with R/standAge.R):
    • startTime = 2025 gives ages 15 and 5 for fires in 2010 and 2020. Before the fix it gave 10 and 0.
    • startTime = 0 still uses the latest fire year.
  • NEWS item; version 0.0.1.9001.

Tests: the new test fails on 1109f11 with ages 10 and 0 instead of 15 and 5, and passes with the change. The full suite gives 45 tests: 0 failed and 1 skipped (the interactive-only test). R CMD check --as-cran gives 0 errors, 0 warnings and the same 2 NOTEs as on development: CRAN's new-submission note, and the prepInputsFireYear() example taking about 70 s to download NFDB.

For LandWeb, which passes dataYear = 2025, results are unchanged: all 18 of its study areas had a fire in 2025.

🤖 Generated with Claude Code

achubaty and others added 2 commits December 2, 2026 20:15
It treated any year after 2023 as missing and dated fires from the latest fire year,
so stand ages from prepInputsStandAgeMap(dataYear >= 2024) were too young after a burn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire
eliotmcintire merged commit fdbe774 into development Dec 3, 2026
10 checks passed
@eliotmcintire
eliotmcintire deleted the fix/replaceAgeInFires-startTime branch December 3, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants