feat(dasha): 接口 Yogini 副本挂上小运,完整解读不变
大运行深拷贝后再挂 antardasha。虚构盘对照改成去掉小运后与完整解读逐字段相等。 Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Grok (agent loop)
Cursor
parent
6eeb98c774
commit
3490e89403
@@ -12,6 +12,7 @@ This module must not import `jyotish_api_server` or PyJHora.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
@@ -287,8 +288,22 @@ def compute_dasha(
|
||||
body = body or {}
|
||||
alt, conditional, planet_lons = build_reading_birth_info(birth_dt, planets or {}, ascendant, body)
|
||||
if key == "yogini":
|
||||
payload = _load("yogini_dasha").calculate_yogini_dasha({**alt, "moon_longitude": conditional["moon_longitude"]})
|
||||
return {"periods": _major_rows(payload)}
|
||||
module = _load("yogini_dasha")
|
||||
payload = module.calculate_yogini_dasha({**alt, "moon_longitude": conditional["moon_longitude"]})
|
||||
year_days = 365.25
|
||||
if isinstance(payload, dict) and payload.get("dasha_year_days") is not None:
|
||||
year_days = float(payload["dasha_year_days"])
|
||||
periods = []
|
||||
for row in _major_rows(payload):
|
||||
copied = copy.deepcopy(row)
|
||||
if isinstance(copied, dict):
|
||||
copied["antardasha"] = module.yogini_antardashas(
|
||||
copied,
|
||||
birth_dt=birth_dt,
|
||||
year_days=year_days,
|
||||
)
|
||||
periods.append(copied)
|
||||
return {"periods": periods}
|
||||
if key == "ashtottari":
|
||||
payload = _load("ashtottari_dasha").calculate_ashtottari_dasha({
|
||||
**alt,
|
||||
|
||||
Reference in New Issue
Block a user