Upstream 30b43643. Yoga Pinda multiplied only the bindu in the planet's own sign. It now uses the Trikona and Ekadhipatya rows, with PVR table 28 including Virgo 6. PVR example 43 is 152. BUG-1384. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
1.9 KiB
Python
45 lines
1.9 KiB
Python
from scripts.ashtakavarga import SEVEN_PLANETS, calc_ashtakavarga, calc_ekadhipatya_shodhana, calc_yoga_pinda
|
||
from scripts.ashtakavarga_shodhana import sodhita_chain
|
||
|
||
|
||
def test_pvr_example_43_full_sums_not_own_sign_shortcut():
|
||
# PVR examples 40–43. This Mercury row is already reduced and stays put.
|
||
bav = {'Mercury': {'bindus': [3, 1, 3, 0, 0, 0, 0, 0, 0, 0, 2, 0]}}
|
||
planets = {name: {'sign': 'Leo'} for name in SEVEN_PLANETS}
|
||
for name in ('Sun', 'Mars', 'Mercury'):
|
||
planets[name] = {'sign': 'Gemini'}
|
||
planets['Venus'] = {'sign': 'Aries'}
|
||
row = calc_yoga_pinda(bav, planets, 0)['planets']['Mercury']
|
||
assert (row['rashi_pinda'], row['graha_pinda'], row['yoga_pinda']) == (77, 75, 152)
|
||
|
||
|
||
def test_virgo_multiplier_and_zero_trine_convention():
|
||
bav = {'Mercury': {'bindus': [0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0]}}
|
||
planets = {name: {'sign': 'Leo'} for name in SEVEN_PLANETS}
|
||
result = calc_yoga_pinda(bav, planets, 0)
|
||
assert result['sodhita_rows']['Mercury'][5] == 2
|
||
assert result['planets']['Mercury']['rashi_pinda'] == 12
|
||
assert result['planets']['Mercury']['graha_pinda'] == 0
|
||
|
||
|
||
def test_missing_planet_does_not_silently_emit_partial_graha_sum():
|
||
result = calc_yoga_pinda({'Sun': {'bindus': [1] * 12}}, {'Sun': {'sign': 'Leo'}}, 0)
|
||
assert result['all_valid'] is False
|
||
assert result['planets'] == {}
|
||
|
||
|
||
def test_raman_rule_15c_equal_pair_removes_only_vacant_value():
|
||
row = [0] * 12
|
||
row[0] = row[7] = 2
|
||
result = calc_ekadhipatya_shodhana({'Moon': row}, {0})['rows']['Moon']
|
||
assert result[0] == 2
|
||
assert result[7] == 0
|
||
|
||
|
||
def test_full_chart_pinda_reuses_the_sodhita_chain():
|
||
planets = {name: {'sign': 'Leo'} for name in SEVEN_PLANETS}
|
||
bav = calc_ashtakavarga(planets, asc_sign_idx=0)['bav']
|
||
pinda = calc_yoga_pinda(bav, planets, 0)
|
||
chain = sodhita_chain(bav, planets)
|
||
assert pinda['sodhita_rows'] == chain['sodhita_bav']
|