From 39468f126c3e17fbfc530f9e51285b0f1210a4cf Mon Sep 17 00:00:00 2001 From: jesse-ux Date: Fri, 23 Oct 2026 10:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E6=98=9F=E8=A7=A3=E9=87=8A=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E5=85=AD=E7=BB=B4=E5=8A=9B=E9=87=8F=E5=90=88=E8=AE=A1?= =?UTF-8?q?=E6=94=B9=E8=AF=BB=E5=B7=B2=E7=BB=8F=E7=AE=97=E5=87=BA=E7=9A=84?= =?UTF-8?q?=20rupa=20=E6=80=BB=E5=88=86=E3=80=82=E6=9C=89=E6=80=BB?= =?UTF-8?q?=E5=88=86=E6=97=B6=E4=B8=8D=E5=86=8D=E5=86=99=E6=88=90=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=88=97=E5=87=BA=E3=80=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Grok (agent loop) --- CHANGELOG.md | 5 +++++ scripts/pl9_interpretation_packs.py | 6 +++++- tests/test_graha_total_rupas.py | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/test_graha_total_rupas.py 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