Model/repositories
Jun-te Kim b1ff711260 perf(modelling_e2e): batch SubTask bookkeeping to stop per-property writes
Even after batching the data writes, the handler still wrote to the DB per
property through the orchestrator's SubTask bookkeeping: create + start +
complete each self-committed, and _cascade re-listed every sibling and re-saved
the parent on every transition — ~5 writes per property plus an O(N^2) cascade.

- TaskOrchestrator.run_subtasks: create all children in one INSERT, run each
  (failures isolated per child), then persist all terminal states in one bulk
  save and cascade the parent once. Children go WAITING -> terminal; the
  transient IN_PROGRESS row is never written.
- SubTaskRepository.create_many / save_many (bulk INSERT / bulk fetch + update).
- _cascade short-circuits when the Task is already FAILED (terminal) — skips the
  sibling roll-up entirely.
- modelling_e2e handler fans out via run_subtasks instead of per-property
  create_child_subtask + run_subtask.

Per N-property batch the SubTask bookkeeping drops from ~5N writes + an O(N^2)
cascade to ~2 writes + 1 cascade.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 19:26:42 +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 Round-trip the non-separated conservatory through persistence 🟩 2026-06-24 13:56:05 +00:00
fuel_rates Add dual-fuel (mineral+wood) billing carrier (fix UnmappedSapCode 10) 2026-06-24 10:07:57 +00:00
geospatial feat(geospatial): batch coordinates_for_uprns lookup (#1227) 2026-06-15 14:35:32 +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 32 and delete in plan 2026-06-23 15:01:34 +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