gendesign/backend/app/services/forecasting
bot-backend cc6ef80d07
Some checks failed
CI / backend-tests (push) Blocked by required conditions
CI / frontend-tests (push) Blocked by required conditions
CI / openapi-codegen-check (push) Blocked by required conditions
CI / changes (push) Successful in 8s
CI / changes (pull_request) Successful in 8s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m42s
CI / backend-tests (pull_request) Has been cancelled
fix(forecasting): thread room_bucket into base_pace/compute_market_metrics for real format ranking (#1593)
Add `velocity_by_room: dict[str, float] | None` to `MarketMetrics` — per-bucket
unit velocity (ед./мес) derived from the existing `sold_by_room` ROLLUP data that
`_query_sales_window` already returns. No new SQL required.

Thread per-bucket velocity through `_demand_only_overlay` via the new
`_FORECAST_TO_METRIC_BUCKETS` constant that maps each forecast bucket to its
market_metrics room-bucket keys. "80+ м²" sums "4" + "5+" keys. Fallback to
aggregate `unit_velocity` when `velocity_by_room` is None (thin-data path).

Previously `base_pace` was identical for all 5 room-buckets, so §9.4 norm and §9.2
base_pace cancelled out in pace/max_pace and ranking was driven purely by §9.5
macro_coef (segment steepness proxy). Now §9.2 reflects real per-bucket observed
demand from objective_lots.contract_date data.

Callers of `compute_market_metrics` that don't use `velocity_by_room` are unaffected
(the new field is additive to the frozen dataclass). All existing callers verified —
none construct `MarketMetrics` directly except the one production site.
2026-06-17 20:55:34 +03:00
..
__init__.py feat(forecasting): §13 report assembler (#988, 955-A2) (#1021) 2026-06-03 08:51:23 +00:00
affordability.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
confidence_engine.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
demand_normalization.py perf(forecast): per-request memoization cache for §22 cold build (#1129) 2026-06-08 05:26:27 +00:00
demand_supply_forecast.py fix(forecasting): propagate confounded flag DemandSupplyForecast → §15 (#1222) 2026-06-13 15:02:50 +05:00
macro_coefficient.py feat(macro): CBR inflation (ИПЦ YoY) -> macro_indicator + activate §9.5 channel (#946) 2026-06-08 11:41:14 +05:00
macro_series.py feat(macro): CBR inflation (ИПЦ YoY) -> macro_indicator + activate §9.5 channel (#946) 2026-06-08 11:41:14 +05:00
normalize.py feat(forecasting): seasonal (month-of-year) demand normalization (#979) 2026-06-04 11:19:50 +05:00
orchestrator.py fix(forecasting): нормализовать dict-district в build_site_finder_report (#1130 follow-up) 2026-06-13 09:24:55 +05:00
product_scoring.py merge: resolve conflicts with main (#1660) into week-review-finish 2026-06-17 20:21:06 +03:00
rate_sensitivity.py feat(forecasting): seasonal (month-of-year) demand normalization (#979) 2026-06-04 11:19:50 +05:00
recommendation.py fix(forecasting): thread room_bucket into base_pace/compute_market_metrics for real format ranking (#1593) 2026-06-17 20:55:34 +03:00
regression.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
report.py feat(forecasting): §13 SiteFinderReport object (#987, 955-A1) (#1019) 2026-06-03 08:33:01 +00:00
report_assembler.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
sales_series.py perf(forecast): per-request memoization cache for §22 cold build (#1129) 2026-06-08 05:26:27 +00:00
scenarios.py fix(week-review): автофиксы код-ревью — 169 issue (label «week ревью 1») 2026-06-15 20:21:11 +05:00
special_indices.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
what_to_build.py feat(forecasting): what-to-build ranker + MAI proxy (#981, 952-B) (#1013) 2026-06-03 07:07:17 +00:00