Release v6.0.47: fix dharidhra FP by replacing bidirectional associated() with one-way aspect() checks
- Root cause: rel_to_any() used associated(p,o) with bidirectional aspects (aspect(p,o) OR aspect(o,p)), but PyJHora only checks one-way (trik lord -> L1, malefic -> L1, maraka -> target) - Fixed v144/v147/v148/v149/v152 to use one-way aspect() checks matching PyJHora source - v144: L7 aspects L1/L12 (one-way) - v147/v148: maraka aspects L1 (one-way) - v149: trik lord aspects L1, malefic aspects L1 (one-way, both were already correct for second part) - v152: maraka aspects malefic in lagna (one-way) - v145/v150/v151 were already correct (used aspect() directly) - Corrected test expectation for chart that genuinely has dharidhra via v149 - Added proper False-no-variant-triggers test case (Cancer asc) - Hardcoded tests: 10/10 passed
This commit is contained in:
@@ -9145,7 +9145,7 @@
|
||||
"category": "durbhaga",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR-144..152 D1-safe Dharidhra variants.\nl1, l2, l5, l6, l7, l8, l11, l12 = [lord(h) for h in [1, 2, 5, 6, 7, 8, 11, 12]]\ndusthana = [6, 8, 12]\ndusthana_lords = [l6, l8, l12]\nmarakas = [l2, l7]\ndef in_chart(p):\n return p in ctx.planets\ndef rel_to_any(p, others):\n return in_chart(p) and any(in_chart(o) and associated(p, o) for o in others)\ndef aspected_by_any(p, others):\n return in_chart(p) and any(in_chart(o) and aspect(o, p) for o in others)\nmethod1 = any(in_chart(p) and house_of(p) in dusthana for p in [l2, l11])\nv144 = in_chart(l1) and in_chart(l12) and house_of(l1) == 12 and house_of(l12) == 1 and (rel_to_any(l1, [l7]) or rel_to_any(l12, [l7]))\nv145 = in_chart(l1) and in_chart(l6) and house_of(l1) == 6 and house_of(l6) == 1 and aspected_by_any('Moon', marakas)\nv146 = house_of('Ketu') == 1 and house_of('Moon') == 1\nv147 = in_chart(l1) and house_of(l1) == 8 and rel_to_any(l1, marakas)\nv148 = in_chart(l1) and house_of(l1) in dusthana and any(same_house(l1, m) for m in MALEFICS if m in ctx.planets and m != l1) and rel_to_any(l1, marakas)\nv149 = rel_to_any(l1, dusthana_lords) and any(aspect(m, l1) for m in MALEFICS if m in ctx.planets and m != l1)\nv150 = in_chart(l5) and any(same_house(l5, tl) for tl in dusthana_lords if in_chart(tl)) and not any((same_house(l5, b) or aspect(b, l5)) for b in BENEFICS if b in ctx.planets)\nv151 = in_chart(l5) and house_of(l5) in [6, 10] and aspected_by_any(l5, [l2, l6, l7, l8, l12])\nv152 = any(m in ctx.planets and house_of(m) == 1 and m not in [lord(9), lord(10)] and rel_to_any(m, marakas) for m in MALEFICS)\nmethod1 or v144 or v145 or v146 or v147 or v148 or v149 or v150 or v151 or v152\n",
|
||||
"expr": "\n# PyJHora/BVR-144..152 D1-safe Dharidhra variants (v6.0.47).\nl1, l2, l5, l6, l7, l8, l11, l12 = [lord(h) for h in [1, 2, 5, 6, 7, 8, 11, 12]]\ndusthana = [6, 8, 12]\ndusthana_lords = [l6, l8, l12]\nmarakas = [l2, l7]\n\ndef in_chart(p):\n return p in ctx.planets\n\ndef maraka_links_to(p):\n return in_chart(p) and any(in_chart(m) and (same_house(p, m) or aspect(m, p)) for m in marakas)\n\nmethod1 = any(in_chart(p) and house_of(p) in dusthana for p in [l2, l11])\n\n# v144: L1<->L12 exchange, L7 conjoined/aspects L1 or L12\nv144_exchange = in_chart(l1) and in_chart(l12) and house_of(l1) == 12 and house_of(l12) == 1\nv144_on_l1 = in_chart(l7) and (same_house(l1, l7) or aspect(l7, l1))\nv144_on_l12 = in_chart(l7) and (same_house(l12, l7) or aspect(l7, l12))\nv144 = v144_exchange and (v144_on_l1 or v144_on_l12)\n\n# v145: L1<->L6 exchange, Moon aspected by L2 or L7\nv145_exchange = in_chart(l1) and in_chart(l6) and house_of(l1) == 6 and house_of(l6) == 1\nv145_moon = 'Moon' in ctx.planets and any(aspect(m, 'Moon') for m in marakas if in_chart(m))\nv145 = v145_exchange and v145_moon\n\n# v146: Ketu and Moon in Lagna\nv146 = house_of('Ketu') == 1 and house_of('Moon') == 1\n\n# v147: L1 in 8th, conjoined/aspected by maraka (one-way)\nv147 = in_chart(l1) and house_of(l1) == 8 and maraka_links_to(l1)\n\n# v148: L1 in dusthana with malefic, conjoined/aspected by maraka\nv148_malefic = any(m in ctx.planets and m != l1 and same_house(l1, m) for m in MALEFICS)\nv148 = in_chart(l1) and house_of(l1) in dusthana and v148_malefic and maraka_links_to(l1)\n\n# v149: L1 associated with trik lord (trik lord aspects L1), L1 aspected by malefic\nv149_assoc = any(in_chart(tl) and (same_house(l1, tl) or aspect(tl, l1)) for tl in dusthana_lords)\nv149_malefic = any(m in ctx.planets and m != l1 and aspect(m, l1) for m in MALEFICS)\nv149 = v149_assoc and v149_malefic\n\n# v150: L5 joins trik lord, no benefic influence\nv150_join = any(in_chart(tl) and same_house(l5, tl) for tl in dusthana_lords)\nv150_no_benefic = not any(b in ctx.planets and (same_house(l5, b) or aspect(b, l5)) for b in BENEFICS)\nv150 = in_chart(l5) and v150_join and v150_no_benefic\n\n# v151: L5 in 6th or 10th, aspected by lords of 2/6/7/8/12\nv151_pos = in_chart(l5) and house_of(l5) in [6, 10]\nv151_aspected = any(in_chart(tl) and (aspect(tl, l5)) for tl in [l2, l6, l7, l8, l12])\nv151 = v151_pos and v151_aspected\n\n# v152: natural malefic (not L9/L10) in Lagna, conjoined/aspected by maraka\nl9 = lord(9)\nl10 = lord(10)\nv152 = any(in_chart(m) and house_of(m) == 1 and m not in [l9, l10] and maraka_links_to(m) for m in MALEFICS)\n\nmethod1 or v144 or v145 or v146 or v147 or v148 or v149 or v150 or v151 or v152\n",
|
||||
"combo_template": "Dharidhra:财帛/收益主落凶宫或Lagna/Maraka/Dusthana组合"
|
||||
},
|
||||
"effects": [
|
||||
@@ -9155,7 +9155,7 @@
|
||||
],
|
||||
"strength": "弱",
|
||||
"enabled": true,
|
||||
"accuracy_note": "高置信:定义来自 PyJHora/B.V. Raman。"
|
||||
"accuracy_note": "v6.0.47: fixed one-way aspect direction to match PyJHora source (replaced bidirectional associated() with one-way aspect() checks)"
|
||||
},
|
||||
{
|
||||
"id": "bvr_sada_sanchara_precise",
|
||||
|
||||
@@ -92,9 +92,10 @@ results.append(check('False-weak-benefic-in-house', 'koorma_yoga', {
|
||||
}, 'Leo', False))
|
||||
|
||||
# -------------------------------------------------------
|
||||
# bvr_dharidhra_11_precise: method1
|
||||
# bvr_dharidhra_11_precise
|
||||
# -------------------------------------------------------
|
||||
print('\n--- bvr_dharidhra_11_precise ---')
|
||||
# True: L2 (Mercury) or L11 in dusthana
|
||||
results.append(check('True-l2-l11-in-dusthana', 'bvr_dharidhra_11_precise', {
|
||||
'Sun':{'house':9,'sign':'Aries','degree':10},'Moon':{'house':5,'sign':'Gemini','degree':15},
|
||||
'Mars':{'house':4,'sign':'Scorpio','degree':10},'Mercury':{'house':8,'sign':'Pisces','degree':10},
|
||||
@@ -103,13 +104,25 @@ results.append(check('True-l2-l11-in-dusthana', 'bvr_dharidhra_11_precise', {
|
||||
'Ketu':{'house':8,'sign':'Pisces','degree':10},
|
||||
}, 'Leo', True))
|
||||
|
||||
results.append(check('False-l2-l11-not-dusthana', 'bvr_dharidhra_11_precise', {
|
||||
# True-v149: L2/L11 not in dusthana, but v149 triggers: L1 (Sun) associated with trik lord
|
||||
# (L6 Saturn aspects Sun from 7th) and malefic Mars aspects L1 from 10th
|
||||
results.append(check('True-v149-assoc-malefic', 'bvr_dharidhra_11_precise', {
|
||||
'Sun':{'house':1,'sign':'Leo','degree':10},'Moon':{'house':5,'sign':'Sagittarius','degree':15},
|
||||
'Mars':{'house':10,'sign':'Taurus','degree':10},'Mercury':{'house':2,'sign':'Virgo','degree':10},
|
||||
'Jupiter':{'house':9,'sign':'Aries','degree':5},'Venus':{'house':11,'sign':'Gemini','degree':10},
|
||||
'Saturn':{'house':7,'sign':'Aquarius','degree':10},'Rahu':{'house':3,'sign':'Libra','degree':10},
|
||||
'Ketu':{'house':9,'sign':'Aries','degree':10},
|
||||
}, 'Leo', False))
|
||||
}, 'Leo', True))
|
||||
|
||||
# False: Cancer asc - no variants trigger. L2(Sun)/L11(Venus) not dusthana,
|
||||
# L1(Moon) not with trik lords, no malefic aspect on Moon
|
||||
results.append(check('False-no-variant-triggers', 'bvr_dharidhra_11_precise', {
|
||||
'Sun':{'house':9,'sign':'Pisces','degree':10},'Moon':{'house':4,'sign':'Libra','degree':15},
|
||||
'Mars':{'house':5,'sign':'Scorpio','degree':10},'Mercury':{'house':8,'sign':'Aquarius','degree':10},
|
||||
'Jupiter':{'house':3,'sign':'Virgo','degree':5},'Venus':{'house':10,'sign':'Aries','degree':10},
|
||||
'Saturn':{'house':11,'sign':'Taurus','degree':10},'Rahu':{'house':8,'sign':'Aquarius','degree':10},
|
||||
'Ketu':{'house':5,'sign':'Scorpio','degree':10},
|
||||
}, 'Cancer', False))
|
||||
|
||||
# Summary
|
||||
ok = sum(1 for r in results if r)
|
||||
|
||||
Reference in New Issue
Block a user