Skip to content

Predict with the fit's dom/sec fuel classes, not the prediction area's - #17

Merged
eliotmcintire merged 4 commits into
developmentfrom
feat/domSecOther-fuels
Sep 28, 2026
Merged

eliotmcintire merged 4 commits into
developmentfrom
feat/domSecOther-fuels

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 on development and 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

eliotmcintire and others added 4 commits September 28, 2026 11:41
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
@eliotmcintire
eliotmcintire merged commit d1dfc6e into development Sep 28, 2026
6 checks passed
@eliotmcintire
eliotmcintire deleted the feat/domSecOther-fuels branch September 28, 2026 20:11
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.

1 participant