diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1a9b3a..25a88868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 印度占星 Skill 更新日志 +## 2026-10-23 — 行星解释的六维力量合计改读已算出的总分 + +- 六维力量合计改读已算出的 rupa 总分。有总分时不再写成「未列出」。Saturn / KP 的结果段和整段补到上游篇幅,这一版先不做。 +- Skill 版本不变。 + ## 2026-10-23 — 完整数据版补上三年逐月星历 - 从报告日期所在月起 36 个月,报告口径和 KP 岁差口径各有一张九星表,另有五级大运的月采样。黄经走本系统恒星计算,不用视位置。 diff --git a/scripts/pl9_interpretation_packs.py b/scripts/pl9_interpretation_packs.py index f20268aa..700245d6 100644 --- a/scripts/pl9_interpretation_packs.py +++ b/scripts/pl9_interpretation_packs.py @@ -797,7 +797,11 @@ def build_graha_interpretation_pack( if language == "en" and re.search(r"[\u4e00-\u9fff]", str(sign or "")): sign = "not listed separately" strength = _dict(_dict(strength_snapshot.get("planets")).get(planet)) - total = strength.get("total") or strength.get("total_shadbala") + total = strength.get("total") + if total is None: + total = strength.get("total_shadbala") + if total is None: + total = strength.get("total_rupas") active_text = planet in active if language == "zh": sections = { diff --git a/tests/test_graha_total_rupas.py b/tests/test_graha_total_rupas.py new file mode 100644 index 00000000..be0bbabe --- /dev/null +++ b/tests/test_graha_total_rupas.py @@ -0,0 +1,19 @@ +"""Shadbala prose reads the rupa total that the chart already calculated.""" + +from __future__ import annotations + +from scripts.pl9_interpretation_packs import build_graha_interpretation_pack + + +def test_shadbala_total_rupas_is_not_left_unlisted() -> None: + pack = build_graha_interpretation_pack( + {"Sun": {"house": 1, "sign": "Aries", "nakshatra": "Ashwini", "status": "Exalted"}}, + {"Sun": [5]}, + {"Sun": "functional_benefic"}, + set(), + strength_snapshot={"planets": {"Sun": {"total_rupas": 7.25}}}, + language="zh", + ) + text = pack["planet_pages"][0]["sections"]["strength_and_context"] + assert "7.25" in text + assert "未列出" not in text