Files
Jyotisha/tests/test_combustion_orb_tables_agree.py
T
Jesse_ChenandClaude Opus 5.5 03d60e29e6 test: lock the two combustion orb tables together (U3 follow-up, BUG-1195)
pancha_mahapurusha keeps its own copy of the direct / retrograde orb table
(upstream eaf6918b shape); the test pins it equal to jyotish_engine
COMBUSTION_ORBS and exercises both helpers at every orb edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
2026-10-03 00:17:58 +08:00

35 lines
1.4 KiB
Python

"""U3 (upstream 080c286c / eaf6918b): one combustion orb table across the engine.
`pancha_mahapurusha` keeps its own copy (upstream shape); it must stay equal to
the shared `jyotish_engine.COMBUSTION_ORBS` so the full reading, the
consultation graha drishti layer and Pancha Mahapurusha never disagree.
"""
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'scripts'))
import jyotish_engine # noqa: E402
import pancha_mahapurusha # noqa: E402
def test_pancha_combustion_table_equals_engine_table() -> None:
assert pancha_mahapurusha.COMBUSTION_ORB == jyotish_engine.COMBUSTION_ORBS
def test_retrograde_orbs_are_used_by_both_helpers() -> None:
sun = 100.0
for planet, profile in jyotish_engine.COMBUSTION_ORBS.items():
for retrograde, key in ((False, 'direct'), (True, 'retrograde')):
orb = profile[key]
inside = sun + orb - 0.01
outside = sun + orb + 0.01
assert jyotish_engine.is_combust(planet, inside, sun, retrograde) is True
assert jyotish_engine.is_combust(planet, outside, sun, retrograde) is False
assert pancha_mahapurusha._is_combust(planet, inside, sun, retrograde) is True
assert pancha_mahapurusha._is_combust(planet, outside, sun, retrograde) is False
assert jyotish_engine.is_combust('Sun', sun, sun) is False
assert jyotish_engine.combustion_threshold('Rahu') is None