mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
P5.5: SapResult.intermediate exposes useful_space_heating_kwh_per_yr
§9 / Table 9c step 10 output keyed by worksheet name on `intermediate`. Mirrors the top-level `space_heating_kwh_per_yr` field so spec sweep slices refer to the worksheet name regardless of field renames. 135 SAP tests pass.
This commit is contained in:
parent
80845b0919
commit
44b1d0d923
2 changed files with 18 additions and 0 deletions
|
|
@ -351,6 +351,7 @@ def calculate_sap_from_inputs(inputs: CalculatorInputs) -> SapResult:
|
|||
"time_constant_h": tau_h,
|
||||
"internal_gains_annual_avg_w": sum(e.internal_gains_w for e in monthly) / 12.0,
|
||||
"mean_internal_temp_annual_avg_c": sum(e.internal_temp_c for e in monthly) / 12.0,
|
||||
"useful_space_heating_kwh_per_yr": space_heating_kwh,
|
||||
}
|
||||
|
||||
return SapResult(
|
||||
|
|
|
|||
|
|
@ -212,6 +212,23 @@ def test_calculate_exposes_hlc_hlp_and_annual_averages() -> None:
|
|||
)
|
||||
|
||||
|
||||
def test_calculate_exposes_useful_space_heating_kwh() -> None:
|
||||
# Arrange — P5 trace mode: useful space heating kWh/yr (§9 / Table 9c
|
||||
# step 10) surfaces on `intermediate` keyed by worksheet name. Mirrors
|
||||
# `space_heating_kwh_per_yr` on the top-level result so spec sweep
|
||||
# slices can refer to the worksheet name regardless of `SapResult`
|
||||
# field renames.
|
||||
inputs = _baseline_inputs()
|
||||
|
||||
# Act
|
||||
result = calculate_sap_from_inputs(inputs)
|
||||
|
||||
# Assert
|
||||
assert result.intermediate["useful_space_heating_kwh_per_yr"] == pytest.approx(
|
||||
result.space_heating_kwh_per_yr, rel=1e-9
|
||||
)
|
||||
|
||||
|
||||
def test_higher_main_heating_efficiency_reduces_fuel_use() -> None:
|
||||
# Arrange — Direction check: doubling the boiler efficiency must halve
|
||||
# the main-heating fuel kWh, holding everything else constant.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue