Model/tests/domain/sap10_calculator/rdsap
Khalim Conn-Kowlessar 5f4a78e4c9 S0380.186: pin golden PE/CO2 against full-precision dr87 worksheets (47 certs)
The existing golden test compares calc PE/CO2 against the integer-rounded
lodged register values (energy_consumption_current / co2_emissions_current),
which conflates real calculator gaps with register rounding. This adds a
parallel pin against each cert's Elmhurst dr87 worksheet (286)/(272) at full
precision — a clean calculator-vs-Elmhurst signal for the 47 worksheet-backed
certs (9 ASHP + 38 cohort-2).

Findings at capture (calc − worksheet, on the worksheet's own decimal TFA):
  - 37/47 exact on both PE (<0.05 kWh/m²) and CO2 (<0.02 kg).
  - 10 higher-consumption gas certs carry PE +0.5..+1.5 kWh/m² AND
    CO2 -0.5..-1.1 kg simultaneously. PE-over + CO2-under on the same
    certs is the fingerprint of a small gas→electricity fuel-split
    difference (elec PE 1.51 > gas 1.13, but elec CO2 0.136 < gas 0.21),
    not a factor-value error — next slice candidate.

An earlier "41/47 PE gaps" reading was a JSON-integer-TFA division artifact;
comparing on the worksheet's decimal TFA (which the calculator also uses)
collapses it to the real 10. Worksheet values frozen as literals (the dr87
PDFs are untracked, so not parsed at test time) per the worksheet_unrounded_sap
convention. Also replaced a pre-existing pytest.approx with abs-diff to keep
the file at zero pyright errors (feedback_abs_diff_over_pytest_approx).

106 passed (was 59); pyright 0 errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 19:54:45 +00:00
..
fixtures/golden Move sap10_calculator tests to tests/domain/sap10_calculator/ for CI 2026-06-02 16:58:00 +00:00
__init__.py Move sap10_calculator tests to tests/domain/sap10_calculator/ for CI 2026-06-02 16:58:00 +00:00
test_cert_to_inputs.py S0380.184: community electric-HP network CO2/PE uses monthly Table 12d/12e — closes CH3 2026-06-02 18:43:16 +00:00
test_golden_fixtures.py S0380.186: pin golden PE/CO2 against full-precision dr87 worksheets (47 certs) 2026-06-02 19:54:45 +00:00