Repository navigation
Stand age and disturbance-year functions move to forestInputs (re-exported, identical results) - #302
Merged
Merged
Conversation
…re-exports them prepInputsDisturbanceYear(), disturbancesByYear(), lastDisturbanceYear(), prepInputsFireYear(), prepInputsStandAgeMap() and replaceAgeInFires() now live in forestInputs (terra, data.table and reproducible only), so tools that do not use LandR (e.g. hsaCEtool) share them. LandR imports and re-exports them under the same names; their tests moved with them. Identical results: 8 maps on the ELF 4.3 grid (disturbance years for "all", the earlier rule and NFDB only; NFDB fire year; SCANFI stand age with NFDB and "all" resets, 1985 and 2020) match cell for cell, with the same imputedPixID. LandR tests: same results for every remaining test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
Contributor
|
I reviewed forestInputs for LandWeb, which calls
🤖 Generated with Claude Code |
LandR kept its own copy of scanfiUrlRemap() and the manifest, read only LandR.scanfiMirror, so options(forestInputs.scanfiMirror = FALSE) switched the mirror off for stand age but not for LandR's other SCANFI readers. LandR now re-exports forestInputs::scanfiUrlRemap(), drops its manifest, and switches with the same rule as forestInputs. Requires forestInputs >= 0.0.1.9001 (replaceAgeInFires() startTime after 2023). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
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.
The stand age and fire-year tools now live in a small new package, forestInputs, so other projects can use them without installing all of LandR. LandR keeps the same function names, and results are identical.
Affects: the same functions and names. Stand ages for a year after 2023 change: burned stands were too young, a bug fixed in forestInputs. LandR gains forestInputs as a dependency.
Technical details
prepInputsDisturbanceYear(),disturbancesByYear(),lastDisturbanceYear(),prepInputsFireYear(),prepInputsStandAgeMap()andreplaceAgeInFires()move to forestInputs (imports terra, data.table and reproducible only; LandR imports about 105 packages).R/forestInputs.Rre-exports them;R/disturbanceYear.Rand the moved parts ofR/prepInputObjects.Rare deleted, with their tests (test-disturbanceYear.R,test-prepInputsFireYear*.R,test-prepInputsStandAgeMap.R, two blocks oftest-scanfiMirror.R), which now run in forestInputs.scanfiUrlRemap()and its manifest move too (LandR re-exports it); LandR's SCANFI readers switch the mirror with the same rule as forestInputs (forestInputs.scanfiMirror, elseLandR.scanfiMirror), so one option covers both packages (from Alex's review).prepInputsFireYear()in forestInputs rasterizes with terra only (it used sf and fasterize).Verified, current development (c537fb3) against this branch, separate R sessions, caching off: 8 maps on the ELF 4.3 grid (8.4 million cells) are identical cell for cell, with identical
imputedPixID: disturbance years for"all"(1985, 2020), the earlier rule and NFDB only (2020); the NFDB fire year (2020); SCANFI stand age 2020 with NFDB and with"all"resets, and 1985 with NFDB. LandR tests: 234 remaining tests give the same results as before (0 failures); the 19 others are the moved tests.Needs forestInputs >= 0.0.1.9001, which fixes
replaceAgeInFires()for astartTimeafter 2023 (PredictiveEcology/forestInputs#3). The identity check above predates that fix and the mirror change; neither touches its maps (all at 2020 or 1985). LandR tests after the mirror change: 1499 pass, 0 fail.Version 1.2.0.9070.
Depends-on: PredictiveEcology/forestInputs@development
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3