Model/packages
Khalim Conn-Kowlessar 380b6781e8 §9a slice 2: CalculatorInputs.energy_requirements + cert_to_inputs wiring + SapResult fields + _solve_month refactor (atomic)
Path (i) — cert_to_inputs precompute. cert_to_inputs calls space_heating_fuel_monthly_kwh from local SpaceHeatingResult + Table 11 secondary fraction + per-system efficiencies; stashes the EnergyRequirementsResult on new `CalculatorInputs.energy_requirements` composite slot (default = _ZERO_ENERGY_REQUIREMENTS_RESULT).

_solve_month stops doing q/η inline — reads precomputed (211)m / (215)m fuel tuples directly via `inputs.energy_requirements.{main_1,secondary}_fuel_monthly_kwh[m-1]`. Existing `CalculatorInputs.main_heating_efficiency` / `.secondary_heating_efficiency` / `.secondary_heating_fraction` stay on the dataclass as inputs to the orchestrator (now redundant for the calculator's read path; kept for audit + backwards compat).

SapResult gains flat `main_2_heating_fuel_kwh_per_yr` and `space_cooling_fuel_kwh_per_yr` scalars — both zero in scope A, populated by future two-main + Table 10c SEER slices.

Round-trip test pins `inputs.energy_requirements.main_1_fuel_kwh_per_yr == result.main_heating_fuel_kwh_per_yr` to float equality (no rounding from the cert→inputs hop) and asserts scope-A scalars stay zero. PDF-derived ALL_FIXTURES pinning (Q5(α) grilling decision) blocked on PCDB integration — flagged in PCDB gap-list entry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 08:39:26 +00:00
..
domain §9a slice 2: CalculatorInputs.energy_requirements + cert_to_inputs wiring + SapResult fields + _solve_month refactor (atomic) 2026-05-21 08:39:26 +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/.