Repository navigation
replaySave and replayFrom: save and replay the spread-prediction inputs of a hindcast - #45
Merged
Merged
Conversation
…same-year step Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…dcast job and load them in a replay job Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
… when it changes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…her modules' objects; sf and tables via qs2 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Co-Authored-By: Claude Sonnet 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.
A reference hindcast can now keep the land and climate tables it built, and a later job can load them instead of building them. This lets the same year be re-run with other fitted parameters without redoing the vegetation and climate work.
Affects: nothing unless the new settings
replaySaveorreplayFromare used; hindcast jobs that replay need no climate, vegetation, fit or ELF module.Depends-on: #44
Reuses: SpaDES.core's
outputs()/saveFiles()(itssaveevent) andinputs()/loadFiles()withterra::writeRaster()/rast(),terra::writeVector()/vect(),qs2::qs_save()/qs_read(); new: only the table of which function handles which object (replayObjects,replayHow), the stacking offirePolys(stackFirePolys()/unstackFirePolys(): a list of vectors has no singleoutputs()function) and the row buildersreplayOutputs()/replayInputs().Technical details
No defect; this is the replay path of the fast-hindcast design. With
replaySave = TRUEthe module'ssaveevent (scheduled at.runInitialTime, priority 7, after the first build) adds one row per object it holds tooutputs(sim)and schedules SpaDES.core's own save event, which writesreplay_<name>_year<time>.<ext>tooutputPath(sim). WithreplayFromset,.inputObjectsadds rows toinputs(sim)and callsloadFiles(), then returns;initreturns beforeInit()and schedules no event. A save first deletes thereplay_*files of an earlier save in that folder, so an object missing from the newer save is not replayed from the older one. A folder with two saves of one object is refused.Bundle (object: who normally makes it; saved when present):
fireSense_SpreadCovariates: this module (qs2);flammableRTM:fireSense_dataPrepFitper-year list via this module'sInit(tif);rasterToMatch,rasterToMatchELF,rasterToMatchLargeELF:fireSense_ELFs(tif, categories kept);studyAreaWithSpreadParams:fireSense_dataPrepFit, or this module from the ledger (qs2, so its list columnsparams,sppEquiv,covMinMax_spreadsurvive; a GeoPackage turnedparamsinto text);nonEscapedFireSizesHa:fireSense_dataPrepFit(qs2);ignitionFirePoints:fireSense_dataPrepFit(gpkg);firePolys: supplied by the user, no module makes it (stacked into one gpkg with the element namesyear<YYYY>in a column; a NULL element is dropped; an unnamed list stops). A terra object where a table is expected stops, never reaching qs2. Nothing usessaveRDS.The module declares the objects other modules make as
expectsInputonly. AcreatesOutputfor them would makesuppliedElsewhere()report them supplied in every run, sofireSense_dataPrepFitwould not buildfirePolysandfireSense_burnwould not makenonEscapedFireSizesHain a predict-only run. A test checks that none is declared.Tests (tests/testthat/test-replay.R): no
createsOutputof other modules' objects; nothing written withoutreplaySave; save then replay gives identical objects of every class, with a ledger-shapedstudyAreaWithSpreadParams(list columns), the levels ofrasterToMatchLargeELFand the names offirePolys; a second smaller save to the same folder leaves no stale polygon, and an object dropped from a later save is not replayed (fails without the delete); a terra object in a table slot and an unnamedfirePolysstop; a replay job builds no fuel classes and runs no build event. Full suite: branch 378 passed, 0 failed, 0 skipped; #44's code with these tests: 340 passed, 7 failed, 4 errors (all in the new tests).🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6