Model/packages
Khalim Conn-Kowlessar 62289ec6f6 P2.4: correct table_12 CO2 factors to SAP 10.2 (14-03-2025); P2 complete
ADR-0010 §1: the file was a SAP 10.2 prices + SAP 10.3 CO2 hybrid,
incorrectly labelled "SAP 10.3" throughout. Realigns the CO2 column
to SAP 10.2 PDF page 189 — the table the calculator's Validation
Cohort certs were emitted against.

CO2 corrections (kg CO2e per kWh delivered):
  - Mains gas:               0.214 → 0.210
  - LPG (2, 3, 5, 9):        0.24  → 0.241 (precision restore)
  - Biogas (7):              0.029 → 0.024
  - HVO (71):                0.041 → 0.036
  - FAME (73):               0.058 → 0.018
  - B30K (75):               0.226 → 0.214
  - Bioethanol (76):         0.072 → 0.105
  - Coal / anthracite (11, 15): 0.398 → 0.395
  - Smokeless (12):          0.398 → 0.366
  - Wood logs (20):          0.023 → 0.028
  - Wood pellets (22, 23):   0.048 → 0.053
  - Wood chips (21):         0.018 → 0.023
  - Dual fuel (10):          0.084 → 0.087
  - Standard electricity (all grid tariffs):
                             0.086 → 0.136 (biggest swing — the
                             annual-average factor changes between
                             SAP 10.2 and 10.3 by -37%)
  - Heat-network variants realigned to match their parent fuels
  - _DEFAULT_CO2_KG_PER_KWH: 0.214 → 0.210

Header docstring rewritten:
  - Re-labelled "SAP 10.2 (14-03-2025 amendment)"
  - Dropped the misleading "+25% shift from SAP 10.2" block — those
    13.19 → 16.49 figures were SAP 10.1 → SAP 10.2, not 10.2 → 10.3
  - Notes the SAP 10.3 re-pointing trigger (corpus migration)

New test file packages/domain/src/domain/sap/tests/test_table_12.py
locks SAP 10.2 values for mains gas, standard electricity, 7h low,
24h heating, bulk LPG, heating oil, default, plus sanity checks
on the unchanged unit price + PE factor columns.

All 161 SAP + ml_training_data tests pass. CO2 corrections don't
affect SAP score (cost-driven) or PEUI (PEF-driven), so golden
fixtures and probe pinned values remain green.

P2 complete:
  P2.1 (ac1aa56a) — probe swap to spec prices
  P2.2 (28e9dd38) — golden fixtures migrated to loose smoke test
  P2.3 (cd6ac9b1) — cert-cal file deleted
  P2.4 (this)     — CO2 factors corrected

Next: P1 (parquet re-extract with inspection_date) + P3 (Validation
Cohort filter) unblock the cohort-clean probe baseline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 10:10:04 +00:00
..
domain P2.4: correct table_12 CO2 factors to SAP 10.2 (14-03-2025); P2 complete 2026-05-19 10:10:04 +00:00
fetchers added potential file scaffolding: 2026-05-15 10:56:53 +00:00
repos added potential file scaffolding: 2026-05-15 10:56:53 +00:00
utils added potential file scaffolding: 2026-05-15 10:56:53 +00:00
README.md added potential file scaffolding: 2026-05-15 10:56:53 +00:00

Shared packages

Workspace packages consumed by services/*. Each package is its own Python distribution with its own pyproject.toml; services import via the workspace dependency mechanism ({ workspace = true }).

Package Purpose
domain/ Shared domain types — Property, BaselinePerformance, Plan, Scenario, EpcPropertyData, etc. No persistence, no IO, no business logic.
repos/ Persistence layer — one repo per aggregate. Owns the SQL. Depends on domain.
fetchers/ External API clients (gov EPC, Ofgem, Google Solar, etc.). Depend on domain for response shapes.
utils/ Cross-cutting infra — logging, S3, CloudWatch URL builders, SQS task helpers.

Adding a new shared package

Only when a real second consumer materialises. Don't pre-shatter (repos-epc, repos-property, ...) — split when a deployment needs to drop a dep, not before.

See ../ara_backend_design.md §11 for the broader monorepo layout and ../CONTEXT.md for the domain glossary that names the types living in domain/.