From 03d60e29e6f23a385471cb31c7dadfc100f15c53 Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Sat, 3 Oct 2026 00:17:58 +0800 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE --- tests/test_combustion_orb_tables_agree.py | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/test_combustion_orb_tables_agree.py diff --git a/tests/test_combustion_orb_tables_agree.py b/tests/test_combustion_orb_tables_agree.py new file mode 100644 index 00000000..1a5eb4ca --- /dev/null +++ b/tests/test_combustion_orb_tables_agree.py @@ -0,0 +1,34 @@ +"""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