feat: 달 '밝기 %' 대신 모양 + 잘 보이는지(구름·뜨고 지는 시각), 달 모양을 실제 해·달 위치로

This commit is contained in:
minaChoi committed 2026-10-12 08:49:59 +09:00
1 parent 3a73a44cb0
commit fb47f59d57
8 files changed
+204 -32

No files matched your search

+2 -1
View File
@@ -54,6 +54,7 @@ class Context:
sunset_score: Optional[int]
wind_warning: bool
lookahead_rain_prob: int
moon_note: str = "" # 별보기각 근거 문구: 그날 밤 달 모양·보이는 시간
@dataclass(frozen=True)
@@ -197,7 +198,7 @@ def time_score(rule: dict, ctx: Context) -> tuple[int, str]:
v = rule.get(key, rule.get("default", 100))
return _clamp(v), f"{_WEEKDAY_KO[ctx.day.weekday()]}요일{' 공휴일' if ctx.is_holiday else ''}"
if kind == "moon":
return _clamp(20 + 80 * (1 - ctx.moon)), f"달 밝기 {round(ctx.moon * 100)}%"
return _clamp(20 + 80 * (1 - ctx.moon)), ctx.moon_note or f"달이 비추는 정도 {round(ctx.moon * 100)}%"
if kind == "sunset_score":
return (ctx.sunset_score if ctx.sunset_score is not None else _UNKNOWN), (
f"노을 점수 {ctx.sunset_score}" if ctx.sunset_score is not None else f"노을 점수 계산 전이라 {_UNKNOWN}점으로 둬요"