mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Mirror of S0380.103 for the CO2 cascade. Cert 000565 worksheet line
(267):
Pumps, fans and electric keep-hot 252.5159 0.1412 35.3349 (267)
The displayed factor (0.1412) is the ALL_OTHER_USES Table 12d Σ
days-weighted blend; the displayed product (35.3349) is the kWh-
weighted blend across the two Grid 2 categories:
F_FANS = 0.58 × F_code34 + 0.42 × F_code33 = 0.13872 kg/kWh
F_OTHER = 0.80 × F_code34 + 0.20 × F_code33 = 0.14116 kg/kWh
F_eff = (127.5159 × 0.13872 + 125.0 × 0.14116) / 252.5159
= 0.13993 kg/kWh
CO2 = 252.5159 × 0.13993 = 35.3349 kg/yr ✓
Pre-slice the cascade applied 0.14116 to ALL 252.5159 kWh →
35.6457 → +0.31 over ws.
SAP 10.2 Table 12a Grid 2 (PDF p.191) verbatim header:
"Fractions of electricity used at the higher rate, for use in
off-peak tariff calculations
...
Fans for mechanical ventilation systems 10-hour: 0.58
All other uses, and locally generated 10-hour: 0.80
electricity"
SAP 10.2 Table 12d (PDF p.194) verbatim header:
"Where electricity is the fuel used, the relevant set of factors
in the table below should be used to calculate the monthly CO2
emissions INSTEAD of the annual average factor given in Table
12."
The Grid 2 high-rate fraction blends Table 12d high-rate × low-
rate codes per `F_blended = high_frac × F_high + (1 − high_frac)
× F_low`. MEV fans bill at the lower 0.58 high_frac → lower CO2
factor on the higher-carbon high-rate code 34. Cost-side S0380.103
landed the same split for tariff prices; this slice mirrors it
for the CO2 factor.
3-layer fix:
1. New helper `_pumps_fans_co2_factor_kg_per_kwh` returns the
kWh-weighted blend across `FANS_FOR_MECH_VENT` + `ALL_OTHER_USES`
factors. Falls back to the existing `ALL_OTHER_USES` rate on
STANDARD tariff and no-MEV certs (cohort-safe).
2. cert_to_inputs.py wires `mev_kwh_for_cost_split` +
`pumps_fans_kwh` through to the new helper.
3. Field `CalculatorInputs.pumps_fans_co2_factor_kg_per_kwh`
already exists from S0380.65; calculator legacy path unchanged.
Movement at HEAD `7df3fef8` → post-slice (cert 000565):
| Pin | Pre | Post | Δ vs ws |
|------------------------------|-----------:|-----------:|---------:|
| pumps_fans_co2_kg_per_yr | 35.6457 | 35.3349 | ✓ 0 |
| co2_kg_per_yr (TOTAL) | 6445.8198 | 6445.5090 | −2.1173 |
The total CO2 residual moves -1.81 → -2.12 (sign-flip pattern of
S0380.103): the previously-cancelling pumps_fans CO2 over-count
masked the main-heating-fuel CO2 under-count (downstream of the
§3-§8 SH cascade -16 kWh fuel residual). Per user direction
(NEXT_AGENT_PROMPT) transient continuous-SAP / TOTAL drift is OK
while closing a true spec-correct intermediate-value bug; the SH
cascade closure is a separate slice.
Cohort safety: STANDARD-tariff certs return the existing
ALL_OTHER_USES rate (helper falls through). No-MEV certs return
the same rate (mev_kwh_per_yr=0 short-circuit).
Test count: 604 pass + 7 expected 000565 fails → **605 pass + 7
expected 000565 fails** (new
test_summary_000565_mev_fans_co2_factor_uses_table_12a_grid_2_
fans_for_mech_vent_split GREEN). Pyright net-zero per touched
file (45 baseline → 45 post-change).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| handler | ||
| tests | ||
| __init__.py | ||
| db_writer.py | ||
| elmhurst_extractor.py | ||
| extractor.py | ||
| local_runner.py | ||
| parser.py | ||
| pdf.py | ||