Add test for run_dwelling.py script and fix HPWH initialization bug #208
+71
−4
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.
Summary
--no-showCLI flag tobin/run_dwelling.pyfor automated testing supportTestRunDwellingScriptintegration test that runs the script as a subprocessWaterHeater.pywhereself.hp_copwas used before being definedDetails
New Test
The PR template requires "Test with run_dwelling.py or other script". This adds an automated test that validates
bin/run_dwelling.pyworks end-to-end by running it as a subprocess with--no-showflag.Bug Fix
Fixed an
AttributeErrorinHeatPumpWaterHeater.__init__whereself.hp_copwas referenced before assignment. This bug was triggered when:UniformEnergyFactor != 4.9(soHPWH Capacity (W)is not set)The fix changes
self.hp_coptoself.cop_nominalon line 438, which is equivalent sinceself.hp_copis later set toself.cop_nominalanyway.Testing
All 11 dwelling tests pass including the new
TestRunDwellingScript::test_run_dwelling_script.