Predict with the fit's dom/sec fuel classes, not the prediction area's - #17
Merged
Merged
Conversation
prepare_SpreadPredict() (fireSense_dataPrepPredict.R ~459) called fireSenseUtils::fireSenseCovariatesCreate() without rstLCC, so treedWetland never appeared, and there was no way to predict with the new dom/sec/other AGB fuel representation from fireSenseUtils#98. New inputs fuelClassRoles (one ELF) / fuelClassRolesList (several ELFs), from fireSense_dataPrepFit::sim$fuelClassRoles: when an ELF's domClass is set, ELFfuelSets() passes it and rstLCC through so that ELF's dom_agb_<class>/ sec_agb_<class>/other_agb/treedWetland_agb columns use the SAME classes the fit chose, never re-derived from the prediction area. Unsupplied (every previously-fitted ELF), prediction is unchanged. The module's own sanity check (forest fuel must not land on non-forest pixels) is fixed to exclude treedWetland/treedWetland_agb, which are not on the fuel columns' logMinB() floor scale. Version 1.0.4.9004. Floors fireSenseUtils@development (>= 0.2.3.9050). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…ter development moved) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
… input Maintainer decision: read domClass/secClass from the fitted parameters' column names in sim$studyAreaWithSpreadParams (the SpreadFit ledger rows fireSense_ELFs already supplies), not from a new fuelClassRoles/ fuelClassRolesList input. Removes those two expectsInput and their .inputObjects default; declares studyAreaWithSpreadParams (already read, undeclared, by fireSense_SpreadPredict). New fuelClassRolesFromTermNames() strips the "dom_agb_"/"sec_agb_" prefix off a fitted term name to recover the fuel-class name unchanged (fireSenseUtils never mangles it further); fuelClassRolesForELF() reads ELF i's row of sim$studyAreaWithSpreadParams the same way fireSense_SpreadPredict's spreadPredictRun() indexes sa$params[[i]]. A fit with no dom_agb_*/sec_agb_* term (old, per-species fits) or no fitted parameters yet predicts with the previous per-fuel-class columns, unchanged. Floor raised to fireSenseUtils@development (>= 0.2.3.9057), matching the renumbered fireSenseUtils#98 and dataPrepFit#48. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…reSenseUtils >= 0.2.3.9048) Pixel 15 of the toy map is both wetland and young; since fireSenseUtils #92 the youngAge exclusivity zeroes its wetland value, so the expected wetland pixels are 9 and 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
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.
prepare_SpreadPredict() (fireSense_dataPrepPredict.R ~459) called fireSenseUtils::fireSenseCovariatesCreate() without rstLCC, so treedWetland never appeared, and there was no way to predict with the dom/sec/other AGB fuel representation added in PredictiveEcology/fireSenseUtils#98. The module now reads sim$studyAreaWithSpreadParams (the fitted SpreadFit ledger rows fireSense_ELFs supplies; fireSense_SpreadPredict already reads the same object, undeclared). For each ELF, new fuelClassRolesForELF()/fuelClassRolesFromTermNames() look at that ELF's fitted parameter names: if they include dom_agb_/sec_agb_, ELFfuelSets() passes those classes and rstLCC through so that ELF's dom_agb_/sec_agb_/other_agb/treedWetland_agb columns match what it was fitted with, never re-derived from the prediction area's own species mix. An older per-species fit, or an ELF with no fitted parameters yet, predicts unchanged. The module's own sanity check (no forest fuel on non-forest pixels) is corrected to exclude treedWetland/treedWetland_agb, which are not on the same logMinB() floor scale as the fuel columns.
Verified with SpaDES.core::convertToPackage() + testthat::test_local(), against the real fireSenseUtils 0.2.3.9057 build: 179 tests pass on
development(2 pre-existing failures, both a "wetland" pixel-count regression unrelated to this change, present before and after), 203 pass on this branch (same 2 failures, 0 new); the 24 new/changed expectations fail ondevelopmentand pass here. Version 1.0.4.9004, floors fireSenseUtils@development (>= 0.2.3.9057).Merge after PredictiveEcology/fireSenseUtils#98. The pre-existing wetland-count failures (test-covariates.R:24 and :100) are unrelated to this change and are not fixed here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv