Skip to content

Spread covariates of a ~ 1 spread fit: no climate layer to select - #47

Merged
eliotmcintire merged 2 commits into
developmentfrom
nullclim-no-spread-climate
Nov 17, 2026
Merged

eliotmcintire merged 2 commits into
developmentfrom
nullclim-no-spread-climate

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Predictions for an ELF whose spread model has no covariates (a constant spread probability) stopped while building the year's covariates. They now build, without a climate column, so the null-arm hindcasts can run.

Affects: hindcasts and forecasts that use an intercept-only spread fit; any fit with a spread climate variable is unchanged.

Depends-on: PredictiveEcology/fireSenseUtils#241 (the same null hindcast fails first in fireSense_dataPrepFit, in climateRasterToDataTable()).

Technical details

Defect: fireSense_dataPrepPredict.R prepare_SpreadPredict() and covariatesBuilt() index currentClimateRasters[[climateVariablesForFire$spread]]; with character(0) (fireSenseUtils::addFitClimateVariablesForFire() of a ledger with no spread climate) terra errors (is.numeric(i) is not TRUE). The old is.null guard in prepare_SpreadPredict() was unreachable.

Fix: new climateLayers(sim, what) returns the layers, NULL for character(0) (no variable), and stops for a NULL/absent entry (a malformed sim). prepare_SpreadPredict() skips the climate join on NULL; covariatesBuilt() and prepare_IgnitionAndEscapePredict() use it too (ignition keeps its stop: it always needs climate).

Reuses: useOwnELFRows(), inputDigest(), the existing toy helpers (toyPrepRun()); new: climateLayers() (the same [[vars]] selection was written in three places and none handled no variable).

Tests: new test in test-covariates.R (spread covariates with spread = character(0): pixelID, youngAge, no MDC; ignition keeps MDC). Added tests: NULL spread variable stops; character(0) ignition variable stops. Base: 488 run, 1 error (the new test). Branch: 495, 0 failures, 0 errors, 0 skipped (convertToPackage(buildDocuments = TRUE) + test_local, scratch library lib9175).

Checked beyond this PR: fireSense_spreadPredict spreadProbOneELF() with zero covariates gives a constant surface (toy run, 0.2128 for intercept 0.4, NaN only outside flammable cells); fireSense_burn, fireSense_spreadPredict and fireSense_summary never read climateVariablesForFire. No reqdPkgs floor yet: set it after the fireSenseUtils merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

@eliotmcintire eliotmcintire added the bug Something isn't working label Nov 16, 2026
…gnition uses it too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire
eliotmcintire merged commit e16c69f into development Nov 17, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the nullclim-no-spread-climate branch November 17, 2026 00:26
eliotmcintire added a commit that referenced this pull request Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant