diff --git a/references/yoga_rules.json b/references/yoga_rules.json index a9784587..3245dca4 100644 --- a/references/yoga_rules.json +++ b/references/yoga_rules.json @@ -12857,7 +12857,7 @@ "category": "special", "logic": { "type": "custom", - "expr": "\nmerc_h = ctx.house_of('Mercury') if 'Mercury' in ctx.planets else None\nif merc_h is None: False\nelse:\n merc_strong = ctx.is_exalted('Mercury') or ctx.is_own_sign('Mercury')\n merc_kt = ctx.is_kendra(merc_h) or ctx.is_trikona(merc_h)\n ben_aspect = any(b in ctx.planets and aspect(b, 'Mercury') for b in ['Jupiter','Venus'])\n merc_strong or (merc_kt and ben_aspect)\n" + "expr": "# PyJHora/BVR-232: Lord of 5th in Rasi should be a benefic and should be in Navamsa Lagna.\n# Lord of Navamsa Lagna should be a benefic or aspected by benefic.\nl5 = lord(5)\nif l5 not in ctx.planets: False\nelse:\n nb = pyjhora_natural_benefics()\n cond1 = l5 in nb # L5 is a natural benefic\n cond2 = d9_house_of(l5) == 1 # L5 in Navamsa Lagna\n d9_l1 = d9_lord_of_house(1)\n cond3a = d9_l1 in nb # D9 Lagna lord is benefic\n cond3b = d9_l1 is not None and any(p in nb and p != l5 and aspect(p, d9_l1) for p in ctx.planets)\n cond1 and cond2 and (cond3a or cond3b)\n" }, "effects": [ "Sharp intellect, penetrating mind, quick understanding" @@ -12865,7 +12865,8 @@ "strength": "moderate", "enabled": true, "draft": false, - "evidence_note": "Source: B.V. Raman, BVR: BVR-230" + "evidence_note": "Source: B.V. Raman, BVR: BVR-230", + "accuracy_note": "v6.0.49: rewritten to match PyJHora BVR-232 (D9-dependent: L5 benefic + in Navamsa Lagna; D9 L1 benefic/aspected)" }, { "id": "bvr_thrikaala_gnana_yoga", diff --git a/scripts/validate_logic_v2.py b/scripts/validate_logic_v2.py index a8bffa94..54432dda 100644 --- a/scripts/validate_logic_v2.py +++ b/scripts/validate_logic_v2.py @@ -286,19 +286,19 @@ def main(): name = chart['name'] planets = chart['planets'] ascendant = chart['ascendant'] - context = chart.get('context') - # Skill 引擎检测 + # 从 standard_test_charts.json 取完整 context(含 D9/Navamsa/Upagraha 数据) + pyj_chart = pyj_charts.get(name) + if not pyj_chart: + print(f" WARNING: {name} not in PyJhora data") + continue + context = pyj_chart.get('context', {}) + # Skill 引擎检测(使用含 D9 的完整 context) skill_results = engine.detect(planets, ascendant, context=context) skill_yoga_ids = set(r['rule_id'] for r in skill_results) skill_comp = skill_yoga_ids & comparable_rule_ids # 只保留可对比的 total_skill_comp += len(skill_comp) - # PyJhora 结果 - pyj_chart = pyj_charts.get(name) - if not pyj_chart: - print(f" WARNING: {name} not in PyJhora data") - continue pyj_yoga_names = set(pyj_chart.get('expected_yogas', [])) # 将 PyJhora Yoga名映射到 Skill rule_id