Merge origin/main into main-2: Open-Meteo 구름 20·100km·모델 2개 구조에 노을 하늘 상황 판정 맞춤

- 하늘 상황 판정·테스트를 구름 지점 2곳(20·100km), 모델 2개(JMA·ICON) 기준으로
- Open-Meteo 보조값 호출(fetch_weather)도 장애 대처(8초 끊기·2분 건너뛰기) 적용
- worker: 행사 수집 스케줄과 Open-Meteo 보조값 스케줄 둘 다 유지
- 지수 seed: main 의 한계 설명 + main-2 의 점수 구간 설명
- 옛 data-pipeline 문서는 삭제 유지, 내용은 openmeteo-data.md·데이터_흐름.html 에 반영
This commit is contained in:
minaChoi committed 2026-10-07 14:04:18 +09:00
commit 3f8f7daeb1
21 files changed
+1068 -111

No files matched your search

+20 -1
View File
@@ -55,7 +55,7 @@ async def test_sky_view_scores_three_days_with_spots(monkeypatch, clean):
assert "알맞게" in plan["reason"]
assert plan["spot"]["name"] == "망원한강공원" and plan["best_at"]
assert [t["kind"] for t in plan["timeline"]] == ["golden", "sun", "blue"]
assert plan["situation_label"] == "하늘이 넓게 물들 수 있어요" and plan["models_agree"] == plan["models_total"] == 4
assert plan["situation_label"] == "하늘이 넓게 물들 수 있어요" and plan["models_agree"] == plan["models_total"] == 2
assert plan["outlook"] == ""
assert body["sunset"]["verdict"] == "go" and body["spots"][0]["direction"]
@@ -122,3 +122,22 @@ def test_outlook_only_when_a_later_day_has_a_better_verdict():
few, glow = SkySituation.FEW, SkySituation.GLOW
assert sky_service.outlook(sit(0, few), [sit(0, few), sit(1, few), sit(2, glow)], today) == "모레가 더 나아요 · 하늘이 넓게 물들 수 있어요"
assert sky_service.outlook(sit(0, few), [sit(0, few), sit(1, few)], today) == ""
@pytest.mark.anyio
async def test_clouds_are_stored_by_region_with_only_needed_hours(monkeypatch, clean):
async def fake_fetch(client, points, days=3):
return _fake_response(points, days)
monkeypatch.setattr(sky_service, "fetch_clouds", fake_fetch)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
await client.get("/v1/sky", params={"region": "1144000000"})
err, rows = await DB_SESSION_MNG.execute_lambda(
lambda s: s.execute(text("SELECT kind, distance_km, forecast_at, model FROM cloud_hourly WHERE region_code = '1144000000'"))
)
rows = rows.all()
assert len(rows) == 2 * 2 * 3 * 2
assert {(r.kind, r.distance_km) for r in rows} == {(1, 20), (1, 100), (2, 20), (2, 100)}
assert {r.model for r in rows} == {3, 4}
assert len({r.forecast_at for r in rows}) == 6