Repository navigation
Build lightningMaps and ignitionFitRTM when missing, not only when undeclared - #49
Merged
Merged
Conversation
…her module declares them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXgg187sAPQZwQT3Mf4
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.
When the fit-data module skips its ignition preparation, two inputs the prediction side needs were never made. This module now makes them itself whenever they are missing.
Affects: Runs where
fireSense_dataPrepFitskips its ignition prep (ledger fit reused) now work; runs where it makes the inputs, or is absent, are unchanged.Technical details
Defect:
fireSense_dataPrepPredict.R:1282(lightningMaps) and:688(ignitionFitRTM) only built the objects whensuppliedElsewhere()was FALSE.fireSense_dataPrepFitdeclares both as outputs, so they counted as supplied even when itsprepIgnitionFitDatawas skipped (companion dataPrepFit skip PR).Fix:
ignitionFitRTMis built whenis.null()(:688).lightningMapsis also built, when NULL, at the start of theprepIgAndEscPredictDataevent (:358)..inputObjectskeeps itssuppliedElsewherecheck. Both call the newlightningMapsFor().expectsInput/createsOutputdescs updated.Event order:
.inputObjectsruns before every event, so it cannot test for NULL (dataPrepFit's objects do not exist yet). dataPrepFit'sprepIgnitionFitDataruns atstart(sim), priority 1. This module'sprepIgAndEscPredictDatais at.runInitialTime(defaultstart(sim), not earlier than start), default priority 5. So the check at event time sees dataPrepFit's objects when it prepares, and NULL when it skips: no second build.Reuses:
fireSenseUtils::prepare_LightningData,asPath/inputPath, the existingignitionFitRTMline and the existing.inputObjectspath; new:lightningMapsFor()(one shared call for.inputObjectsand the event, replacing the inline call).Tests: new
tests/testthat/test-ignitionInputsOtherModule.R(a stub module declares both outputs without making them;prepare_LightningDatamocked). Branch: 406 pass, 0 fail. Base (origin/development): 401 pass, 0 fail; the new test errors on base (NULLlightningMaps) and its second test (objects made elsewhere are not rebuilt) passes on both. Run viaconvertToPackage+test_local.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXgg187sAPQZwQT3Mf4