Compare commits

...

2 commits

Author SHA1 Message Date
f826a37345 Merge pull request 'fix(parcels): _score_label honor «хорошо»=25→«отлично» boundary (#1357)' (#1680) from fix/score-label-threshold-1357 into main
Some checks are pending
Deploy / changes (push) Waiting to run
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
2026-06-17 17:54:57 +00:00
d0a409f873 fix(parcels): _score_label honor documented «хорошо»=25 threshold, close band gap (#1357)
Some checks failed
CI / changes (push) Successful in 13s
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Successful in 1m51s
CI / backend-tests (push) Failing after 9m0s
CI / changes (pull_request) Successful in 7s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 2m17s
CI / backend-tests (pull_request) Failing after 9m13s
2026-06-17 20:30:19 +03:00

View file

@ -145,10 +145,17 @@ def _haversine_km(lat1: float, lon1: float, lat2: float, lon2: float) -> float:
def _score_label(s: float) -> str:
"""Текстовая интерпретация POI-score по эмпирическим порогам ЕКБ."""
"""Текстовая интерпретация POI-score по эмпирическим порогам ЕКБ.
Шкала: <5 плохо, 5-15 средне, 15-25 хорошо, >=25 отлично.
"""
if s < SCORE_THRESHOLDS["плохо"]:
return "плохо"
if s < SCORE_THRESHOLDS["средне"]:
return "плохо" if s < SCORE_THRESHOLDS["плохо"] else "средне"
return "хорошо" if s < SCORE_THRESHOLDS["отлично"] else "отлично"
return "средне"
if s < SCORE_THRESHOLDS["хорошо"]:
return "хорошо"
return "отлично"
def _confidence_label(c: float) -> str: