fix(shadbala): Sun minimum requirement is 6.5 rupas per BPHS ch. 27 sl. 32-33 (BUG-1189, F3)

BPHS ch. 27 (Evaluation of Strengths) sl. 32-33 gives 390, 360, 300, 420, 390,
330 and 300 virupas for Sun..Saturn; the Sun was 5.0. MIN_REQUIRED in
scripts/shadbala.py is the only requirement table in our code (the 5.0 default
in .get() is for unknown bodies; vendored jyotishganit / dashaflow tables
already say 6.5). Upstream yinduzhanxing 0a6696c5 still has 5.0 (to notify).
Product decision 2026-10-02 (added to TASK-upstream-sync4-20261002).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
Jesse_Chen
2026-10-02 14:06:23 +08:00
co-authored by Claude Opus 5.5
parent db55aef191
commit 09c0efc2a1
2 changed files with 30 additions and 2 deletions
+5 -2
View File
@@ -98,9 +98,12 @@ NAISARGIKA_BALA = {
'Jupiter': 34.29, 'Mercury': 25.71, 'Mars': 17.14, 'Saturn': 8.57
}
# Shadbala 最低要求(Rupas)
# Shadbala 最低要求(Rupas)。BPHS 第 27 章(Evaluation of Strengths)第 32–33 颂:
# 「390, 360, 300, 420, 390, 330 and 300 Virupas are the Shad Bal Pindas, needed for
# Sūrya etc. to be considered strong」,即日月火水木金土 6.5/6/5/7/6.5/5.5/5 Rupa。
# 太阳原写 5.0(BUG-1189,清单 F3);上游 yinduzhanxing 0a6696c5 仍是 5.0。
MIN_REQUIRED = {
'Sun': 5.0, 'Moon': 6.0, 'Mars': 5.0,
'Sun': 6.5, 'Moon': 6.0, 'Mars': 5.0,
'Mercury': 7.0, 'Jupiter': 6.5, 'Venus': 5.5, 'Saturn': 5.0
}
+25
View File
@@ -0,0 +1,25 @@
"""BUG-1189 (清单 F3): Shadbala minimum requirements follow BPHS ch. 27 sl. 32-33.
"390, 360, 300, 420, 390, 330 and 300 Virupas are the Shad Bal Pindas, needed
for Surya etc. to be considered strong" -> 60 virupas per rupa.
"""
from __future__ import annotations
from scripts.shadbala import MIN_REQUIRED, VIRUPAS_PER_RUPA, calc_shadbala
from tests.test_shadbala_precise_context import _planets
BPHS_VIRUPAS = {"Sun": 390, "Moon": 360, "Mars": 300, "Mercury": 420, "Jupiter": 390, "Venus": 330, "Saturn": 300}
def test_minimum_table_matches_bphs() -> None:
# 原值: Sun 5.0;新值: 6.5;其余六星不变
assert MIN_REQUIRED == {planet: value / VIRUPAS_PER_RUPA for planet, value in BPHS_VIRUPAS.items()}
def test_sun_ishta_percentage_uses_six_and_a_half_rupas() -> None:
planets = _planets()
result = calc_shadbala(planets, "Aries", 12.0, planets["Sun"]["degree"], planets["Moon"]["degree"])
sun = result["planets"]["Sun"]
assert sun["min_required"] == 6.5
assert abs(sun["ishta_bala_pct"] - round(sun["total_rupas"] / 6.5 * 100, 1)) <= 0.1