Port from yinduzhanxing 5fb8379c (MIT): Naisargika, Kaala, Karaka, Tara, Lagnamsaka, Yogardha, Mandooka, Paryaaya and Padanadhamsa dashas; Sarvatobhadra, Kota and Kalanala chakras; Nakshatra Latta; Pachakadi; Raman Amsayu and Pindayu. Producers and their upstream tests are copied; scripts/upstream_technique_layers.py feeds them our natal and transit positions and attaches chart.consultation_native_layers.upstream_techniques. - dasha_registry: kaala and padanadhamsa keys (35 -> 37); the nine ported dashas are served by compute_dasha or fail closed with upstream's reason. - technique_registry.json: 16 partial entries; README badges follow. - Evidence lookup section `upstream_techniques` in the consultation tool. - Boundaries: Kalanala carries no PyJHora (AGPL) grid coordinates; Padanadhamsa/Lagnamsaka run on our Narayana engine (no Rath Table 12, PVR co-lord variants or second cycle). PyJHora observers and the Amsayu worked-example scaffold live in scripts/research (root .py budget). - PyJHora black-box cross-checks: Naisargika (lords/years) and Kaala (seed segment and fraction within 5e-4) on a public chart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
61 lines
2.6 KiB
Python
61 lines
2.6 KiB
Python
import pytest
|
|
from scripts.padanadhamsa import PROFILE, build_padanadhamsa_report
|
|
from scripts.padanadhamsa import calculate_padanadhamsa_duration
|
|
|
|
|
|
@pytest.mark.parametrize('sign',range(12))
|
|
def test_duration_exceptions_and_inclusive_parity_all_signs(sign):
|
|
def duration(lord):
|
|
return calculate_padanadhamsa_duration(sign_idx=sign,lord_sign_idx=lord,profile=PROFILE)
|
|
assert duration(sign)['years']==12
|
|
assert duration((sign+6)%12)['years']==10
|
|
direction=1 if sign%2==0 else -1
|
|
r=duration((sign+direction)%12)
|
|
assert r['years']==2
|
|
assert r['inclusive_count']==2
|
|
assert r['exception']=='none'
|
|
|
|
|
|
@pytest.mark.parametrize('value',[True,-1,12,1.5,'2'])
|
|
def test_single_duration_rejects_invalid_signs(value):
|
|
with pytest.raises(ValueError):
|
|
calculate_padanadhamsa_duration(sign_idx=value,lord_sign_idx=0,profile=PROFILE)
|
|
|
|
|
|
def request():
|
|
# Article's Jaimini Navamsa narrative/chart placements, not printed D1 longitudes.
|
|
return dict(arudha_lagna_sign_idx=0,
|
|
jaimini_navamsa_signs=dict(Sun=2,Moon=8,Mars=4,Mercury=0,Jupiter=5,Venus=6,Saturn=9),
|
|
navamsa_profile='supplied_rangacharya_jaimini_navamsa',profile=PROFILE)
|
|
|
|
|
|
def test_published_indira_table_conflict_is_not_silently_fitted():
|
|
r=build_padanadhamsa_report(**request()); e=r['exports']['ai_evidence_bundle']
|
|
assert e['seed_sign_idx']==4
|
|
assert [x['sign_idx'] for x in e['periods']]==[4,9,2,7,0,5,10,3,8,1,6,11]
|
|
published=[11,12,11,10,5,6,12,8,10,8,12,10]
|
|
calculated=[x['years'] for x in e['periods']]
|
|
assert calculated==[11,12,11,4,5,6,12,8,10,8,12,10]
|
|
assert [i for i,(a,b) in enumerate(zip(calculated,published)) if a!=b]==[3]
|
|
assert e['periods'][4]['start_age_years']==38
|
|
assert e['periods'][-1]['end_age_years']==109
|
|
assert not r['customer_export_admitted']
|
|
r['evidence_appendix'][0]['periods'].clear()
|
|
assert len(e['periods'])==12
|
|
|
|
|
|
def test_even_fixed_and_movable_orders():
|
|
p=request(); p['jaimini_navamsa_signs']['Mars']=1
|
|
rows=build_padanadhamsa_report(**p)['exports']['ai_evidence_bundle']['periods']
|
|
assert [r['sign_idx'] for r in rows]==[1,8,3,10,5,0,7,2,9,4,11,6]
|
|
p['jaimini_navamsa_signs']['Mars']=3
|
|
rows=build_padanadhamsa_report(**p)['exports']['ai_evidence_bundle']['periods']
|
|
assert [r['sign_idx'] for r in rows]==[3,2,1,0,11,10,9,8,7,6,5,4]
|
|
|
|
|
|
def test_no_implicit_standard_d9_or_dual_seed():
|
|
p=request(); p['navamsa_profile']='parasara'
|
|
with pytest.raises(ValueError): build_padanadhamsa_report(**p)
|
|
p=request(); p['jaimini_navamsa_signs']['Mars']=2
|
|
with pytest.raises(ValueError,match='dual-sign'): build_padanadhamsa_report(**p)
|