gendesign/backend/tests/services/site_finder
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
..
test_best_layouts.py fix(site-finder): normalize supply room_bucket vocabulary to velocity side (#1229) 2026-06-13 15:02:50 +05:00
test_competitor_relevance.py feat(site-finder): per-competitor relevance_weight (#949 PR B) (#1000) 2026-06-02 19:45:38 +00:00
test_competitors_parking.py feat(site-finder): domrf→cad geom-match + parking_ratio конкурентов (#96) (#1327) 2026-06-14 14:49:28 +00:00
test_developer_attribution.py feat(site-finder): детерминированная атрибуция застройщика в analyze (#1088) 2026-06-13 16:13:45 +05:00
test_district_resolver.py feat(forecast): resolve admin district -> micro set in §9.x market/supply/sales filters 2026-06-05 07:03:37 +05:00
test_future_supply.py feat(forecasting): §9.x→§22 orchestrator + fix supply-side district resolution (3a) 2026-06-05 08:21:04 +05:00
test_locations.py fix(site_finder): make Location demand_index city-relative (#948) 2026-06-08 13:58:12 +05:00
test_macro.py fix(#945): indicator-aware default region in macro reader + document debt data-quality 2026-06-04 11:49:41 +05:00
test_market_metrics.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
test_own_portfolio.py feat(site-finder): own-portfolio data source for §25.3 cannibalization (#1169 PR1) 2026-06-08 16:21:53 +05:00
test_pat_subzones.py fix(sf): робастный путь к koltsovo JSON в pat-loader (#1155) 2026-06-07 15:34:10 +00:00
test_premises_lookup.py feat(site-finder): per-building помещения/машино-места + parking_ratio (on-demand MVP, #96) 2026-06-14 18:48:16 +05:00
test_supply_layers.py feat(forecast): resolve admin district -> micro set in §9.x market/supply/sales filters 2026-06-05 07:03:37 +05:00