REOPENED — normalize.py was never created; only rate-regime discount existed. New backend/app/services/forecasting/normalize.py with normalize_demand(series): multiplicative month-of-year deseasonalization of the raw monthly demand SalesSeries (§9.4). Pure/deterministic; min-data guard (<2 full years / empty month / overall_mean<=0 → factor 1.0, no divide-by-zero, no thin-data noise). Exposes seasonal factors for explainability. Synthetic unit test: seasonality removed (month means equalised), flat unchanged, thin/empty/all-zero safe. DoD (module + doc + test) MET. Production wiring into rate_sensitivity._align_sales_deltas DEFERRED (documented TODO): deseasonalizing the short rate-driven series perturbs the recovered β/lag on current data — needs a points-per-month gate / joint seasonal+rate estimation + backtest before wiring. Forecast stack is advisory regardless. Refs #979 |
||
|---|---|---|
| .. | ||
| api | ||
| integration | ||
| scrapers | ||
| scripts | ||
| services | ||
| smoke | ||
| sql | ||
| workers | ||
| __init__.py | ||
| conftest.py | ||
| test_admin_weight_profiles.py | ||
| test_concepts_stub.py | ||
| test_gate_verdict.py | ||
| test_health.py | ||
| test_layout_signature.py | ||
| test_layout_tz_pdf.py | ||
| test_nspd_client.py | ||
| test_nspd_sync.py | ||
| test_ping.py | ||
| test_poi_score.py | ||
| test_quarter_dump_lookup.py | ||
| test_rbac.py | ||
| test_sentry_init.py | ||
| test_velocity.py | ||
| test_weight_profiles.py | ||