fix: resolve Badhaka house by lagna in curse yogas, drop death wording (upstream 6abfe983 follow-up, BUG-1192)
Preta Yoga hard-coded the 11th house as Badhaka; it now uses the single yoga_engine.badhaka_house() definition (movable 11 / fixed 9 / dual 7). Remaining early-death / lineage-ending phrases removed from curse yoga family effects and the Matru-hani yoga effects list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
67aa1b33d7
commit
7fb165ecf6
@@ -0,0 +1,41 @@
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / 'scripts'))
|
||||
|
||||
from curse_yoga_detector import CURSE_DEFINITIONS, CurseYogaDetector, detect_curse_yogas # noqa: E402
|
||||
|
||||
EXPECTED_BADHAKA = {
|
||||
'Aries': 11, 'Cancer': 11, 'Libra': 11, 'Capricorn': 11,
|
||||
'Taurus': 9, 'Leo': 9, 'Scorpio': 9, 'Aquarius': 9,
|
||||
'Gemini': 7, 'Virgo': 7, 'Sagittarius': 7, 'Pisces': 7,
|
||||
}
|
||||
DEATH_CLAIMS = re.compile(r'过早死亡|死亡风险|早夭|早逝|夭折|血脉(?:可能)?(?:中断|停止)|死亡之神')
|
||||
|
||||
|
||||
def test_preta_critical_houses_use_lagna_badhaka_not_fixed_eleventh() -> None:
|
||||
definition = CURSE_DEFINITIONS['preta_yoga_saturn_rahu']
|
||||
for ascendant, badhaka in EXPECTED_BADHAKA.items():
|
||||
houses = CurseYogaDetector._critical_houses(definition, ascendant)
|
||||
assert houses == [8, badhaka, 6], ascendant
|
||||
assert CurseYogaDetector._critical_houses(definition, '') == [8, 6]
|
||||
|
||||
|
||||
def test_curse_yoga_outputs_and_definitions_carry_no_death_claims() -> None:
|
||||
for name in ('curse_yoga_detector.py', 'rashi_tulya_navamsa.py'):
|
||||
source = (ROOT / 'scripts' / name).read_text(encoding='utf-8')
|
||||
assert not DEATH_CLAIMS.search(source), name
|
||||
chart = {
|
||||
'ascendant': {'sign': 'Taurus'},
|
||||
'planets': {
|
||||
'Mars': {'sign': 'Scorpio', 'house': 7},
|
||||
'Saturn': {'sign': 'Scorpio', 'house': 7},
|
||||
'Rahu': {'sign': 'Capricorn', 'house': 9},
|
||||
'Ketu': {'sign': 'Cancer', 'house': 3},
|
||||
},
|
||||
}
|
||||
result = detect_curse_yogas(chart)
|
||||
assert result['curses_detected']
|
||||
assert not DEATH_CLAIMS.search(str(result))
|
||||
Reference in New Issue
Block a user