|
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
Until now life events were stored but ignored by the engine — pure metadata. Now they actually move portfolios. Engine: - simulator.simulate() takes optional cashflow_adjustments: a (n_years,) real-GBP array applied each year *after* savings + return but *before* withdrawal. Positive = inflow, negative = outflow. - New fire_planner/life_events.py with EventInput dataclass + events_to_cashflow_array(events, horizon). Handles ranged deltas, one-time amounts, disabled events, year clipping past horizon, negative year_start (clipped to 0), and summing multiple events. API: - /simulate accepts optional life_events list. Server converts each to EventInput, builds cashflow_adjustments, passes to simulate(). - Frontend Run-now on scenario detail now fetches the scenario's life events and includes them in the request — projections finally reflect "retire at 50, kid born at y3, inheritance at y22". Tests: 11 events helper + 4 end-to-end engine + 1 API integration = 16 new tests. 188 total (was 172). mypy strict + ruff clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_api_life_events_goals.py | ||
| test_api_networth.py | ||
| test_api_scenarios.py | ||
| test_api_simulate.py | ||
| test_cli.py | ||
| test_db_schema.py | ||
| test_e2e.py | ||
| test_ingest_wealthfolio_pg.py | ||
| test_life_events.py | ||
| test_reporters_pg.py | ||
| test_returns.py | ||
| test_scenarios.py | ||
| test_simulator.py | ||
| test_simulator_events.py | ||
| test_strategies.py | ||
| test_tax_base.py | ||
| test_tax_other_regimes.py | ||
| test_tax_uk.py | ||