Repository navigation
Keep the whole spread-fit ledger out of the data-prep cache key - #76
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eliotmcintire
added a commit
that referenced
this pull request
Oct 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019T7wFP7tXPDaRn42BFLzjr
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.
Hindcasts and refits redid an hour or two of data preparation per region whenever a new fit was saved anywhere. This stops that, while the later steps that do use the fit still re-run when this region's fit changes.
Affects: No change to results. Data preparation is reused across fits and hindcasts; each region rebuilds once more because the cache key changes once.
Technical details
Defect:
fireSense_dataPrepFit.R:244declaredexpectsInput("spreadFitPreRun"). SpaDES.core puts every expected input already in the sim into the.inputObjectscache key (simInit,suppliedElsewhere), andfireSense_ELFsputs the whole ledger (rows of all ELFs) there first, so any ELF's new fit missed the cache..inputObjectsand the functions it calls never readspreadFitPreRun(grep: onlyInit()uses it).Fix: the expectsInput is gone (createsOutput kept, its description now explains why). The protection it gave stays through
.useCacheArgs:dataPrepBuild,prepIgnitionFitData,prepEscapeFitDataandprepSpreadFitDataeach addspreadFitPreRun = sim$spreadFitPreRunto.cacheExtra. SpaDES.core evaluates quoted entries in.runEvent()(R/simulation-spades.R~1595,eval(envir = environment())), wheresimis the live simList; the chaining path (R/cacheChainingJump.R~240) also evaluates withsim.Init()(line ~411) always assignssim$spreadFitPreRun(theCacheGeorows within this study area, orNULLfor a held-out fold), and it runs ininit, which schedules all later events, so the key is this ELF's rows only, never the whole ledger.Tests: new
test-ledgerNotInInputObjectsKey.R(not an input;.inputObjectsdoes not read it;Init()assigns it unconditionally; each event's.cacheExtradigests the same for the same rows and differently for a new own row orNULL; a ledger differing only in another ELF's rows gives the samereadSpreadFitLedger()result for this study area).test-metadata.Rupdated. Branch: 108 tests, 0 failures, 1 skipped (fixture); base with the new file: 2 of the new tests fail.checkDocFiles/codocclean;R CMD check(no manual, no tests) has no errors and one WARNING about an import replaced during package conversion, unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_019T7wFP7tXPDaRn42BFLzjr