Model/domain
Khalim Conn-Kowlessar 883d66ac65 Slice S0380.38: loosen FEE round-trip tolerance 1e-9 -> 1e-6
test_no_ac_cert_round_trips_fee_equals_space_heating_per_m2 encodes
a real SAP 10.2 invariant: when (108) = 0 (no fixed AC) and Appendix
H solar is absent (every cohort cert), (109) FEE must equal
space_heating_kwh / TFA.

The 1e-9 tolerance was too tight. The cascade computes:
  - FEE: sum_round_per_month(annual_98a) / TFA
  - space_heating_kwh: sum(monthly_98a_kwh) summed in calculator
The two paths sum the same 12 monthlies in different rounding
orders and disagree at ~8e-8 (cascade FEE = 95.39072333333334;
SH/TFA = 95.39072341347577).

1e-6 is two orders of magnitude tighter than any meaningful path
divergence (a stray 4-d.p. rounding step or unintended AC
contribution would blow past instantly) and ~12.5x looser than the
observed float-arithmetic drift, so the invariant still fires.

Also swaps pytest.approx for `abs(a - b) <= tol` per
[[feedback-abs-diff-over-pytest-approx]] (strict-pyright flags
pytest.approx as partially-unknown; nets -1 error on the file).

Test baseline: 712 pass + 0 fails (was 712 + 1).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 16:22:23 +00:00
..
addresses get rid of comments 2026-05-20 13:21:11 +00:00
sap10_calculator Slice S0380.38: loosen FEE round-trip tolerance 1e-9 -> 1e-6 2026-05-28 16:22:23 +00:00
sap10_ml Slice S0380.26: RdSAP10 §5.8 dry-lining adjustment on alt walls — closes cert 7700 -0.44 → +5e-5 2026-05-28 10:56:11 +00:00
tasks added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
postcode.py get rid of comments 2026-05-20 13:21:11 +00:00