fix(shadbala): Ayana hemisphere after wrap, civil-weekday hora lord, continuous mean motion, short-arc Chesta midpoint (upstream 0afa2780)

Ported from yinduzhanxing 0afa2780 (algorithm hunks and its four regression
tests; the PyJHora / profile-metadata hunks do not apply to our file). The
archived-PyJHora Kala test follows upstream's rewrite. The V.P. Jain
benchmark expectations still need the three-column update (follow-up in this
branch). TASK-upstream-sync4-20261002 T3.

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 13:55:58 +08:00
co-authored by Claude Opus 5.5
parent 96767418ee
commit 08376cf0a8
6 changed files with 148 additions and 17 deletions
+7 -2
View File
@@ -59,13 +59,18 @@ def test_precise_sthana_bala_matches_pyjhora_same_chart() -> None:
assert calc_sthana_bala_precise(planet, planets, houses[planet])["total"] == expected
def test_precise_kala_bala_matches_pyjhora_same_chart() -> None:
def test_precise_kala_preserves_archived_comparison_with_corrected_hora() -> None:
# 原值: 每颗星 Kala 总分 == 存档 PyJHora 值(test_precise_kala_bala_matches_pyjhora_same_chart)
# 新值: 月亮 +52.18、金星 −60.0,其余仍等于存档值(同上游 yinduzhanxing 0afa2780 的改法)
# 原因: TASK-upstream-sync4-20261002 T3:时主按民用星期查 _HORA_ORDER(周四此时为月亮时),
# Ayana 南北按取模后的回归黄经判断;存档 PyJHora 值只作对照,不作本地公式的标准答案
planets = _planets()
context = build_shadbala_context(2435163.6354166665, 37.7749, -122.4194, "lahiri", -8.0)
assert abs(context["sunrise_hour"] - 6.886306) < 0.00001
assert abs(context["sunset_hour"] - 17.890427) < 0.00001
for planet, expected in PYJHORA_KALA.items():
assert calc_kala_bala_precise(planet, planets, context)["total"] == expected
delta = 52.18 if planet == "Moon" else -60.0 if planet == "Venus" else 0.0
assert abs(calc_kala_bala_precise(planet, planets, context)["total"] - expected - delta) < 0.001
def test_precise_chesta_uses_classical_bounded_variant() -> None: