Model/repositories
Jun-te Kim 7aea692521 historic EPC: read via infrastructure/s3, not the utils.s3 utility
HistoricEpcS3Repository reached into utils/s3.py (read_csv_gz_from_s3 +
parse_s3_uri), the legacy utility that self-constructs boto3 inside free
functions. The other S3 repositories deliberately depend on the
infrastructure/s3 layer instead (UnstandardisedAddressListCsvS3Repository
injects a CsvS3Client). Bring historic EPC into line.

- Add GzipCsvS3Client(S3Client) in infrastructure/s3: read_csv_gz(key) ->
  DataFrame (get_object + gzip decode).
- Inject it into HistoricEpcS3Repository; the bucket lives in the client and
  the repo only builds the per-postcode key + maps rows (no S3/HTTP code).
  Add with_default_s3_client(s3_root) for composition roots.
- Update main.py and the match_addresses_for_postcode seam to the factory.
- Repo tests inject a real GzipCsvS3Client over a controlled boto stub
  (exact key assertions + AccessDenied); add a moto-based client test and a
  factory test covering s3_root -> bucket+key.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQE5TsSuQTeNSCSz9A9GQf
2026-06-30 09:19:57 +00:00
..
bulk_upload tests files 2026-06-04 11:47:42 +00:00
comparable_properties Merge remote-tracking branch 'origin/main' into feature/e2e-runs 2026-06-23 17:07:27 +00:00
epc Batch EPC writes in EpcPostgresRepository pass pyright strict 🟪 2026-06-29 13:17:29 +00:00
fuel_rates Load the off-peak day/night rate from the committed snapshot 🟩 2026-06-24 17:20:19 +00:00
geospatial feat(geospatial): batch coordinates_for_uprns lookup (#1227) 2026-06-15 14:35:32 +00:00
historic_epc historic EPC: read via infrastructure/s3, not the utils.s3 utility 2026-06-30 09:19:57 +00:00
landlord_overrides property override 2026-06-05 12:18:13 +00:00
magic_plan correct imports in postgres repo 2026-06-09 14:25:29 +00:00
materials feat(first-run): FirstRunPipeline E2E — Ingestion → Baseline → Modelling (#1136) 2026-06-01 16:28:48 +00:00
plan Batch plan saves reduce RDS CPU during bulk modelling runs 🟪 2026-06-29 15:08:47 +00:00
product Hold one DB connection per modelling_e2e invocation 2026-06-24 16:58:21 +00:00
property perf(modelling_e2e): bulk reads and batch writes to cut RDS load 2026-06-24 18:43:42 +00:00
property_baseline refactor(property-baseline): rename baseline → property_baseline aggregate (PR #1139 review) 2026-06-01 16:28:48 +00:00
scenario refactor(modelling): consolidate scenario + installed_measure into the subpackage 2026-06-03 22:52:35 +00:00
solar perf(modelling_e2e): bulk reads and batch writes to cut RDS load 2026-06-24 18:43:42 +00:00
spatial feat(spatial): per-UPRN cache repo for the OS spatial reference 2026-06-04 17:15:51 +00:00
tasks perf(modelling_e2e): batch SubTask bookkeeping to stop per-property writes 2026-06-24 19:26:42 +00:00
unstandardised_address updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
uploaded_file UploadedFilePostgresRepository returns latest uploaded file by deal ID and type 🟩 2026-06-09 11:54:14 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
postgres_unit_of_work.py Resolve overrides on the unit's own session, not a second connection 2026-06-24 17:01:41 +00:00
unit_of_work.py feat(repositories): expose the spatial cache repo on the Unit of Work 2026-06-04 17:20:39 +00:00