当年和后两年写出月返照、原生 Patyayini 和 Tithi Pravesha。已有年主、Muntha、Mudda、Sahams、Tajika 不改写。出生地八年总览会算,72 年生命周期年返先不做。

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-23 10:17:13 +08:00
co-authored by Grok (agent loop)
parent 9b2e6aa0b4
commit 4c405d2a51
11 changed files with 1045 additions and 27 deletions
+103 -21
View File
@@ -843,6 +843,7 @@ def render_pl9_parity_markdown(packet: dict) -> str:
'match': '一致',
'mismatch': '需校对',
'not_applicable': '不适用',
'dasha_ending_dates': '结束日',
'pyjhora_behavior_only': '外部行为参考',
'pyjhora_behavior_only / not_multiengine_parity': '外部行为参考',
'blocked_external_callable': '外部回放待校对',
@@ -856,6 +857,7 @@ def render_pl9_parity_markdown(packet: dict) -> str:
'match': 'matches',
'mismatch': 'needs review',
'not_applicable': 'not applicable',
'dasha_ending_dates': 'ending date',
'pyjhora_behavior_only': 'external behavior note',
'pyjhora_behavior_only / not_multiengine_parity': 'external behavior note',
'blocked_external_callable': 'external replay still to review',
@@ -2411,20 +2413,33 @@ def render_pl9_parity_markdown(packet: dict) -> str:
if not isinstance(row, dict):
continue
boundary = f"{row.get('start')} - {row.get('end')}" if row.get('start') and row.get('end') else row.get('start') or '-'
themes = row.get('themes')
if isinstance(themes, dict):
themes = themes.get(_lang) or themes.get('en') or '[translation missing: themes]'
else:
themes = _brief(themes, 2)
lines.append(
f"| {_cell(row.get('order'))} | {_cell(_token(row.get('lord')))} | {_cell(row.get('annual_whole_sign_house'))} | "
f"{_cell(boundary)} | {_cell(_brief(row.get('themes'), 2))} |"
f"{_cell(boundary)} | {_cell(themes)} |"
)
lines.append('')
normalized = _dict(annual.get('normalized_tables'))
mudda_rows = _list(normalized.get('mudda_rows'))
if mudda_rows:
lines.extend([
'### p132-p135 Mudda / Patyayini 年度 Dasha 表',
'',
'| Balance profile | Lord | Start | End | Boundary |' if _lang == 'en' else '| balance profile | 主星 | 开始 | 结束 | 边界口径 |',
'|-----------------|------|-------|-----|----------|' if _lang == 'en' else '|-----------------|------|------|------|----------|',
])
if _lang == 'en':
lines.extend([
'### Mudda annual dasha',
'',
'| Balance profile | Lord | Start | End | Boundary |',
'|-----------------|------|-------|-----|----------|',
])
else:
lines.extend([
'### Mudda 年度大运',
'',
'| 余额口径 | 主星 | 开始 | 结束 | 边界口径 |',
'|----------|------|------|------|----------|',
])
for row in mudda_rows:
if not isinstance(row, dict):
continue
@@ -2449,12 +2464,20 @@ def render_pl9_parity_markdown(packet: dict) -> str:
lines.append('')
patyayini_rows = _list(normalized.get('patyayini_rows'))
if patyayini_rows:
lines.extend([
'### p134 Patyayini / Patyamsha ending-date 表',
'',
'| 主层 | 子层 | 边界 | 边界语义 |',
'|------|------|------|----------|',
])
if _lang == 'en':
lines.extend([
'### Patyayini ending dates',
'',
'| Main | Sub | Boundary | Boundary meaning |',
'|------|-----|----------|------------------|',
])
else:
lines.extend([
'### Patyayini 结束日',
'',
'| 主层 | 子层 | 边界 | 边界语义 |',
'|------|------|------|----------|',
])
for row in patyayini_rows:
if not isinstance(row, dict):
continue
@@ -2661,32 +2684,65 @@ def render_pl9_parity_markdown(packet: dict) -> str:
lines.extend([
'### Monthly returns within the year',
'',
'| Month | Local time | Annual ascendant | Ascendant degree | Planet longitudes (deg) |',
'|-------|------------|------------------|------------------|--------------------------|',
'| Year | Month | Local time | Annual ascendant | Ascendant degree | Planet longitudes (deg) |',
'|------|-------|------------|------------------|------------------|--------------------------|',
])
else:
lines.extend([
'### 年度月返照图盘数据',
'',
'| 月份 | 本地时刻 | 年盘上升 | 上升度数 | 行星黄经(度) |',
'|------|----------|----------|----------|-----------------|',
'| 年份 | 月份 | 本地时刻 | 年盘上升 | 上升度数 | 行星黄经(度) |',
'|------|------|----------|----------|----------|-----------------|',
])
joiner = ', ' if _lang == 'en' else '、'
for row in monthly_rows:
if not isinstance(row, dict):
continue
asc = _dict(row.get('ascendant'))
longitudes = _dict(row.get('planet_longitudes'))
longitude_text = ';'.join(
longitude_text = joiner.join(
f"{_token(planet)} {_degree(value)}"
for planet, value in longitudes.items()
if isinstance(value, (int, float))
)
lines.append(
f"| {_cell(row.get('month_index'))} | {_cell(row.get('local_datetime'))} | "
f"| {_cell(row.get('target_year'))} | {_cell(row.get('month_index'))} | {_cell(row.get('local_datetime'))} | "
f"{_cell(_token(asc.get('sign')))} | {_cell(_degree(asc.get('degree_in_sign') or asc.get('degree')))} | "
f"{_cell(longitude_text)} |"
)
lines.append('')
tithi_years = _list(annual.get('tithi_pravesh_years'))
tithi_rows = [
row for year in tithi_years if isinstance(year, dict)
for row in _list(year.get('rows')) if isinstance(row, dict)
]
if tithi_rows:
if _lang == 'en':
lines.extend([
'### Tithi Pravesha',
'',
'| Year | Local time | Tithi | Phase (deg) |',
'|------|------------|-------|-------------|',
])
else:
lines.extend([
'### Tithi Pravesha',
'',
'| 年份 | 本地时刻 | Tithi | 月相角(度) |',
'|------|----------|-------|-------------|',
])
for year in tithi_years:
if not isinstance(year, dict):
continue
for row in _list(year.get('rows')):
if not isinstance(row, dict):
continue
tithi = _dict(row.get('tithi'))
lines.append(
f"| {_cell(year.get('target_year'))} | {_cell(row.get('local_datetime'))} | "
f"{_cell(tithi.get('full_name'))} | {_cell(_degree(row.get('phase_degrees')))} |"
)
lines.append('')
lifetime_pack = _dict(annual.get('lifetime_annual_chart_pages'))
lifetime_pages = _list(lifetime_pack.get('pages'))
lifetime_rows = [
@@ -2708,10 +2764,11 @@ def render_pl9_parity_markdown(packet: dict) -> str:
'| 年龄 | 年份 | 年返时刻 | 上升 | 上升度数 | 行星黄经(度) |',
'|------|------|----------|------|----------|-----------------|',
])
lifetime_joiner = ', ' if _lang == 'en' else '、'
for row in lifetime_rows:
asc = _dict(row.get('ascendant'))
longitudes = _dict(row.get('planet_longitudes'))
longitude_text = ';'.join(
longitude_text = lifetime_joiner.join(
f"{_token(planet)} {_degree(value)}"
for planet, value in longitudes.items()
if isinstance(value, (int, float))
@@ -2898,9 +2955,14 @@ def render_pl9_parity_markdown(packet: dict) -> str:
if not isinstance(row, dict):
continue
boundary = f"{row.get('start')} - {row.get('end')}" if row.get('start') and row.get('end') else row.get('start') or '-'
themes = row.get('themes')
if isinstance(themes, dict):
themes = themes.get(_lang) or themes.get('en') or '[translation missing: themes]'
else:
themes = _brief(themes, 2)
lines.append(
f"| {_cell(row.get('order'))} | {_cell(_token(row.get('lord')))} | {_cell(row.get('annual_whole_sign_house'))} | "
f"{_cell(boundary)} | {_cell(_brief(row.get('themes'), 2))} |"
f"{_cell(boundary)} | {_cell(themes)} |"
)
lines.append('')
normalized = _dict(annual_pack.get('normalized_tables'))
@@ -3002,6 +3064,26 @@ def render_pl9_parity_markdown(packet: dict) -> str:
f"{_cell(_token(asc.get('sign')))} | {_cell(_degree(asc.get('degree_in_sign') or asc.get('degree')))} |"
)
lines.append('')
tithi_years = _list(annual_pack.get('tithi_pravesh_years'))
if any(isinstance(year_pack, dict) and _list(year_pack.get('rows')) for year_pack in tithi_years):
lines.extend([
'#### Tithi Pravesha' if _lang == 'en' else '#### Tithi Pravesha',
'',
'| Local time | Tithi | Phase (deg) |' if _lang == 'en' else '| 本地时刻 | Tithi | 月相角(度) |',
'|------------|-------|-------------|' if _lang == 'en' else '|----------|-------|-------------|',
])
for year_pack in tithi_years:
if not isinstance(year_pack, dict):
continue
for row in _list(year_pack.get('rows')):
if not isinstance(row, dict):
continue
tithi = _dict(row.get('tithi'))
lines.append(
f"| {_cell(row.get('local_datetime'))} | {_cell(tithi.get('full_name'))} | "
f"{_cell(_degree(row.get('phase_degrees')))} |"
)
lines.append('')
d1_sheet = worksheets.get('d1_rasi_bhava') if isinstance(worksheets.get('d1_rasi_bhava'), dict) else {}
d1_houses = _dict(d1_sheet.get('houses')) or _dict(core_chart.get('houses'))
d1_planets = _dict(d1_sheet.get('planets')) or _dict(core_chart.get('planets'))