Repository navigation
replaceAgeInFires(): use a startTime after 2023 - #3
Merged
Merged
Conversation
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>
This was referenced Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
replaceAgeInFires()treated anystartTimeafter 2023 as missing, and dated each fire from the latest fire year infirePerimetersinstead.prepInputsStandAgeMap()passesstartTime = dataYear, so with adataYearafter 2023 every burned pixel came out too young by the years between the area's latest fire anddataYear. The exception is an area that burned indataYearitself, where the two are the same. The same code is in LandR up to #302.The upper limit is removed. A
startTimeearlier 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.Randman/replaceAgeInFires.Rd: say when the fallback applies.tests/testthat/test-standAge.R(new, paired withR/standAge.R):startTime = 2025gives ages 15 and 5 for fires in 2010 and 2020. Before the fix it gave 10 and 0.startTime = 0still uses the latest fire year.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-crangives 0 errors, 0 warnings and the same 2 NOTEs as on development: CRAN's new-submission note, and theprepInputsFireYear()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