Repository navigation
test(annual): land the heat pump tests stranded in PR #33 - #49
Merged
Merged
Conversation
The heat pump comparison shipped without any of its tests. annual_heat.py is 881 lines of production code carrying zero CI coverage, and every test written for it has sat unmerged in PR #33 since 2 August while the production side landed by another route. That PR cannot simply be merged now: main's copies of annual.py, web_annual.py and annual_heat.py have moved a long way past it (web_annual.py alone is +336/-101, including the upstream v8.49.0 merge and the battery-cycles fix), so merging the branch would drag production code backwards to fix a test gap. This takes the tests only, against current main: - test_annual_heat.py, absent from the repo entirely (752 lines) - make_heat_model and test_annual_heat_integration, into test_annual_integration.py - heat_results, test_web_annual_heat and test_web_annual_predheat_prefill, into test_web_annual.py test_annual_heat_integration is registered through an isolated runner rather than the shared instance, matching run_annual_integration_isolated. PR #33 predates that change and registered it directly; it is the same shape of test - it plans a year of sampled days and never sets up the state it depends on - so it wants the same treatment for the same documented reason. Two guards here are the ones worth having: test_annual_heat_integration pins the heat leg's extra import to exactly one day of heat and explicitly not the two-day figure, which is what catches the unbounded end_record regression; and the model tests hold the identity that the modelled gas bill must not move when the heat pump is added. Full quick suite 242 passed, 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
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.
Closes the CI coverage gap on the heat pump comparison. Supersedes #33.
Why not just merge #33
The heat pump feature shipped its production code —
annual_heat.py(881 lines),annual_costs.py, and theannual.py/web_annual.pyadditions are all onmainand running live on v712.23. Its tests never landed, and have sat in #33 since 2 August.#33 can't be merged now to fix that.
main's copies have moved a long way past it:web_annual.pyannual.pyannual_heat.pyThat drift includes the upstream v8.49.0 merge (#46) and the battery-cycles fix (#47). A trial merge conflicts on four files, and resolving it would risk dragging production code back to 2 August to fix a test gap. So this takes the tests only, rebased on current
main.What's here
test_annual_heat.py— 752 lines, a filemaindoes not have at allmake_heat_model,test_annual_heat_integration→test_annual_integration.pyheat_results,test_web_annual_heat,test_web_annual_predheat_prefill→test_web_annual.pyunit_test.py;subtractableadded to the workspace dictionaryOne deliberate change from #33
test_annual_heat_integrationis registered through arun_annual_heat_integration_isolatedwrapper rather than against the shared instance. #33 predatesrun_annual_integration_isolated, which exists because that test plans a year of sampled days without setting up the state it depends on — inheriting ambient state made it 13x slower (34s → 463s) without ever failing.test_annual_heat_integrationis the same shape of test and wants the same treatment for the same reason.The guards worth having
test_annual_heat_integrationpins the heat leg's extrano_pvbatimport to exactly one day of heat and explicitly not the two-day figure — this is what catches the unboundedend_recordregression, whererun_prediction()returns running totals over the whole 48-hour plan rather than theend_recordwindow.Verification
Full quick suite 242 passed, 0 failed (3 new non-slow suites;
annual_heat_integrationis slow-marked). All four heat suites pass individually against currentmain.blackandruff --select=F401clean.🤖 Generated with Claude Code