fix: 사주 조후를 월령 기준으로 보정 — 여름 흙은 마른 흙, 未 0.9, 오행 세력·신강신약 추가, 계산식 문서

This commit is contained in:
minaChoi committed 2026-10-29 13:15:45 +09:00
1 parent 08a2e9f907
commit 63db0b725b
6 files changed
+202 -13

No files matched your search

+20 -1
View File
@@ -4,13 +4,14 @@ import pytest
from common.utils.kma_time import KST
from services.saju.birth import to_solar_time
from services.saju.climate import HourWeather, axis_effect, chart_climate, climate_match
from services.saju.climate import HourWeather, axis_effect, chart_climate, climate_match, seasoned
from services.saju.daily import SCORE_WEIGHTS, daily_facts
from services.saju.pillars import day_pillar, make_chart
from services.saju.rules import (
branch_relations, branch_ten_god, chart_ten_gods, dohwa_of, hongyeom_of, stem_relations, ten_god, triple_relations,
)
from services.saju.solar_terms import JEOL, jeol_of_year, nutation_longitude, sun_apparent_longitude
from services.saju.strength import chart_strength
EXAMPLE = make_chart(date(1995, 3, 14))
@@ -254,6 +255,24 @@ def test_example_chart_climate_and_best_window():
assert moist == {"axis": "moist", "need": "dry", "effect": "dries", "helps": True, "points": moist["points"], "weather": "체감 13°, 습도 40%"}
def test_example_strength_counts_hidden_stems_and_month_branch():
s = chart_strength(EXAMPLE) # 乙亥 己卯 甲辰
assert s.elements == {"木": 58.3, "火": 0.0, "土": 24.3, "金": 0.0, "水": 7.3}
assert s.top == "木" and s.strong and s.support == 0.696
def test_summer_earth_chart_reads_hot_and_dry_not_rainy():
chart = make_chart(date(1959, 7, 16)) # 己亥 辛未 己亥: 未월 토가 많고 물이 둘
climate = chart_climate(chart)
assert climate.season == "여름" and climate.label == "따뜻·마름" and climate.need["temp"] == "cool"
assert climate.strength.top == "土" and climate.strength.strong
def test_month_dries_summer_earth_and_soaks_winter_earth():
assert seasoned("己", "未")[1] < 0 < seasoned("己", "子")[1]
assert seasoned("壬", "未")[0] > seasoned("壬", "子")[0]
def test_balanced_axis_prefers_mild_weather_and_rain_moistens():
assert axis_effect(0.0, 0.0) > axis_effect(0.0, 0.6) and axis_effect(0.0, 0.0) > axis_effect(0.0, -0.6)
assert axis_effect(-0.4, 0.8) > axis_effect(-0.4, 0.0) > axis_effect(-0.4, -0.8)