Skip to content

spreadCovariates: add "fuel" and "climate" - #116

Merged
eliotmcintire merged 2 commits into
developmentfrom
spreadCovariates-fuel-climate
Nov 21, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
spreadCovariates-fuel-climate

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

spreadCovariates can now fit spread with fuel only or climate only, beside all covariates and none. That lets us split how much of spread-fit quality comes from fuel and how much from climate.

Affects: nothing by default ("all" is unchanged); a run that sets spreadCovariates = "fuel" or "climate" fits and hindcasts a spread formula with only that group.

Technical details

Gap: spreadRHS() (R/spreadFormula.R) knew only "all" and "none"; checkSpreadCovariates() rejected anything else.

Fix: spreadRHS() leaves out the youngAge/fuel/non-forest terms for "climate" and the climate term(s) for "fuel". youngAge and non-forest classes go with fuel (vegetation state); say if you want them elsewhere. Formulas on a toy fit with CMD: all ~ 1 + CMD + youngAge + fuelA, none ~ 1, climate ~ 1 + CMD, fuel ~ 1 + youngAge + fuelA. Covariate tables are still made, as with "none".

Interactions and other options:

  • spreadInteractions = "climate:fuel" stops with "fuel" and "climate" (checkSpreadInteractions()), naming what is missing.
  • Hindcast: the hindcast runs this module with the same spreadCovariates (as for "none"), and spreadPredict uses the fitted ledger terms, so spreadPredict, dataPrepPredict and fireSenseUtils need no change.
  • Ceiling/activation: "climate" keeps a climate column, so climateOutside and activation work. "fuel" has none, and fireSense_spreadFit already stops there with a clear message (spreadClimateCols() check before spreadClimateRef()); dataPrepFit does not read spreadFit parameters, so nothing is added here.
  • Whole-landscape: only the tables change, not the formula; no interaction.
  • spreadClimateSplit (New parameter spreadClimateSplit: the spread climate as a between-year and a within-year term #108, open): not depended on; its split applies to the climate terms, which "climate" keeps and "fuel" drops.

Reuses: spreadRHS()/checkSpreadCovariates()/checkSpreadInteractions() extended in place, spreadFormula(), fireSenseUtils::youngAgeTxt, the existing "none" path and the new-value list spreadCovariatesValues (one place, also used in the error text); new: none (no new function).

Tests (testthat-module, 1 thread): branch 564 passed, 0 failed, 1 skipped (the equivalence test needs DPF_EQUIVALENCE_FIXTURE); base with the new tests copied in: 10 failed, 1 error (the new tests), 551 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Nov 21, 2026
@eliotmcintire
eliotmcintire merged commit 1d7ed32 into development Nov 21, 2026
7 checks passed
@eliotmcintire
eliotmcintire deleted the spreadCovariates-fuel-climate branch November 21, 2026 05:48
eliotmcintire added a commit that referenced this pull request Nov 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire added a commit that referenced this pull request Nov 21, 2026
…limateSplit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant