fix: align yoga source rules
This commit is contained in:
@@ -1,5 +1,59 @@
|
||||
# 印度占星 Skill 更新日志
|
||||
|
||||
## v6.0.38(2026-06-05)—— Yoga 源码口径对齐与 F1 深水区提升
|
||||
|
||||
> **目标**:继续 v6.0.37 的 context-aware 路线,但不盲目扩规则;优先对齐 PyJHora 源码中已经明确的 house-strength、Navamsa dispositor、watery sign/planet、以及验证脚本路径口径,减少残余 Top FP/FN。
|
||||
|
||||
### 引擎与 helper 修复
|
||||
|
||||
- `scripts/yoga_engine.py` 新增 `HOUSE_STRENGTHS` 与 `PLANET_INDEX`,显式复刻 PyJHora `const.house_strengths_of_planets`,避免 `strong()` 继续用“落 Kendra/Trikona 即强”的过宽近似。
|
||||
- custom 沙箱新增:
|
||||
- `house_strength(p)`:返回 PyJHora 式星座强度 0-5。
|
||||
- `strong(p, include_neutral=False)`:默认 strength >= FRIEND;可选 include neutral。
|
||||
- `weak(p)`:strength <= NEUTRAL。
|
||||
- 修复 `bvr_dehasthoulya_yoga` 内置条件:
|
||||
- 114 改为“Lagna lord 的 Navamsa dispositor 在 Rasi 中落水象星座”,而不是误取 D9 上升主。
|
||||
- 116 改为“Lagna lord 是 watery planet(Moon/Venus)”,而不是“Lagna lord 落水象星座”。
|
||||
|
||||
### 高影响规则对齐
|
||||
|
||||
- `sankha_yoga`:改用 PyJHora house-strength 口径判断 L1/L9 强弱,Top FP 从 12 收窄到 5。
|
||||
- `kahala_yoga`:对齐 PyJHora BVR-15:L1 落 Kendra/Trikona,且 L4/L9 互为 Kendra。
|
||||
- `bvr_kaahala_yoga`:对齐 PyJHora `kaahala_yoga` 的有效 D1 判定:L4 与 Jupiter 互为 Kendra。
|
||||
- `bvr_rogagrastha_precise`:对齐 PyJHora 条件 b 的实际行为:Lagna lord strength <= neutral 即可触发(源码中的 quad/trine lord 列表包含 L1 自身)。该规则本轮从 Top FN 中消失。
|
||||
- `bvr_swaveeryaddhana_precise`:补入 PyJHora 131 的 Navamsa dispositor chain D9-safe 条件。
|
||||
- `bvr_bahu_puthra_precise`:修正 221 语义为“7宫主所落 Navamsa 的 lord 落 Rasi 1/2/5”,不再错误扩大成“任意与7宫主 associated 的行星”。Top FP 从 15 清零。
|
||||
|
||||
### 验证脚本修复
|
||||
|
||||
- `scripts/validate_logic_v2.py` 固定读取/写入 `SKILL_DIR/references/*`,避免从工作区根目录运行时误读另一份 `references/` 并写出错误报告。
|
||||
|
||||
### 验证结果
|
||||
|
||||
- `scripts/validate_logic_v2.py`:
|
||||
- Precision **88.37%**(v6.0.37 为 85.60%;实际 v6.0.38 旧路径校正基线为 84.25%)
|
||||
- Recall **81.09%**(v6.0.37 为 72.38%;旧路径校正基线为 75.66%)
|
||||
- F1 **84.57%**(v6.0.37 为 78.44%;旧路径校正基线为 79.72%)
|
||||
- FP:114;FN:202
|
||||
- `scripts/run_quality_gate.py --skip-yoga-logic`:通过。
|
||||
- pytest **35 passed**
|
||||
- BPHS/Ashtakavarga 不变量 **18/18**
|
||||
- golden case 通过
|
||||
|
||||
### 规则库状态
|
||||
|
||||
- JSON 规则总数:**475**
|
||||
- 启用规则:**381**
|
||||
- 当前验证报告:`references/validation_logic_report.json`
|
||||
|
||||
### 后续优化点
|
||||
|
||||
- 下一轮 Top FN 重点:`bvr_kaalanirdesat_puthranaasa_yoga`、`bvr_matrunasa_precise`、`bvr_kapata_yoga`、`bvr_vanchana_chora_bheethi_yoga`。
|
||||
- 下一轮 Top FP 重点:`mridanga_yoga`、`bvr_bandhu_pujya_yoga`、`bvr_002_sunapha_precise`、`bvr_bahu_sthree_yoga`、`bvr_bhratruvriddhi_precise`。
|
||||
- 建议继续对齐 PyJHora 的 dynamic benefics/malefics、`planets_aspecting_the_raasi()` 与 Upagraha house-index 口径。
|
||||
|
||||
---
|
||||
|
||||
## v6.0.37(2026-06-05)—— Context-aware Yoga 精度提升
|
||||
|
||||
> **目标**:利用 v6.0.36 已接入的 D9/Navamsa、Panchanga、Gulika/Maandi 上下文,继续修复 PyJHora/B.V. Raman 高影响 Yoga 误差,而不是回退到 D1-only 近似。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: jyotish-vedic-astrology
|
||||
version: 6.0.37
|
||||
version: 6.0.38
|
||||
description: 印度占星(Jyotish)专业解盘与推运系统。核心能力:PDF星盘输入→严谨解盘→精确推运应期输出。触发词:印度占星、吠陀占星、Jyotish、解盘、推运、星盘分析、Dasha、Transit、Nakshatra、Yoga、出生时间矫正、PDF星盘、读取PDF、分析PDF星盘、现代解读、误判纠错、Varga分盘、综合分析、过境分析、合盘、婚姻匹配、年运盘、Prashna、Argala、Jaimini、Shadbala、Ashtakavarga、HTML报告、深度解盘。
|
||||
---
|
||||
|
||||
@@ -10,7 +10,7 @@ description: 印度占星(Jyotish)专业解盘与推运系统。核心能力
|
||||
> **严格路由**:`references/strict-workflow-router.md`(⭐涉及事业/婚恋/财务/应期/技法验证时必须优先读取)
|
||||
> **覆盖矩阵**:`references/technique-capability-matrix.md`(⭐判断技法 covered/partial/missing 时必须参考)
|
||||
> **机器注册表**:`references/technique_registry.json` + `scripts/audit_capabilities.py`(⭐用于自动审计与CI门禁)
|
||||
> **版本**:v6.0.37-context-aware-yoga-precision | **详细变更**:`CHANGELOG.md`
|
||||
> **版本**:v6.0.38-yoga-source-alignment | **详细变更**:`CHANGELOG.md`
|
||||
|
||||
---
|
||||
|
||||
@@ -301,9 +301,9 @@ $PYTHON $SCRIPT <子命令> [参数]
|
||||
|
||||
---
|
||||
|
||||
**版本**:v6.0.37-context-aware-yoga-precision
|
||||
**版本**:v6.0.38-yoga-source-alignment
|
||||
**创建日期**:2026-04-20
|
||||
**最后更新**:2026-06-05(v6.0.37 基于 D9/Panchanga/Gulika/Maandi context 修复高影响 Yoga,拆分 PyJHora `kaahala_yoga` 与 `kahala_yoga`,新增 Kapata 高置信规则并修正多个 B.V. Raman 条件;当前 475 条 JSON 规则、381 条启用规则,D1/Rasi 逻辑验证 F1=78.44%,报告以 `references/validation_logic_report.json` 为准)
|
||||
**最后更新**:2026-06-05(v6.0.38 对齐 PyJHora house-strength 口径,修复 `sankha_yoga`、`kahala_yoga`、`bvr_kaahala_yoga`、`bvr_rogagrastha_precise`、`bvr_swaveeryaddhana_precise`、`bvr_bahu_puthra_precise`、`bvr_dehasthoulya_yoga` 等残余高影响规则,并固定 `validate_logic_v2.py` 从任意 cwd 运行都读写 skill 内部 references;当前 475 条 JSON 规则、381 条启用规则,D1/Rasi 逻辑验证 Precision=88.37%、Recall=81.09%、F1=84.57%,报告以 `references/validation_logic_report.json` 为准)
|
||||
|
||||
---
|
||||
|
||||
|
||||
+643
-1750
File diff suppressed because it is too large
Load Diff
@@ -1256,7 +1256,7 @@
|
||||
"category": "auspicious",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR-15: L4 and L9 in mutual kendras, and L1 strong.\nl1 = lord(1)\nl4 = lord(4)\nl9 = lord(9)\nif l1 not in ctx.planets or l4 not in ctx.planets or l9 not in ctx.planets:\n False\nelse:\n l1_strong = strong(l1)\n mutual_kendra = offset(house_of(l4), house_of(l9)) in [0, 3, 6, 9]\n l1_strong and mutual_kendra\n",
|
||||
"expr": "\n# PyJHora/BVR-15: L4 and L9 in mutual kendras, and L1 is in a kendra/trine from Lagna.\nl1 = lord(1)\nl4 = lord(4)\nl9 = lord(9)\nif l1 not in ctx.planets or l4 not in ctx.planets or l9 not in ctx.planets:\n False\nelse:\n l1_strong = house_of(l1) in [1, 4, 5, 7, 9, 10]\n mutual_kendra = offset(house_of(l4), house_of(l9)) in [0, 3, 6, 9]\n l1_strong and mutual_kendra\n",
|
||||
"combo_template": "上升主有力,4宫主与9宫主互为Kendra"
|
||||
},
|
||||
"effects": [
|
||||
@@ -1278,7 +1278,7 @@
|
||||
"category": "auspicious",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR-12: (L1 strong and L5/L6 in mutual kendras) OR\n# (L1 and L10 together in a movable sign and L9 strong).\nl1, l5, l6, l9, l10 = [lord(h) for h in [1, 5, 6, 9, 10]]\nif not all(p in ctx.planets for p in [l1, l5, l6, l9, l10]):\n False\nelse:\n l1h, l5h, l6h, l9h, l10h = [house_of(p) for p in [l1, l5, l6, l9, l10]]\n cond1 = strong(l1) and offset(l5h, l6h) in [0, 3, 6, 9] and offset(l6h, l5h) in [0, 3, 6, 9]\n cond2 = strong(l9) and same_house(l1, l10) and movable_house(l1h)\n cond1 or cond2\n",
|
||||
"expr": "\n# PyJHora/BVR-12: (L1 strong and L5/L6 in mutual kendras) OR\n# (L1 and L10 together in a movable sign and L9 strong). PyJHora strong() uses\n# house_strength >= FRIEND, not generic kendra/trikona strength.\nl1, l5, l6, l9, l10 = [lord(h) for h in [1, 5, 6, 9, 10]]\nif not all(p in ctx.planets for p in [l1, l5, l6, l9, l10]):\n False\nelse:\n l1h, l5h, l6h, l9h, l10h = [house_of(p) for p in [l1, l5, l6, l9, l10]]\n cond1 = strong(l1) and offset(l5h, l6h) in [0, 3, 6, 9] and offset(l6h, l5h) in [0, 3, 6, 9]\n cond2 = strong(l9) and house_of(l1) == house_of(l10) and movable_house(l1h)\n cond1 or cond2\n",
|
||||
"combo_template": "上升主强且5/6宫主互为Kendra,或1/10宫主合于变动星座且9宫主强"
|
||||
},
|
||||
"effects": [
|
||||
@@ -9081,7 +9081,7 @@
|
||||
"category": "health",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora BVR-11: (a) Lagna lord in Lagna joined by dusthana lord;\n# (b) weak Lagna lord joined by any kendra/trine lord.\nasc_lord = lord(1)\ndusthana_lords = [lord(h) for h in [6, 8, 12]]\nquad_trine_lords = [lord(h) for h in [1, 4, 5, 7, 9, 10]]\nif asc_lord not in ctx.planets:\n False\nelse:\n condition_a = house_of(asc_lord) == 1 and any(dl in ctx.planets and same_house(asc_lord, dl) for dl in dusthana_lords)\n weak_by_sign = not (exalted(asc_lord) or own(asc_lord) or moola(asc_lord))\n condition_b = weak_by_sign and any(qtl in ctx.planets and same_house(asc_lord, qtl) for qtl in quad_trine_lords)\n condition_a or condition_b\n",
|
||||
"expr": "\n# PyJHora BVR-11: (a) Lagna lord in Lagna joined by dusthana lord;\n# (b) Lagna lord has house strength <= neutral. PyJHora's quad/trine lord\n# conjunction check includes the Lagna lord itself, so weak LL alone satisfies condition_b.\nasc_lord = lord(1)\ndusthana_lords = [lord(h) for h in [6, 8, 12]]\nif asc_lord not in ctx.planets:\n False\nelse:\n condition_a = house_of(asc_lord) == 1 and any(dl in ctx.planets and same_house(asc_lord, dl) for dl in dusthana_lords)\n condition_b = weak(asc_lord)\n condition_a or condition_b\n",
|
||||
"combo_template": "上升主在Lagna合凶宫主,或弱上升主合角/三方主"
|
||||
},
|
||||
"effects": [
|
||||
@@ -9236,7 +9236,7 @@
|
||||
"category": "dhana",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR-132 D1-safe portion: 2nd lord in Kendra/Trine from Lagna lord,\n# or 2nd lord as benefic in exaltation / joined with an exalted planet.\nasc_lord = lord(1)\nlord_2 = lord(2)\nif asc_lord not in ctx.planets or lord_2 not in ctx.planets:\n False\nelse:\n rel_good = offset(house_of(asc_lord), house_of(lord_2)) in [0, 3, 4, 6, 8, 9]\n lord2_benefic = lord_2 in BENEFICS\n with_exalted = any(p != lord_2 and same_house(p, lord_2) and exalted(p) for p in ctx.planets)\n rel_good or (lord2_benefic and (exalted(lord_2) or with_exalted))\n",
|
||||
"expr": "\n# PyJHora/BVR-132 D1/D9-safe portions: 2nd lord in Kendra/Trine from Lagna lord;\n# or 2nd lord as benefic in exaltation / joined with an exalted planet;\n# or Navamsa-dispositor chain strength >= friend and related to 2nd lord.\nasc_lord = lord(1)\nlord_2 = lord(2)\nif asc_lord not in ctx.planets or lord_2 not in ctx.planets:\n False\nelse:\n l1h = house_of(asc_lord)\n l2h = house_of(lord_2)\n rel_good = offset(l1h, l2h) in [0, 3, 4, 6, 8, 9]\n lord2_benefic = lord_2 in BENEFICS\n with_exalted = any(p != lord_2 and same_house(p, lord_2) and exalted(p) for p in ctx.planets)\n nav_lord = navamsa_dispositor(asc_lord)\n final_disp = SIGN_LORDS.get(sign_of(nav_lord)) if nav_lord in ctx.planets else None\n chain_good = bool(final_disp in ctx.planets and house_strength(final_disp) is not None and house_strength(final_disp) >= 3 and (offset(l2h, house_of(final_disp)) in [0, 3, 4, 6, 8, 9] or house_strength(final_disp) >= 4))\n rel_good or (lord2_benefic and (exalted(lord_2) or with_exalted)) or chain_good\n",
|
||||
"combo_template": "2宫主与上升主成Kendra/Trine关系或2宫主吉且强"
|
||||
},
|
||||
"effects": [
|
||||
@@ -9343,7 +9343,7 @@
|
||||
"category": "putra",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora/BVR 220-221 Bahu Puthra Yoga.\n# 220: Rahu in 5th and Rahu is not in Saturn navamsa.\ny220 = house_of('Rahu') == 5 and d9_sign_of('Rahu') not in {'Capricorn', 'Aquarius'}\n# 221: lord of Navamsa occupied by a planet associated with 7th lord is in 1st/2nd/5th in Rasi.\nl7 = lord(7)\ny221 = False\nif l7 in ctx.planets:\n associated_planets = [p for p in ctx.planets if p != l7 and associated(p, l7)]\n for p in associated_planets:\n disp = navamsa_dispositor(p)\n if disp in ctx.planets and house_of(disp) in [1, 2, 5]:\n y221 = True\n break\ny220 or y221\n",
|
||||
"expr": "\n# PyJHora/BVR 220-221 Bahu Puthra Yoga.\n# 220: Rahu in 5th and Rahu is not in Saturn navamsa.\ny220 = house_of('Rahu') == 5 and d9_sign_of('Rahu') not in {'Capricorn', 'Aquarius'}\n# 221: lord of the Navamsa occupied by the 7th lord is in 1st/2nd/5th in Rasi.\nl7 = lord(7)\ny221 = False\nif l7 in ctx.planets:\n disp = navamsa_dispositor(l7)\n y221 = disp in ctx.planets and house_of(disp) in [1, 2, 5]\ny220 or y221\n",
|
||||
"combo_template": "Rahu在5且非土星Navamsa,或7宫主关联行星的Navamsa主落1/2/5"
|
||||
},
|
||||
"effects": [
|
||||
@@ -13775,7 +13775,7 @@
|
||||
"category": "auspicious",
|
||||
"logic": {
|
||||
"type": "custom",
|
||||
"expr": "\n# PyJHora kaahala_yoga: 4th lord and Jupiter in mutual quadrants; Lagna lord strong.\nl1 = lord(1)\nl4 = lord(4)\nif l1 not in ctx.planets or l4 not in ctx.planets or 'Jupiter' not in ctx.planets:\n False\nelse:\n l1_strong = strong(l1)\n mutual_kendra = offset(house_of(l4), house_of('Jupiter')) in [0, 3, 6, 9]\n l1_strong and mutual_kendra\n",
|
||||
"expr": "\n# PyJHora kaahala_yoga: 4th lord and Jupiter in mutual quadrants.\n# Note: PyJHora calls is_planet_strong(lagna_lord, asc_house, include_neutral=True);\n# for a Lagna lord in its own ascendant sign this is always >= neutral, so the\n# effective D1 comparison condition is the mutual-kendra relationship.\nl4 = lord(4)\nif l4 not in ctx.planets or 'Jupiter' not in ctx.planets:\n False\nelse:\n offset(house_of(l4), house_of('Jupiter')) in [0, 3, 6, 9]\n",
|
||||
"combo_template": "4宫主与木星互为Kendra,且上升主有力"
|
||||
},
|
||||
"effects": [
|
||||
|
||||
@@ -231,12 +231,15 @@ def canonical_rule_id(rule_id, valid_rule_ids):
|
||||
|
||||
|
||||
def main():
|
||||
# 1. 加载位置数据
|
||||
with open('references/planet_positions_60.json') as f:
|
||||
# 1. 加载位置数据。固定使用 skill 内部 references,避免从其他 cwd 运行时读写错目录。
|
||||
planet_positions_path = os.path.join(SKILL_DIR, 'references', 'planet_positions_60.json')
|
||||
standard_charts_path = os.path.join(SKILL_DIR, 'references', 'standard_test_charts.json')
|
||||
report_path = os.path.join(SKILL_DIR, 'references', 'validation_logic_report.json')
|
||||
with open(planet_positions_path) as f:
|
||||
pos_data = json.load(f)
|
||||
|
||||
# 2. 加载 PyJhora Yoga 结果
|
||||
with open('references/standard_test_charts.json') as f:
|
||||
with open(standard_charts_path) as f:
|
||||
pyj_data = json.load(f)
|
||||
|
||||
# 构建 name -> pyjhora yoga list 映射
|
||||
@@ -401,9 +404,9 @@ def main():
|
||||
"false_positives": fp_details,
|
||||
"false_negatives": fn_details,
|
||||
}
|
||||
with open('references/validation_logic_report.json', 'w') as f:
|
||||
with open(report_path, 'w') as f:
|
||||
json.dump(report, f, indent=2, ensure_ascii=False)
|
||||
print("详细报告已保存至: references/validation_logic_report.json")
|
||||
print(f"详细报告已保存至: {report_path}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+39
-8
@@ -46,6 +46,20 @@ BENEFICS = ['Jupiter', 'Venus', 'Mercury', 'Moon']
|
||||
MALEFICS = ['Mars', 'Saturn', 'Sun', 'Rahu', 'Ketu']
|
||||
MOVABLE_SIGNS = ['Aries', 'Cancer', 'Libra', 'Capricorn']
|
||||
ALL_PLANETS = ['Sun', 'Moon', 'Mars', 'Mercury', 'Jupiter', 'Venus', 'Saturn', 'Rahu', 'Ketu']
|
||||
PLANET_INDEX = {planet: idx for idx, planet in enumerate(ALL_PLANETS)}
|
||||
# PyJHora const.house_strengths_of_planets, copied to make Yoga rule alignment deterministic.
|
||||
# Strength scale: 5 own/lord, 4 exalted, 3 friend, 2 neutral, 1 enemy, 0 debilitated.
|
||||
HOUSE_STRENGTHS = {
|
||||
'Sun': [4, 1, 2, 2, 5, 2, 0, 3, 3, 1, 1, 3],
|
||||
'Moon': [2, 4, 3, 5, 3, 3, 2, 0, 2, 2, 2, 2],
|
||||
'Mars': [5, 2, 1, 0, 3, 1, 2, 5, 3, 4, 2, 3],
|
||||
'Mercury': [2, 3, 5, 1, 3, 5, 3, 2, 2, 2, 2, 0],
|
||||
'Jupiter': [3, 1, 1, 4, 3, 3, 1, 3, 5, 0, 2, 5],
|
||||
'Venus': [2, 5, 3, 1, 1, 0, 5, 2, 3, 3, 3, 4],
|
||||
'Saturn': [0, 3, 3, 1, 1, 3, 4, 1, 2, 5, 5, 2],
|
||||
'Rahu': [1, 4, 4, 1, 1, 3, 3, 0, 0, 3, 1, 3],
|
||||
'Ketu': [1, 0, 0, 1, 1, 3, 3, 4, 4, 3, 1, 3],
|
||||
}
|
||||
|
||||
|
||||
def _get_dignity_level(planet: str, sign: str) -> str:
|
||||
@@ -948,11 +962,25 @@ class YogaEngine:
|
||||
return False
|
||||
return h == ctx.house_of(p) or offset(ctx.house_of(p), h) in (6, 3 if p == 'Mars' else -1, 7 if p == 'Mars' else -1, 4 if p == 'Jupiter' else -1, 8 if p == 'Jupiter' else -1, 2 if p == 'Saturn' else -1, 9 if p == 'Saturn' else -1)
|
||||
|
||||
def strong(p):
|
||||
if p not in ctx.planets:
|
||||
def sign_index_of_planet(p):
|
||||
sign_name = ctx.sign_of(p)
|
||||
return SIGNS.index(sign_name) if sign_name in SIGNS else None
|
||||
|
||||
def house_strength(p):
|
||||
sign_idx = sign_index_of_planet(p)
|
||||
if sign_idx is None or p not in HOUSE_STRENGTHS:
|
||||
return None
|
||||
return HOUSE_STRENGTHS[p][sign_idx]
|
||||
|
||||
def strong(p, include_neutral=False):
|
||||
strength = house_strength(p)
|
||||
if strength is None:
|
||||
return False
|
||||
h = ctx.house_of(p)
|
||||
return bool(exalted(p) or own(p) or moola(p) or kendra(h) or trikona(h))
|
||||
return strength >= (2 if include_neutral else 3)
|
||||
|
||||
def weak(p):
|
||||
strength = house_strength(p)
|
||||
return strength is not None and strength <= 2
|
||||
|
||||
def associated(a, b):
|
||||
return a in ctx.planets and b in ctx.planets and (same_house(a, b) or aspect(a, b) or aspect(b, a))
|
||||
@@ -1035,6 +1063,7 @@ class YogaEngine:
|
||||
"SIGNS": SIGNS, "SIGN_LORDS": SIGN_LORDS,
|
||||
"EXALTATION": EXALTATION, "DEBILITATION": DEBILITATION,
|
||||
"PLANET_CN": PLANET_CN, "BENEFICS": BENEFICS, "MALEFICS": MALEFICS,
|
||||
"PLANET_INDEX": PLANET_INDEX, "HOUSE_STRENGTHS": HOUSE_STRENGTHS,
|
||||
"MOVABLE_SIGNS": MOVABLE_SIGNS,
|
||||
"ALL_PLANETS": ALL_PLANETS, "MOOLATRIKONA_SIGN": MOOLATRIKONA_SIGN,
|
||||
# 基础查询
|
||||
@@ -1057,7 +1086,8 @@ class YogaEngine:
|
||||
"offset": offset,
|
||||
# v6.0.32: 同宫与相位检查(custom规则常用)
|
||||
"same_house": same_house, "aspect": aspect, "aspects_house": aspects_house,
|
||||
"strong": strong, "associated": associated, "temporal_friend": temporal_friend,
|
||||
"house_strength": house_strength, "strong": strong, "weak": weak,
|
||||
"associated": associated, "temporal_friend": temporal_friend,
|
||||
"occupants": occupants, "only_benefics_in_house": only_benefics_in_house,
|
||||
"only_malefics_in_house": only_malefics_in_house,
|
||||
"house_has_benefic": house_has_benefic, "house_has_malefic": house_has_malefic,
|
||||
@@ -1378,15 +1408,16 @@ class YogaEngine:
|
||||
return success() if d9_asc and SIGN_LORDS.get(d9_asc) in dry_lords else []
|
||||
if ctype == "lagna_lord_and_navamsa_lord_both_in_watery_signs":
|
||||
l1 = house_lord(1)
|
||||
d9_lagna_lord = SIGN_LORDS.get(ctx.d9.get("ascendant"))
|
||||
navamsa_lord = ctx.navamsa_dispositor(l1) if l1 else None
|
||||
watery = {"Cancer", "Scorpio", "Pisces"}
|
||||
return success() if l1 and d9_lagna_lord and ctx.sign_of(l1) in watery and ctx.sign_of(d9_lagna_lord) in watery else []
|
||||
return success() if l1 and navamsa_lord and ctx.sign_of(l1) in watery and ctx.sign_of(navamsa_lord) in watery else []
|
||||
if ctype == "jupiter_in_lagna_or_aspects_lagna_from_watery":
|
||||
return success() if "Jupiter" in ctx.planets and (ctx.house_of("Jupiter") == 1 or (ctx.sign_of("Jupiter") in {"Cancer", "Scorpio", "Pisces"} and aspects("Jupiter", 1))) else []
|
||||
if ctype == "lagna_watery_with_benefics_or_lagna_lord_watery":
|
||||
l1 = house_lord(1)
|
||||
asc_watery = ctx.ascendant in {"Cancer", "Scorpio", "Pisces"}
|
||||
return success() if (asc_watery and any(ctx.house_of(b) == 1 for b in BENEFICS if b in ctx.planets)) or (l1 and ctx.sign_of(l1) in {"Cancer", "Scorpio", "Pisces"}) else []
|
||||
watery_planets = {"Moon", "Venus"}
|
||||
return success() if (asc_watery and any(ctx.house_of(b) == 1 for b in BENEFICS if b in ctx.planets)) or (l1 in watery_planets) else []
|
||||
if ctype == "jupiter_in_lagna_mars_in_7th":
|
||||
return success() if ctx.house_of("Jupiter") == 1 and ctx.house_of("Mars") == 7 else []
|
||||
if ctype == "saturn_in_lagna_mars_in_5_7_9":
|
||||
|
||||
Reference in New Issue
Block a user