fix(varga): source D5/D6/D8/D11 from PVR 6.2 (BUG-1260, upstream f32472b5)

This commit is contained in:
jesse-ux
2026-10-07 16:39:01 +08:00
parent 5cc8e50458
commit db68e90816
5 changed files with 91 additions and 41 deletions
+10 -5
View File
@@ -69,10 +69,11 @@ def varga_map(si, pi, div):
if div==2: return (4 if o else 3) if pi==0 else (3 if o else 4)
if div==3: return (si+pi*4)%12 # Drekkana: same → +4 → +8, no odd/even distinction
if div==4: return (si+pi*3)%12
if div==5: return (si+pi)%12 if o else (si+8+pi)%12
if div==6: return (si+pi)%12 if o else (si+6+pi)%12
# PVR Integrated Approach 6.2.5 / 6.2.6 / 6.2.8. D8 start is movable Aries, fixed Sagittarius, dual Leo.
if div==5: return ((0,10,8,2,6) if o else (1,5,11,9,7))[pi]
if div==6: return ((0 if o else 6)+pi)%12
if div==7: return (si+pi)%12 if o else (si+6+pi)%12
if div==8: return (si+pi)%12 if o else (si+8+pi)%12
if div==8: return ((0,8,4)[si%3]+pi)%12
if div==9:
# BPHS Navamsa: movable=same, fixed=9th from sign (+8), dual=5th from sign (+4)
if si%3==0: start=si
@@ -80,7 +81,7 @@ def varga_map(si, pi, div):
else: start=(si+4)%12
return (start+pi)%12
if div==10: return (si+pi)%12 if o else (si+8+pi)%12 # D10: even signs count from 9th inclusively => +8 offset
if div==11: return (si+pi)%12 if o else (si+8+pi)%12 # D11 Rudramsa: mirror extended calculator
if div==11: return (-si+pi)%12 # PVR Integrated Approach 6.2.11: anti-zodiacal seed from Aries, then zodiacal parts
if div==12: return (si+pi)%12
if div==16: return ((0 if o else 4)+pi)%12 # D16: movable=+0, fixed=+4; dual needs separate (2026-05-03 fix: was +1)
if div==20: return ((0 if o else 8)+pi)%12
@@ -323,7 +324,11 @@ def calc_all_vargas(planet_lons, asc_lon, divisions=None, mode='classical_local'
)
vd={'_meta':{'div':div,'name':m.get('name',''),'cn':m.get('cn',''),
'area':m.get('area',''),'part_size':30.0/div,
'mapping_status': mapping_status}}
'mapping_status': mapping_status,
'mapping_source': (
'PVR Integrated Approach sections 6.2.5-6.2.11; D8 movable Aries, fixed Sagittarius, dual Leo'
if div in (5, 6, 8, 11) else mapping_status
)}}
vd['Ascendant']=normalize_varga_ascendant(calc_varga(asc_lon,div,mode=mode))
for pn,lon in planet_lons.items():
vd[pn]=calc_varga(lon,div,mode=mode)