Repository navigation
skipUnusedFitPrep: predict-only jobs skip the spread and escape fit data - #103
Merged
Merged
Conversation
…a and prepEscapeFitData Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…heKey = FALSE; rule from fireSenseUtils::fitDataNeeded() Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…ireSenseUtils#234) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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.
Every year of a hindcast prepares the data for fitting the fire models, although nothing is fitted. This adds a switch that skips the slowest of those steps (the covariates only a fit reads) in jobs that only predict, about 2.5 minutes per year-job. The switch is off by default.
Affects: Nothing changes unless
skipUnusedFitPrep = TRUEis set. With it set, predict-only jobs skip the spread covariates; the fire data,ignitionFirePointsand the escape covariates are made as in a full run.Technical details
Defect:
fireSense_dataPrepFit.R(init,prepEventsToSchedule(P(sim)$whichModulesToPrepare)) schedulesprepSpreadFitDataandprepEscapeFitDatain every job, also whendoFitis FALSE and nothing reads their outputs.Fix: new parameter
skipUnusedFitPrep(default FALSE,cacheKey = FALSE). The fire half ofprepare_SpreadFit()is nowprepare_SpreadFitFires()(setsmod$allYears, calls the raster or vector builder), whichprepare_SpreadFit()calls and which has its own eventprepSpreadFitFireData(outputs declared for it).fitPrepNeeded(sim)is FALSE only with the parameter TRUE andfireSenseUtils::fitDataNeeded(doFit, heldOutFold, spreadFit mode)FALSE. Then onlyprepSpreadFitFireDataruns, notprepSpreadFitData;prepIgnitionFitDataandprepEscapeFitDatarun as before. SospreadFirePolys,escapeFireSet,ignitionFirePointsandfireSense_escapeCovariatescome from the same code as a full run. The covariate half (vegetation tables, annual climate, formula,fuelClassRoles) is skipped. Init stops if this module andfireSense_spreadFitdiffer onskipUnusedFitPrepordoFit(paramCheckOtherMods()).Evidence nothing downstream needs the skipped outputs:
climateVariablesForFire(the skipped step only unions the own fit's variables into a setInit()already holds; from the code, not run on data); the spread formula, covariate tables andfuelClassRolesare read only by fireSense_spreadFit's fit/validate/profile events, and fireSense_dataPrepPredict takes fuel roles from the ledger row. No change needed in fireSense_ignitionFit (escape covariates exist). Not timed: the escape step alone needs the real data.Reuses:
prepare_SpreadFitFire_Raster/_Vector,prepEventsToSchedule()(extended),fireSenseUtils::fitDataNeeded()(new, PredictiveEcology/fireSenseUtils#234),SpaDES.core::paramCheckOtherMods(); new:prepare_SpreadFitFires()(a split of existing code, not a copy),fitPrepNeeded()(supplies the job's parameters to the shared rule), eventprepSpreadFitFireData.Depends-on: PredictiveEcology/fireSenseUtils#234
Tests: new
test-skipUnusedFitPrep.R(what is scheduled, default and skip, for doFit FALSE/NA/TRUE, held-out fold, validate, profile);test-metadata.Rparameter list updated; tests cover the fire-data event, the shared function and the agreement check (no real-data comparison ofignitionFirePoints). The module's Init() needs LandR and Drive, so the tests check the scheduling decision, not a full predict-onlyspades(). Full suite (convertToPackage()+test_local(), scratch library~/GitHub/worktrees/scratch-lib-predictonlywith fireSenseUtils built from the local PR branch as 0.2.3.9167): base 130 blocks / 478 expectations, 0 failed, 1 skipped (DPF_EQUIVALENCE_FIXTUREnot set; also skipped on base); branch 137 / 497, 0 failed, the same 1 skip.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6