|
All checks were successful
CI / changes (push) Successful in 6s
CI / frontend-tests (push) Has been skipped
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (pull_request) Has been skipped
CI / backend-tests (push) Successful in 6m22s
CI / backend-tests (pull_request) Successful in 6m22s
demand_index used a fixed clamp01(velocity/50); on a live prod refresh all 8 ЕКБ districts sold ≥50/mo so it saturated to 1.0 everywhere — zero discrimination between districts. Redesign to mirror infra_index: normalize each district's unit_velocity against the city reference (MAX district velocity per refresh run), so demand always discriminates and self-calibrates as the market grows (no magic constant to rot). - normalize_demand(velocity, *, city_reference_velocity), pure + graceful (None stays None; reference<=0 -> honest 0.0, no ZeroDivisionError) - refresh_locations now two-pass: collect velocities (one compute_market_metrics per district, no O(n^2)), derive city reference, normalize + upsert; SAVEPOINT-per-row and counters preserved - remove _DEMAND_SATURATION_UPM constant; log city_reference_velocity - tests: rewrite demand normalization + add end-to-end city-relative suite incl. discrimination regression guarding the all-1.0 prod bug Refs #948 |
||
|---|---|---|
| .. | ||
| alembic | ||
| app | ||
| db/init | ||
| output | ||
| scripts | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .env.runtime.example | ||
| alembic.ini | ||
| debug.log | ||
| Dockerfile | ||
| pyproject.toml | ||
| uv.lock | ||