标准大运表以前只印主运。已有出处的子运写进主包副本并出表,Kalachakra 子运按简化模型挂在现有主运上。

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-22 23:01:40 +08:00
co-authored by Grok (agent loop) Cursor
parent 1c60926a13
commit 6b906f85c4
4 changed files with 393 additions and 2 deletions
+31 -1
View File
@@ -1955,7 +1955,17 @@ def render_pl9_parity_markdown(packet: dict) -> str:
periods = _list(family.get('periods'))
if not periods:
continue
lines.extend([f'### p{page} {title_text}', ''])
heading = f'### p{page} {title_text}'
if 'Kala Chakra' in title_text:
heading += ' (Simplified model)' if _lang == 'en' else '(简化模型)'
lines.extend([heading, ''])
if 'Kala Chakra' in title_text:
lines.extend([
'- Sub-periods use a simplified model. The major periods are unchanged.'
if _lang == 'en'
else '- 子运和次小运按简化模型,挂在现有主运上。主运本身没有改。',
'',
])
if 'Narayana' in title_text:
# BUG-1215: the product Narayana is the legacy algorithm.
if _lang == 'en':
@@ -2032,6 +2042,26 @@ def render_pl9_parity_markdown(packet: dict) -> str:
f"{_period_start(child) or _cell(child_raw.get('start_date') or child_raw.get('start'))} | "
f"{_period_end(child) or _cell(child_raw.get('end_date') or child_raw.get('end'))} |"
)
pd_rows = []
for child in child_rows:
for grand in _list(child.get('pratyantardasha')):
if isinstance(grand, dict):
pd_rows.append((child, grand))
if pd_rows:
lines.extend([
'',
'| PD | 主层 | 子层 | 次小运 | 起始 | 结束 |' if _lang != 'en' else '| PD | Maha | Antar | Pratyantar | Start | End |',
'|----|------|------|--------|------|------|',
])
for pd_index, (child, grand) in enumerate(pd_rows, start=1):
grand_lord = grand.get('lord') or grand.get('planet') or grand.get('rashi') or grand.get('sign')
lines.append(
f"| {pd_index} | {_cell(_token(child.get('parent_sign') or child.get('parent_lord') or child.get('main')))} | "
f"{_cell(_token(child.get('lord') or child.get('rashi') or child.get('sign')))} | "
f"{_cell(_token(grand_lord))} | {_period_start(grand)} | {_period_end(grand)} |"
)
else:
lines.append('This system does not provide sub-periods.' if _lang == 'en' else '本体系未提供子运')
lines.append('')
# BUG-1215 / BUG-1218: the full-data edition keeps the legacy label and the
# Rath table already printed by the reference renderer. Display only.