feat: 노을 공기 보정을 평소 공기 기준점 중심으로 바꿔 맑은 날 점수가 한 점에 몰리지 않게
This commit is contained in:
1 parent
91a86a2c10
commit
3857ef8d14
4 files changed
+24
-14
No files matched your search
@@ -161,7 +161,7 @@ def test_score_rows_apply_air_at_sunset_and_keep_cloud_score_without_air():
|
||||
om = {("R", sky_service._nearest_slot(hour)): SimpleNamespace(visibility_m=5000)}
|
||||
hazy = sky_service._score_rows(region, today, clouds, now, hourly, om)[0]["score"]
|
||||
assert hazy == round(plain * 0.8 * 0.85)
|
||||
rain = {("R", hour - timedelta(hours=3)): SimpleNamespace(humidity=50, rain_prob=80), ("R", hour): SimpleNamespace(humidity=50, rain_prob=10)}
|
||||
rain = {("R", hour - timedelta(hours=3)): SimpleNamespace(humidity=60, rain_prob=80), ("R", hour): SimpleNamespace(humidity=60, rain_prob=10)}
|
||||
assert sky_service._score_rows(region, today, clouds, now, rain, {})[0]["score"] == min(100, round(plain * 1.15))
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,12 @@ def test_score_rises_steadily_with_a_few_clouds():
|
||||
assert scores == sorted(scores) and len(set(scores)) == len(scores) # 맑은 날도 구름 몇 %로 갈리고 10%에서 꺾이지 않는다
|
||||
|
||||
|
||||
def test_air_factor_hazy_humid_lowers_and_clearing_rain_raises():
|
||||
def test_air_factor_centers_on_usual_air_and_clearing_rain_raises():
|
||||
assert air_factor(Air()) == 1.0
|
||||
assert air_factor(Air(visibility_km=20, humidity=70)) == 1.0
|
||||
assert air_factor(Air(visibility_km=20, humidity=60)) == 1.0 # 평소 공기
|
||||
assert air_factor(Air(visibility_km=5)) == 0.8 and air_factor(Air(humidity=90)) == 0.85
|
||||
assert 0.8 < air_factor(Air(visibility_km=12.5)) < 1.0
|
||||
assert air_factor(Air(visibility_km=40)) == 1.12 and air_factor(Air(humidity=40)) == 1.06 # 맑고 건조하면 올라간다
|
||||
assert 0.8 < air_factor(Air(visibility_km=12.5)) < 1.0 < air_factor(Air(visibility_km=30)) < 1.12
|
||||
assert air_factor(Air(rain_before=70, rain_now=10)) == 1.15
|
||||
assert air_factor(Air(rain_before=70, rain_now=60)) == 1.0 # 아직 비 오는 중이면 가산 없음
|
||||
|
||||
|
||||
Reference in new issue
Block a user