fix: use nakshatra seed for Yogini dasha (upstream cb7fe017)
(nakshatra + 3) mod 8 seed. The upstream edit to tests/test_dasha_master_pack_coverage.py is dropped: that file does not exist here. TASK-upstream-sync5-20261002 U5. (cherry picked from commit cb7fe017) 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
cf78d4ca21
commit
5172620c72
+13
-11
@@ -23,16 +23,9 @@ The 8 Yoginis, their year allotments, and associated planets:
|
||||
Total: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 years.
|
||||
|
||||
Starting Yogini:
|
||||
The starting Yogini is determined by the Ascendant (Lagna) Rashi.
|
||||
Per standard texts:
|
||||
- Aries / Leo / Sagittarius / Gemini / Libra / Aquarius
|
||||
→ start from Maya (1)
|
||||
- Taurus / Virgo / Capricorn / Cancer / Scorpio / Pisces
|
||||
→ start from Bhadrika (2)
|
||||
|
||||
Alternative (more common) rule based on Lagna degree modulo 8:
|
||||
Lagna Nakshatra Pada determines the starting Yogini.
|
||||
For simplicity, this implementation uses the Ascendant Rashi rule above.
|
||||
When the Moon's nakshatra index is supplied, use the standard
|
||||
``(nakshatra_index + 3) mod 8`` seed. The older Lagna-rashi seed remains
|
||||
an explicit compatibility fallback when no Moon nakshatra is available.
|
||||
|
||||
Reference: Various classical and modern Jyotish texts on Yogini Dasha.
|
||||
"""
|
||||
@@ -113,6 +106,7 @@ def calculate_yogini_dasha(birth_info: dict) -> dict:
|
||||
birth_info: dict containing:
|
||||
- "lagna_rashi_index": int (0 = Aries, ..., 11 = Pisces)
|
||||
- "birth_datetime": datetime object or ISO-format string (optional)
|
||||
- "moon_nakshatra_index": 0-based nakshatra index (optional)
|
||||
|
||||
Returns:
|
||||
dict with keys:
|
||||
@@ -130,7 +124,14 @@ def calculate_yogini_dasha(birth_info: dict) -> dict:
|
||||
if birth_dt is None:
|
||||
birth_dt = datetime.now()
|
||||
|
||||
start_idx = _get_start_yogini_index(lagna_idx)
|
||||
moon_nakshatra_index = birth_info.get("moon_nakshatra_index")
|
||||
if moon_nakshatra_index is not None:
|
||||
moon_nakshatra_index = int(moon_nakshatra_index) % 27
|
||||
start_idx = (moon_nakshatra_index + 3) % 8
|
||||
seed_method = 'moon_nakshatra_plus_3_mod_8'
|
||||
else:
|
||||
start_idx = _get_start_yogini_index(lagna_idx)
|
||||
seed_method = 'legacy_lagna_rashi_compatibility'
|
||||
starting_yogini = YOGINI_SEQUENCE[start_idx]["name"]
|
||||
starting_planet = YOGINI_SEQUENCE[start_idx]["planet"]
|
||||
|
||||
@@ -163,6 +164,7 @@ def calculate_yogini_dasha(birth_info: dict) -> dict:
|
||||
"total_cycle": TOTAL_CYCLE,
|
||||
"starting_yogini": starting_yogini,
|
||||
"starting_planet": starting_planet,
|
||||
"seed_method": seed_method,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user