feat: 각 순위에 중요도(상·중·하) 가중치 반영

This commit is contained in:
minaChoi committed 2026-10-08 09:19:59 +09:00
1 parent 471353212a
commit 116f644bb7
11 files changed
+207 -121

No files matched your search

+2 -1
View File
@@ -25,6 +25,7 @@ from router.v1.feed.protocol import (
)
from services.air_service import GRADE_LABEL as AIR_GRADE_LABEL
from services.air_service import pm10_grade, pm25_grade
from services.calc.index_calc import rank_score
from services.calc.moon import illumination, nearest, phase_name
from services.calc.sky_score import GRADE_LABEL, SITUATION_LINE
from services.calc.sun import sun_times
@@ -658,7 +659,7 @@ class FeedService:
best = None
for i in c.board.items if c.board else []:
s = next((x for x in i.trend if x.score_date == tomorrow), None)
if s is not None and (best is None or s.score > best[1].score):
if s is not None and (best is None or rank_score(s.score, i.definition.priority) > rank_score(best[1].score, best[0].definition.priority)):
best = (i, s)
if best is not None:
rows.append(Row(label="내일 1위 각", value=f"{best[0].definition.name} {best[1].score}점"))