Files
Jyotisha/tests/test_narayana_method_comparison.py
T
ClaudeandClaude Opus 5.5 198208ac5b feat(sync): astrologer handoff 2e5485f5 — Sodhita entry, Narayana strength profile, 71 unimplemented yogas, Argala tie, Bhava relative points
- A1: ashtakavarga_shodhana.calc_sodhita_av (her entry; ashtakavarga.py frozen),
  level=not_calibrated + prediction_scoring_allowed=False on the chain; legacy
  subtraction stays removed (BUG-1209).
- A2: select_narayana_seed_sign strength_profile rath_empty_sign_lord_strength_v1,
  shared by source-aware seed, MD and AD (matches her function on 6000 draws).
- A3: preflight of logical branches; placeholder not an implementation;
  reference_only rules listed; 71 not_implemented; cmd_yoga not_implemented_count.
- A4: neechabhanga_kendra name/category per her handoff.
- 9e971559: Vimshottari AD record lord and native current PD in dasa convergence.
- B10: Argala equal count stays strength_comparison_required (no Narayana borrow).
- B11: full-reading bhava_bala.reference_relative_points, labelled
  product_relative_points_not_traditional, no bands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-07 22:46:04 +08:00

66 lines
2.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Narayana display keeps the historical sequence and names the selected seed (BUG-1264)."""
from __future__ import annotations
from scripts.narayana_dasha import (
calc_narayana_mahadasha,
narayana_dasha_full_report,
narayana_report_with_variants,
)
LONGS = {
"Sun": 10.0,
"Moon": 40.0,
"Mars": 70.0,
"Mercury": 100.0,
"Jupiter": 130.0,
"Venus": 160.0,
"Saturn": 15.0,
"Rahu": 250.0,
"Ketu": 70.0,
}
def test_default_calc_matches_the_explicit_legacy_profiles() -> None:
plain = calc_narayana_mahadasha(0, LONGS)
explicit = calc_narayana_mahadasha(
0,
LONGS,
0.0,
duration_profile="legacy_forward_v0",
sequence_profile="legacy_zodiacal_v0",
seed_profile="legacy_lagna_v0",
dual_lord_profile="legacy_primary_lord_v0",
)
assert plain == explicit
report = narayana_dasha_full_report(0, LONGS, current_age=30, birth_year=1990)
assert [row["sign"] for row in report["mahadasha_sequence"]] == [row["sign"] for row in plain]
assert report["interpretation"][1].startswith("起运星座: Aries(所选起运规则 legacy_lagna_v0)")
assert "(Lagna)" not in report["interpretation"][1]
def test_source_aware_comparison_does_not_replace_the_historical_sequence() -> None:
compared = narayana_report_with_variants(0, LONGS, current_age=30, birth_year=1990)
historical = narayana_dasha_full_report(0, LONGS, current_age=30, birth_year=1990)
assert [row["years"] for row in compared["mahadasha_sequence"]] == [row["years"] for row in historical["mahadasha_sequence"]]
source = compared["method_comparison"]["source_aware"]
# 原值: seed_selection.profile == "jaimini_lagna_seventh_strength_v1"
# 新值: "rath_empty_sign_lord_strength_v1"(起运、MD、AD 共用;seed_profile 仍是 jaimini_lagna_seventh_strength_v1)
# 原因: 占星师 2026-11-07 rulings.md A2(交接 263092b3)
assert source["seed_selection"]["profile"] == "rath_empty_sign_lord_strength_v1"
assert source["seed_profile"] == "jaimini_lagna_seventh_strength_v1"
assert "rath_empty_sign_lord_strength_v1" in source["interpretation"][1]
assert compared["comparison_required"] is True
def test_ketu_in_the_seed_is_blocked_without_table_12() -> None:
longs = dict(LONGS)
longs["Saturn"] = 200.0
longs["Ketu"] = 5.0
compared = narayana_report_with_variants(0, longs, current_age=10, birth_year=1990)
source = compared["method_comparison"]["source_aware"]
assert source["status"] == "blocked"
assert "rath_ketu_table12_v1" in source["reason"]
assert compared["mahadasha_sequence"][0]["sign"] == "Aries"