Skip to content

Read the SpreadFit ledger with readFitLedger(): a run that only reads a fit needs no ledger copy - #124

Merged
eliotmcintire merged 3 commits into
developmentfrom
feat/readFitLedger
Dec 3, 2026
Merged

eliotmcintire merged 3 commits into
developmentfrom
feat/readFitLedger

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

A run that only reads an existing fit no longer needs its own copy of the fit ledger: if its ledger file is missing or empty, it reads the newest production fit.

Affects: runs with doFit FALSE and a named ledger file that does not exist now read the production fits instead of failing; every other run reads what it read before.

Reuses: fireSenseUtils::readFitLedger(), fireSenseUtils::moduleDoFit() (replaces the hand-written alias resolution in fitPrepNeeded()); new: nothing.

Depends-on: PredictiveEcology/fireSenseUtils#273

Technical details
  • fireSense_dataPrepFit.R Init(): readSpreadFitLedger(...) becomes readFitLedger("spread", ..., doFit = doFit, ...), with doFit <- fireSenseUtils::moduleDoFit(Par, currentModule(sim)) resolved once and also used for mustFit() and the own-fit check. mustFit() still stops when the file has rows but not this ELF.
  • fitPrepNeeded() uses moduleDoFit() for both fits (NA is kept when the simList has no fireSense_ignitionFit parameters).
  • reqdPkgs: fireSenseUtils floor 0.2.3.9200, with a TODO to set it to the version #273 merges at.
  • Descriptions of spreadFitFilename and doFit state the rule. NEWS entry added. No version bump.
  • readSpreadFitLedger() is gone in fireSenseUtils#273: the two direct calls in test-ledgerNotInInputObjectsKey.R now call readFitLedger("spread", ...). The Init stand-ins in the tests stand in for readFitLedger; a new test checks the call is readFitLedger("spread", ...) with the run's doFit.
  • Tests (convertToPackage() with buildDocuments = TRUE + test_local(), scratch library with fireSenseUtils from the #273 branch head 95ff1be, SpaDES.core 3.2.1.9085): branch 705 tests, 0 failed, 0 errors, 1 skipped. Base 702 tests, 0 failed, 1 error: the base test that calls readSpreadFitLedger(), which that fireSenseUtils no longer has.

🤖 Generated with Claude Code

… with doFit FALSE and no ledger file of its own reads the newest production fits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Dec 3, 2026
eliotmcintire and others added 2 commits December 2, 2026 18:25
…edger read, mustFit and fitPrepNeeded; tests use readFitLedger()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eliotmcintire
eliotmcintire merged commit 34f4fd9 into development Dec 3, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the feat/readFitLedger branch December 3, 2026 17:35
eliotmcintire added a commit that referenced this pull request Dec 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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