fix(report): project annual sections and thicken dasha reading
完整数据版第二轮。年运章写出资料包里已有的节,没有数据的不新算。大运解释补回可能段落。瑜伽作用不再断言寿命。术语替换不进标识符。罗睺和计都不写守护第未列出宫。未合入 staging。
This commit is contained in:
+22
-2
@@ -18,8 +18,10 @@ of the same rule. What it adds on top of the upstream function:
|
||||
- `periods` are cropped to the annual window [annual_start, annual_end) and
|
||||
carry `months` (share of 12) for the existing month-window consumers; the
|
||||
upstream ten-group surface (the last group runs past the year end) stays
|
||||
in `periods_full`. Upstream's sub-periods are not carried (no product
|
||||
surface shows them).
|
||||
in `periods_full`. Sub-periods already computed by
|
||||
`calc_mudda_with_dasha_balance` are copied as `antardasha_periods` and
|
||||
cropped to the same annual window. Day rows and a second balance profile
|
||||
are not added here.
|
||||
|
||||
The legacy `tajika.calc_mudda_dasha` (first lord = year lord) is no longer
|
||||
called from any product path.
|
||||
@@ -90,6 +92,23 @@ def annual_mudda_dasha(
|
||||
"start": p_start.isoformat(sep=" "),
|
||||
"end": p_end.isoformat(sep=" "),
|
||||
})
|
||||
antardasha_periods = []
|
||||
for row in raw.get("antardasha_periods") or []:
|
||||
if not isinstance(row, dict) or not row.get("start") or not row.get("end"):
|
||||
continue
|
||||
p_start = max(_parse(row["start"]), start)
|
||||
p_end = min(_parse(row["end"]), end)
|
||||
if p_start >= p_end:
|
||||
continue
|
||||
antardasha_periods.append({
|
||||
"main_order": row.get("main_order"),
|
||||
"sub_order": row.get("sub_order"),
|
||||
"main_lord": row.get("main_lord"),
|
||||
"sub_lord": row.get("sub_lord"),
|
||||
"duration_days": (p_end - p_start).total_seconds() / 86400.0,
|
||||
"start": p_start.isoformat(sep=" "),
|
||||
"end": p_end.isoformat(sep=" "),
|
||||
})
|
||||
return {
|
||||
# The first-lord rule is the astrologer's round-5 ruling; dates are
|
||||
# not externally replayed (upstream keeps its own parameter_sensitive).
|
||||
@@ -110,6 +129,7 @@ def annual_mudda_dasha(
|
||||
"balance_profile": raw.get("balance_profile"),
|
||||
"balance_fraction_remaining": raw.get("balance_fraction_remaining"),
|
||||
"periods": periods,
|
||||
"antardasha_periods": antardasha_periods,
|
||||
"periods_full": raw.get("periods"),
|
||||
"independent_of_year_lord": True,
|
||||
"source": SOURCE,
|
||||
|
||||
Reference in New Issue
Block a user