fix(report): no book titles, author citations, pages or chapter numbers in front of the reader (BUG-2129)
Owner 2026-11-21: after BUG-2115 the full-data report still printed source lines and book references (Goel 出处 line, the PVR 2014 article in the conditional-dasha note, PVR / Light on Life / BPHS verse in the calculation notes, Tithi lord table source, rashi-dasha 出处 lines, Narayana p.43 label and p.50 / Table 13 direction notes, functional profile source row, Ashtakavarga book calibration). Method names stay; the book, page, chapter and ruling round go. Engine labels for the consultation card are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
This commit is contained in:
@@ -28758,3 +28758,26 @@
|
||||
- 关联记录:BUG-2120(同日)、2026-10-14 生产还原演练文档。
|
||||
- 修复版本:`claude/offsite-backup-2131`。
|
||||
|
||||
## BUG-2129 | 完整数据版报告给读者写出书名、作者、页码和章节号(「出处:V. P. Goel《…》印刷页 10–17」「按 PVR《…》6.2.5–6.2.11」「按《Light on Life》的规则」等)
|
||||
|
||||
- 状态:fixed-pending-verify(待 staging 生成新报告确认)。
|
||||
- 现象:负责人 2026-11-21:报告里的书名引文去掉(BUG-2115 之后)。复查公开盘的中英文完整数据版,书名、作者出处和页码散在十几处:Goel 一节首行「出处:V. P. Goel《Predicting through Jaimini Astrology》,印刷页 10–17。」;条件大运表注「P.V.R. Narasimha Rao 2014 年的文章《Unified Nakshatra Dasa Approach》」和行名「PVR 统一星宿大运读法(2014)」;计算说明「按 PVR《Vedic Astrology: An Integrated Approach》6.2.5–6.2.11」「按《Light on Life》的规则判断」「(BPHS 27.18)…这是原文规定」;Tithi 主星「按 PVR Narasimha Rao《…》表 3 查得」和「主星出处」一行;星座大运方法行「出处:…,印页 288、395」「(PVR 21.2(5))」「待核:书中第 5 章例 1…」「原书没有单列小运规则」「原书没有给出进一步的裁决规则」;Narayana 标签「(默认;按原书 p.43 正文(第七轮裁定))」、小运方向「(p.50 规则 (12) 与注 2)」「(Table 13 / Table 25;第六轮 Q7)」「书内分歧,未采用」;功能吉凶表「口径出处」一行(PVR 书名、§13.2、印刷页和 PDF 页)和「(PVR 第 13.2 节)」;Kala Chakra「(PVR 第 24 章)…按书中比例」;Avastha「PVR 15.4.4」;Ashtakavarga「BPHS / PVR 书例校准」、净化「BPHS 第 67 章」;落陷取消说明「按《Light on Life》规则已满足…」;落陷取消两个规则版本的分页标题「出处:…」;赤纬表「出处:按出生时刻由星历…」「出处:本报告的六维力量计算」;大运参考「参考《印度占星生命之光》和《Yogini Dasha 实战预测》的结构」。负责人的理由同 BUG-2115:出处会让竞品照着去抄。
|
||||
- 触发条件:任何完整数据版报告(中英文)。年运报告的前端生成页本身没有书名引文。
|
||||
- 根因:多轮占星师裁定要求写明出处(issue #92/#93、BUG-2012、BUG-2088、BUG-2095、BUG-2122 等),这些出处都直接写进了读者正文;负责人这次推翻,出处只留在后台数据和方法文档里。
|
||||
- 修复:只去掉书名、作者出处、页码、表号(书内)、章节号、偈号和内部裁定轮次,方法事实和方法名保留。
|
||||
- `scripts/report_render/parity_chapters.py`:删 Goel 出处行;条件大运表注改为「标着『统一星宿大运读法(2014)』的两行,是对 Panchottari 和 Dwisaptati Sama 适用条件的另一种读法」,英文同;赤纬与 Ayana 中间角两条说明去掉「出处:」「Source:」和「按 BPHS 的」;Avastha 方法「PVR 15.4.4,按出生后的 ghati」→「按出生后的 ghati」;Narayana 标签经 `report_rath_label` 去掉页码和裁定轮次。
|
||||
- `scripts/report_render/conditional_dasha_pvr_2014.py`:`PROFILE_NAMES` →「统一星宿大运读法(2014)」/ "Unified nakshatra-dasa reading (2014)"。
|
||||
- `scripts/report_render/opening_guide.py`:分盘规则、Shadbala 门槛、落陷取消三条去掉书名和偈号;开篇 Narayana 标签同上。
|
||||
- `scripts/report_render/tithi_lord_report.py`:算法行改「主星按 Tithi 主星表查得」,删「主星出处」一行。
|
||||
- `scripts/report_render/functional_layer_table.py`:删「口径出处」/ "Profile source" 一行;「PVR §13.2 Table 30」→「PVR 表 30」;双宫主说明去掉「PVR §13.2:」前缀和「(PVR 第 13.2 节)」。
|
||||
- `scripts/rashi_dasha_report.py`:方法行只写方法名(「本站选用的方法:X;未与外部软件逐一核对。」);Sthira 待核句、Drig 年数句、Niryaana 子运句去掉书和章节;`scripts/rashi_dashas_native.py` 的 Niryaana 不上表原因不提「原书」。
|
||||
- `scripts/narayana_legacy_label.py`:新 `RATH_REPORT_LABEL_*` 与 `report_rath_label`(引擎里的 `RATH_LABEL_*` 不变,问答卡片照旧);小运方向行用新的 `scripts/report_render/book_refs.py::strip_book_refs` 去掉页码、表号、章节、裁定轮次括号;「书内分歧,未采用」→「另一种说法,未采用」。`scripts/pl9_reader_export.py` 的 Narayana 标签、Kala Chakra 说明、Ashtakavarga 方法和净化方法同样处理。
|
||||
- `scripts/research_timing/render.py`:Niryaana Shoola 和 Kala Chakra 两条说明去掉「PVR 原书」「PVR 第 24 章」「书中」。
|
||||
- `scripts/pl9_language_terms.py`:大运结构句去掉两本书名;Ashtakavarga 方法名去掉「BPHS / PVR 书例校准」。`scripts/pl9_reader_english_terms.py` 同步。
|
||||
- `scripts/pl9_interpretation_packs.py`:落陷取消两个规则版本的分页标题一律写「规则版本 N」/ "rule version N";同名不同规则在没有条件句时不再写「出处:…」,重名由已有的「同名规则 N」区分。
|
||||
- `scripts/main_yoga_detectors.py`:落陷取消说明「按《Light on Life》规则已满足…」→「已满足落陷取消条件;…」,英文同(瑜伽 effects,问答与写作材料也读它)。
|
||||
- `frontend/src/lib/personal-report-reading-fallback.ts`:功能吉凶口径「《帕拉沙拉占星经典》例外表」→「BPHS 例外表」,与报告表格一致。
|
||||
- 验证与防复发:新增 `tests/test_report_no_book_citations_2129.py`(两张公开盘中英文完整报告不含已知书名、「出处:」「印刷页」「印页」「PDF 页」"printed page" "Source:"、书页 / 章节 / 裁定轮次写法和《…》书名号;`strip_book_refs`、`report_rath_label`、方法行、功能吉凶表各一条单元测试)。按原值 / 新值 / 原因改了 `tests/test_astrologer_rulings_20261107.py`、`test_full_data_parity_chapters.py`、`test_kalachakra_report_classical_1656.py`、`test_rashi_dashas_native.py`、`test_report_reader_wording_2095.py`、`test_report_fields_2065a.py`、`test_report_step2_strength_timing_2088.py`、`test_report_english_han_sources.py`、`test_report_conditional_dasha_pvr_2122.py`、`test_report_astro_review_2110.py`、`test_report_fixes_2105.py`。
|
||||
- 未处理(方法名,不是引文,先保留,待负责人定):「PVR 表 30」「BPHS 例外表」「BPHS 规则」「达到 BPHS 最低要求」「Sanjay Rath 版」「Rath 表10」「Rath MD / Rath AD」表头、「Goel 第一法」「Goel 完整 Brahma 法」「Goel Jaimini 强度与特殊点」章节名、「Drig 相位顺序(Rath)」「PVR Niryaana Shoola」「PVR 象限」「PVR 360 太阴月年」「K.N. Rao 短法」「Raman 198:…」(瑜伽组合里的 BVR 编号)、「Raman Sahams」、「按 Table 10」、英文 "not checked against a book example" / 中文「未经书例核对」。模型写的解读、证据包、问答材料里的书名由证据包窗口 BUG-2130 处理。
|
||||
- 关联记录:BUG-2115、BUG-2122、BUG-2012、BUG-2095、BUG-2130(模型一侧)。
|
||||
- 修复版本:`claude/report-citations-2129`。
|
||||
|
||||
@@ -109,7 +109,8 @@ function participation(facts: Facts, domain: string, id: string) {
|
||||
|
||||
const functionalProfiles: Readonly<Record<string, string>> = {
|
||||
pvr_table30_v1: "PVR 表 30",
|
||||
bphs_exception_profile: "《帕拉沙拉占星经典》例外表",
|
||||
// BUG-2129 (负责人 2026-11-21): no book title in front of the reader; same label as the report table.
|
||||
bphs_exception_profile: "BPHS 例外表",
|
||||
};
|
||||
|
||||
function character(facts: Facts, claims: Facts) {
|
||||
|
||||
@@ -60,8 +60,11 @@ NEECHA_BHANGA_CATEGORY = 'neecha_bhanga'
|
||||
# 原值:'只列成立的取消条件,不单独下结论' / 'Conditions only; no stand-alone conclusion'
|
||||
# 新值:她 2026-11-19 第 3 条给的统一说法:条件成立可以明确确认,但不等于入旺、困难不因此全部消失。
|
||||
# 原因:BUG-2012。
|
||||
NEECHA_BHANGA_NOTE_ZH = '按《Light on Life》规则已满足落陷取消条件;这不等于该星入旺,也不代表相关困难全部消失'
|
||||
NEECHA_BHANGA_NOTE_EN = ('The cancellation conditions of the Light on Life rule are met; '
|
||||
# 原值:「按《Light on Life》规则已满足落陷取消条件;…」/ "The cancellation conditions of the Light on Life rule are met; …"
|
||||
# 新值:不写书名,其余照旧
|
||||
# 原因:BUG-2129 负责人 2026-11-21:报告里不给读者出现书名引文
|
||||
NEECHA_BHANGA_NOTE_ZH = '已满足落陷取消条件;这不等于该星入旺,也不代表相关困难全部消失'
|
||||
NEECHA_BHANGA_NOTE_EN = ('The cancellation conditions are met; '
|
||||
'this is not exaltation, and the related difficulties do not all disappear')
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,11 @@ from __future__ import annotations
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
try:
|
||||
from report_render.book_refs import strip_book_refs
|
||||
except ImportError: # pragma: no cover - package import
|
||||
from scripts.report_render.book_refs import strip_book_refs
|
||||
|
||||
LEGACY_PROFILE = "legacy_reference_only"
|
||||
# 原值:「旧算法(从上升起、一律顺行),待替换为 Sanjay Rath 版」
|
||||
# 新值:只作对照,出生时间校正打分仍用它
|
||||
@@ -40,6 +45,17 @@ RATH_PROFILE = "sanjay_rath"
|
||||
# 原因:#166 Q9 产品决定 2026-11-04(BUG-1601)
|
||||
RATH_LABEL_ZH = "Sanjay Rath 版(默认;按原书 p.43 正文(第七轮裁定))"
|
||||
RATH_LABEL_EN = "Sanjay Rath version (default; book p.43 text, round-7 ruling)"
|
||||
# BUG-2129 (负责人 2026-11-21): the report shows the version's name only — no book page, no ruling round.
|
||||
# The engine label above stays as it is for the backstage record and the consultation card.
|
||||
RATH_REPORT_LABEL_ZH = "Sanjay Rath 版(默认)"
|
||||
RATH_REPORT_LABEL_EN = "Sanjay Rath version (default)"
|
||||
|
||||
|
||||
def report_rath_label(label: Any, language: str) -> str:
|
||||
"""The Narayana algorithm label as the report prints it (BUG-2129)."""
|
||||
text = str(label or (RATH_LABEL_EN if language == "en" else RATH_LABEL_ZH))
|
||||
return (text.replace(";按原书 p.43 正文(第七轮裁定)", "")
|
||||
.replace("; book p.43 text, round-7 ruling", ""))
|
||||
RATH_BLOCKED_ZH = "这张盘用 Sanjay Rath 版定不出起运宫({reason}),没有默认的 Narayana 结果;旧算法只作对照,不顶替"
|
||||
RATH_BLOCKED_EN = ("Sanjay Rath's version cannot decide the start sign for this chart ({reason}); there is no default "
|
||||
"Narayana result, and the legacy algorithm is shown for comparison only, not as a substitute")
|
||||
@@ -882,10 +898,9 @@ def narayana_report_status_lines(rath: Dict[str, Any], language: str, *, split_s
|
||||
|
||||
|
||||
_READING_NAME = {
|
||||
"rath_p50_md_parity_v1": ("Direction by the mahadasha sign (Rath p.50 rule 12 and note 2)",
|
||||
"按大运星座奇偶定方向(Rath 第 50 页规则 12 与注 2)"),
|
||||
"rath_stronger_lord_start_parity_v1": ("Direction by the sub-period start sign (Rath Tables 13 and 25)",
|
||||
"按小运起点星座奇偶定方向(Rath 表 13 与表 25)"),
|
||||
# BUG-2129 (负责人 2026-11-21): no book page or table numbers in front of the reader.
|
||||
"rath_p50_md_parity_v1": ("Direction by the mahadasha sign", "按大运星座奇偶定方向"),
|
||||
"rath_stronger_lord_start_parity_v1": ("Direction by the sub-period start sign", "按小运起点星座奇偶定方向"),
|
||||
}
|
||||
_READING_EXCEPTION = {
|
||||
"saturn_in_md_sign": ("Saturn in the mahadasha sign: zodiacal", "土星在大运星座:顺行"),
|
||||
@@ -1154,11 +1169,13 @@ def _ad_direction_lines_zh(direction: Any) -> List[str]:
|
||||
book divergence and not applied (round-6 ruling Q7, BUG-1225)."""
|
||||
if not isinstance(direction, dict) or not direction.get("rule_text"):
|
||||
return []
|
||||
# BUG-2129: the rule texts lose their page / table references; the other statements are "另一种说法".
|
||||
others = ";".join(
|
||||
f"{row.get('rule_text')} → {AD_DIRECTION_WORD_ZH.get(row.get('direction'), '-')}"
|
||||
f"{strip_book_refs(str(row.get('rule_text')))} → {AD_DIRECTION_WORD_ZH.get(row.get('direction'), '-')}"
|
||||
for row in direction.get("book_divergence") or [] if isinstance(row, dict))
|
||||
line = f"- 小运方向:{direction['rule_text']},{AD_DIRECTION_WORD_ZH.get(direction.get('direction'), '-')}"
|
||||
return [line + (f"(书内分歧,未采用:{others})" if others else "")]
|
||||
line = (f"- 小运方向:{strip_book_refs(str(direction['rule_text']))},"
|
||||
f"{AD_DIRECTION_WORD_ZH.get(direction.get('direction'), '-')}")
|
||||
return [line + (f"(另一种说法,未采用:{others})" if others else "")]
|
||||
|
||||
|
||||
def rath_summary_line_zh(rath: Any) -> Optional[str]:
|
||||
@@ -1168,7 +1185,7 @@ def rath_summary_line_zh(rath: Any) -> Optional[str]:
|
||||
"""
|
||||
if not isinstance(rath, dict) or not rath:
|
||||
return None
|
||||
label = rath.get("algorithm_label") or RATH_LABEL_ZH
|
||||
label = report_rath_label(rath.get("algorithm_label"), "zh")
|
||||
status = narayana_report_status_lines(rath, "zh", split_slashes=True)
|
||||
if not rath.get("seed_sign") and status:
|
||||
return f"- 算法:{label} · " + " ".join(status)
|
||||
@@ -1185,7 +1202,7 @@ def rath_summary_line_en(rath: Any) -> Optional[str]:
|
||||
"""English twin of `rath_summary_line_zh`. Chinese text is not reused."""
|
||||
if not isinstance(rath, dict) or not rath:
|
||||
return None
|
||||
label = rath.get("algorithm_label_en") or RATH_LABEL_EN
|
||||
label = report_rath_label(rath.get("algorithm_label_en"), "en")
|
||||
status = narayana_report_status_lines(rath, "en", split_slashes=True)
|
||||
if not rath.get("seed_sign") and status:
|
||||
return f"- Algorithm: {label} · " + " ".join(status)
|
||||
@@ -1206,11 +1223,11 @@ def _ad_direction_lines_en(direction: Any) -> List[str]:
|
||||
if not isinstance(direction, dict) or not direction.get("rule_text_en"):
|
||||
return []
|
||||
others = "; ".join(
|
||||
f"{row.get('rule_text_en')} -> {AD_DIRECTION_WORD_EN.get(row.get('direction'), '-')}"
|
||||
f"{strip_book_refs(str(row.get('rule_text_en')))} -> {AD_DIRECTION_WORD_EN.get(row.get('direction'), '-')}"
|
||||
for row in direction.get("book_divergence") or [] if isinstance(row, dict))
|
||||
line = (f"- sub-period direction: {direction['rule_text_en']}, "
|
||||
line = (f"- sub-period direction: {strip_book_refs(str(direction['rule_text_en']))}, "
|
||||
f"{AD_DIRECTION_WORD_EN.get(direction.get('direction'), '-')}")
|
||||
return [line + (f" (the book itself disagrees, not applied: {others})" if others else "")]
|
||||
return [line + (f" (another statement, not applied: {others})" if others else "")]
|
||||
|
||||
|
||||
def rath_report_lines_en(rath: Any) -> List[str]:
|
||||
|
||||
@@ -1197,9 +1197,9 @@ def _yoga_page_titles(entries: list[dict], language: str) -> list[str]:
|
||||
versions = [other for other in entries if other["neecha"] and other["planets_key"] == entry["planets_key"]]
|
||||
label = planet_names
|
||||
if len(versions) > 1:
|
||||
# BUG-2129: versions are numbered; the title never names a book.
|
||||
label += (";" if zh else "; ") + (
|
||||
(f"出处:{entry['source']}" if zh else f"rule from {entry['source']}") if entry["source"]
|
||||
else (f"规则版本 {versions.index(entry) + 1}" if zh else f"rule version {versions.index(entry) + 1}")
|
||||
f"规则版本 {versions.index(entry) + 1}" if zh else f"rule version {versions.index(entry) + 1}"
|
||||
)
|
||||
titles.append(f"落陷取消({label})" if zh else f"Neecha Bhanga ({label})")
|
||||
continue
|
||||
@@ -1210,8 +1210,6 @@ def _yoga_page_titles(entries: list[dict], language: str) -> list[str]:
|
||||
if text not in _COMBINATION_PLACEHOLDERS and text not in entry.get("branch_texts", ())]
|
||||
if conditions:
|
||||
parts.append((";" if zh else "; ").join(conditions))
|
||||
elif entry["source"]:
|
||||
parts.append(f"出处:{entry['source']}" if zh else f"rule from {entry['source']}")
|
||||
if planets and sum(other["rule"] == entry["rule"] for other in group) > 1:
|
||||
parts.append(planet_names)
|
||||
titles.append(name + (open_ + (";" if zh else "; ").join(parts) + close if parts else ""))
|
||||
|
||||
@@ -91,7 +91,7 @@ _ZH_FORMATION_PHRASES = (
|
||||
("Mutual aspect", "互照"),
|
||||
("mutual aspect", "互照"),
|
||||
("drig_rath_aspect_sequence_v1", "Drig 相位顺序 v1"),
|
||||
("Ashtakavarga八分法(BPHS/PVR书例校准v2.1)", "Ashtakavarga 八分法(BPHS / PVR 书例校准 v2.1)"),
|
||||
("Ashtakavarga八分法(BPHS/PVR书例校准v2.1)", "Ashtakavarga 八分法(v2.1)"), # BUG-2129: no book attribution
|
||||
("Sade Sati阶段框架", "Sade Sati 阶段框架"),
|
||||
("灵魂星AK", "灵魂星(AK)"),
|
||||
("事业星AmK", "事业星(AmK)"),
|
||||
@@ -838,7 +838,7 @@ def _normalize_zh_dasha_prose(markdown: str) -> str:
|
||||
)
|
||||
text = text.replace(
|
||||
"本节按传统大运的总体作用与具体命盘条件两层结构展开,参考:Light on Life An Introduction to the Astrology of India; Predict Effectively through Yogini 大运。",
|
||||
"本节按传统大运的总体作用与具体命盘条件两层结构展开,参考《印度占星生命之光》和《Yogini Dasha 实战预测》的结构。",
|
||||
"本节按传统大运的总体作用与具体命盘条件两层结构展开。",
|
||||
)
|
||||
text = text.replace(
|
||||
"When supported in the chart, this period gives 认可、行政助力、自信、交通工具、饰品与受尊重的职责.",
|
||||
|
||||
@@ -208,6 +208,7 @@ _PHRASES: dict[str, str] = {
|
||||
"大运星座有土星:一律顺行(Table 11)": "Saturn in the MD sign: always zodiacal (Table 11)",
|
||||
"大运星座有计都:反向(Table 14)": "Ketu in the MD sign: reversed (Table 14)",
|
||||
"(书内分歧,未采用:": " (book divergence, not applied: ",
|
||||
"(另一种说法,未采用:": " (another statement, not applied: ",
|
||||
"p.47(J.S. 1.1.34)看大运星座奇偶": "p.47 (J.S. 1.1.34) by the odd/even of the MD sign",
|
||||
"J.S. 2.4.31–32 看大运星座或其宫主所落星座": "J.S. 2.4.31-32 by the MD sign or the sign its lord occupies",
|
||||
" → 顺行;": " -> zodiacal; ",
|
||||
@@ -261,7 +262,7 @@ _PHRASES: dict[str, str] = {
|
||||
"Chesta remains cross-engine method-conflicted; totals inherit that boundary.":
|
||||
"Chesta Bala depends on the calculation method, so compare totals within the same method.",
|
||||
"Shadbala六重力量": "Shadbala six-fold strength",
|
||||
"Ashtakavarga八分法(BPHS/PVR书例校准v2.1)": "Ashtakavarga eight-fold method (calibrated to BPHS / PVR book examples, v2.1)",
|
||||
"Ashtakavarga八分法(BPHS/PVR书例校准v2.1)": "Ashtakavarga eight-fold method (v2.1)",
|
||||
"吉(Subha)": "Auspicious (Subha)",
|
||||
"中(Mixed)": "Mixed",
|
||||
"凶(Asubha)": "Inauspicious (Asubha)",
|
||||
|
||||
@@ -23,9 +23,13 @@ for the public reader rather than exposing empty or machine-key rows.
|
||||
from __future__ import annotations
|
||||
|
||||
try: # scripts/ on sys.path
|
||||
from narayana_legacy_label import RATH_LABEL_EN, RATH_LABEL_ZH, legacy_line_en, legacy_line_zh
|
||||
from narayana_legacy_label import RATH_REPORT_LABEL_EN as RATH_LABEL_EN, RATH_REPORT_LABEL_ZH as RATH_LABEL_ZH, legacy_line_en, legacy_line_zh
|
||||
except ImportError: # pragma: no cover - package import
|
||||
from scripts.narayana_legacy_label import RATH_LABEL_EN, RATH_LABEL_ZH, legacy_line_en, legacy_line_zh
|
||||
from scripts.narayana_legacy_label import RATH_REPORT_LABEL_EN as RATH_LABEL_EN, RATH_REPORT_LABEL_ZH as RATH_LABEL_ZH, legacy_line_en, legacy_line_zh
|
||||
try: # scripts/ on sys.path
|
||||
from report_render.book_refs import strip_book_refs
|
||||
except ImportError: # pragma: no cover - package import
|
||||
from scripts.report_render.book_refs import strip_book_refs
|
||||
try: # scripts/ on sys.path
|
||||
from report_render.audit_chapters import STATUS
|
||||
from report_render.english_gaps import english_effects, first_clean_english
|
||||
@@ -2224,14 +2228,15 @@ def render_pl9_parity_markdown(packet: dict) -> str:
|
||||
lines.extend([
|
||||
'### p51-p60 Ashtakavarga SAV / BAV / Pinda',
|
||||
'',
|
||||
f"- 方法:{_cell(ashtakavarga.get('method'))}",
|
||||
# BUG-2129: the method's book calibration note is not shown to the reader.
|
||||
f"- 方法:{_cell(str(ashtakavarga.get('method') or '').replace('(BPHS/PVR书例校准v2.1)', '(v2.1)') or None)}",
|
||||
# BUG-2095: the check result in words (was the code `all_valid`, or a bare True/False).
|
||||
f"- BAV 校验:{_cell({True: 'All passed' if english else '全部通过', False: 'Not all passed' if english else '未全部通过'}.get(ashtakavarga.get('all_bav_valid'), ashtakavarga.get('all_bav_valid')))}",
|
||||
])
|
||||
if sodhita_ok:
|
||||
lines.append(
|
||||
f"- Reduction: {_cell(sodhita.get('method'))}" if english
|
||||
else f"- 净化:{_cell(sodhita.get('method_zh') or sodhita.get('method'))};原始值并列"
|
||||
f"- Reduction: {_cell(strip_book_refs(str(sodhita.get('method') or '')) or None)}" if english
|
||||
else f"- 净化:{_cell(strip_book_refs(str(sodhita.get('method_zh') or sodhita.get('method') or '').replace('(BPHS 第 67 章,逐行 BAV)', '(逐行 BAV)')) or None)};原始值并列"
|
||||
)
|
||||
lines.extend([
|
||||
'',
|
||||
@@ -2589,9 +2594,9 @@ def render_pl9_parity_markdown(packet: dict) -> str:
|
||||
if kalachakra_classical:
|
||||
# BUG-1656: sign periods from the natal Moon longitude.
|
||||
lines.extend([
|
||||
'- Sign periods start from the natal Moon longitude (PVR ch. 24). Sub-periods follow the published proportions; the third level repeats the same rule and is parameter-sensitive.'
|
||||
'- Sign periods start from the natal Moon longitude. Sub-periods follow the standard proportions; the third level repeats the same rule and is parameter-sensitive.'
|
||||
if _lang == 'en'
|
||||
else '- 按本命月亮实际经度起算星座期(PVR 第 24 章)。小运按书中比例划分,细运用同一比例再分一层,结果对参数敏感。',
|
||||
else '- 按本命月亮实际经度起算星座期。小运按固定比例划分,细运用同一比例再分一层,结果对参数敏感。',
|
||||
'',
|
||||
])
|
||||
elif 'Kala Chakra' in title_text:
|
||||
|
||||
@@ -107,11 +107,9 @@ def _method_line(section: Mapping, language: str) -> str:
|
||||
# BUG-2095: the method by name (author / book), not its profile id (`goel_method_1_v1`).
|
||||
profile = reader_key(section.get("profile_id") or "", language)
|
||||
if language == "en":
|
||||
return (
|
||||
f"Method used on this site: {profile}, source: {section.get('source_en')}; "
|
||||
"not checked one-by-one against external software."
|
||||
)
|
||||
return f"本站选用的方法:{profile},出处:{section.get('source_zh')};未与外部软件逐一核对。"
|
||||
# BUG-2129 (负责人 2026-11-21): the method's name only; no book, chapter or page.
|
||||
return f"Method used on this site: {profile}; not checked one-by-one against external software."
|
||||
return f"本站选用的方法:{profile};未与外部软件逐一核对。"
|
||||
|
||||
|
||||
_PLANET_CN = {"Sun": "太阳", "Moon": "月亮", "Mars": "火星", "Mercury": "水星", "Jupiter": "木星", "Venus": "金星", "Saturn": "土星"}
|
||||
@@ -132,8 +130,7 @@ def _sthira_note(section: Mapping, language: str) -> str:
|
||||
f"Alternative: the K.N. Rao short method gives {comparison.get('brahma_planet')}, starting from {comparison.get('start_sign')}; "
|
||||
"it is kept as a separate comparison and is not used for this table.")
|
||||
if not fallback:
|
||||
text += (" Open point: in the book's chapter 5 first example the text picks Venus over the Sun, while the chapter 1 "
|
||||
"totals give the Sun the higher score; how the full method compares the lords is pending verification.")
|
||||
text += " Open point: how the full method compares the lords is pending verification."
|
||||
return text.strip()
|
||||
cn = lambda name: _PLANET_CN.get(str(name), str(name))
|
||||
text = (f"Goel 完整方法没有选出唯一的 Brahma,本表按 K.N. Rao 短法:Brahma 为{cn(planet)}。" if fallback
|
||||
@@ -144,7 +141,7 @@ def _sthira_note(section: Mapping, language: str) -> str:
|
||||
f"对照:K.N. Rao 短法定为{cn(comparison.get('brahma_planet'))},从{_SIGN_CN.get(str(comparison.get('start_sign')), comparison.get('start_sign'))}起;"
|
||||
"短法单独保留作对照,本表不用。")
|
||||
if not fallback:
|
||||
text += "待核:书中第 5 章例 1 的正文选金星,而按第 1 章强度表太阳分数更高;完整方法如何比较三颗宫主仍待核对。"
|
||||
text += "待核:完整方法如何比较三颗宫主仍待核对。"
|
||||
return text
|
||||
|
||||
|
||||
@@ -182,17 +179,17 @@ def render_rashi_dasha_chapter(packet: Mapping) -> str:
|
||||
if key == "drig" and section.get("year_rule") == "narayana_rath_sign_period":
|
||||
lines.extend([
|
||||
"Sign order by aspects from the 9th, 10th and 11th houses; each sign's years follow this site's Narayana "
|
||||
"rules (PVR 21.2(5)), including the dual-lord choice and exaltation / debilitation adjustments."
|
||||
"rules, including the dual-lord choice and exaltation / debilitation adjustments."
|
||||
if language == "en"
|
||||
else "星座顺序按第 9、10、11 宫及其相照星座排列;每个星座的年数与本站 Narayana 大运同一套规则(PVR 21.2(5)),"
|
||||
else "星座顺序按第 9、10、11 宫及其相照星座排列;每个星座的年数与本站 Narayana 大运同一套规则,"
|
||||
"包括双主星择强与入旺、落陷调整。",
|
||||
"",
|
||||
])
|
||||
if key == "niryaana_shoola" and section.get("status") == "listed":
|
||||
lines.extend([
|
||||
"The cited book gives no separate sub-period rule. Sub-periods follow the upstream export (forward from the major sign, twelve equal parts) and are for comparison only."
|
||||
"There is no separate sub-period rule. Sub-periods follow the upstream export (forward from the major sign, twelve equal parts) and are for comparison only."
|
||||
if language == "en"
|
||||
else "原书没有单列小运规则。小运按上游导出的口径列出(从大运星座起顺排十二宫、均分),只作对照。",
|
||||
else "没有单列的小运规则。小运按上游导出的口径列出(从大运星座起顺排十二宫、均分),只作对照。",
|
||||
"",
|
||||
])
|
||||
if key == "lagna_kendradi" and section.get("status") == "listed":
|
||||
|
||||
@@ -539,8 +539,9 @@ def _niryaana_shoola(birth: date, ascendant_longitude: float, planet_lons: Mappi
|
||||
_NIRYAANA_PROFILE,
|
||||
_NIRYAANA_SOURCE_ZH,
|
||||
_NIRYAANA_SOURCE_EN,
|
||||
"本轮不上表:二宫与八宫力量相同,原书没有给出进一步的裁决规则。",
|
||||
"This report does not include Niryaana Shoola: the second and eighth signs are equal, and the source gives no further tie-break.",
|
||||
# BUG-2129: the reason names no book.
|
||||
"本轮不上表:二宫与八宫力量相同,现有规则没有给出进一步的裁决办法。",
|
||||
"This report does not include Niryaana Shoola: the second and eighth signs are equal, and the rule gives no further tie-break.",
|
||||
)
|
||||
start_sign = int(picked["selected_sign_idx"])
|
||||
periods = niryaana_shoola_mahadashas(birth, start_sign)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
"""BUG-2129: book page / table / chapter references are not shown to the reader.
|
||||
|
||||
Owner 2026-11-21: the report shows the data and the method's name, never the book,
|
||||
author's page, table number, chapter or internal ruling round it was taken from.
|
||||
Engine packets keep those references for the backstage record; the report strips
|
||||
a parenthetical that carries one.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
_REF = (
|
||||
r"(?:p\.\s?\d|pp\.\s?\d|Table\s?\d|Tables\s?\d|第\s?\d+\s?章|ch\.\s?\d|chapter\s\d|J\.S\.|§\s?\d"
|
||||
r"|第[一二三四五六七八九十]+轮|round-\d|印页|印刷页|PDF\s?页)"
|
||||
)
|
||||
_NUMBER_IN_PARENS = re.compile(r"\((\d+)\)")
|
||||
_ZH_GROUP = re.compile(r"([^()]*" + _REF + r"[^()]*)")
|
||||
_EN_GROUP = re.compile(r"\s?\([^()]*" + _REF + r"[^()]*\)")
|
||||
# A citation that opens the text itself: "J.S. 2.4.31–32 …", "p.50 规则 12 与注 2 …".
|
||||
_LEADING = re.compile(
|
||||
r"^(?:J\.S\.\s?[\d.\-–]+\s?|p\.\s?\d+\s?(?:规则|rule)\s?\d+,?\s?(?:与|and)?\s?(?:注|note)\s?\d+\s?)"
|
||||
)
|
||||
|
||||
|
||||
def strip_book_refs(text: str) -> str:
|
||||
"""The text without any parenthetical holding a book page, table, chapter or ruling round."""
|
||||
if not isinstance(text, str) or not text:
|
||||
return text
|
||||
flat = _NUMBER_IN_PARENS.sub(r"\1", text)
|
||||
stripped = _LEADING.sub("", _EN_GROUP.sub("", _ZH_GROUP.sub("", flat)))
|
||||
return stripped if stripped != flat else text
|
||||
@@ -34,7 +34,8 @@ except ImportError: # pragma: no cover
|
||||
from report_render.conditional_dasha_applicability import _SIGN_LORDS, _longitudes
|
||||
|
||||
PROFILE = "pvr_unified_nakshatra_dasa_2014"
|
||||
PROFILE_NAMES = ("PVR unified nakshatra-dasa reading (2014)", "PVR 统一星宿大运读法(2014)")
|
||||
# BUG-2129 (负责人 2026-11-21): the reader sees the reading's name, not its author.
|
||||
PROFILE_NAMES = ("Unified nakshatra-dasa reading (2014)", "统一星宿大运读法(2014)")
|
||||
CANCER = 3
|
||||
# Family keys (as in conditional_dasha_applicability.FAMILY_ORDER) that have a PVR 2014 variant.
|
||||
VARIANT_FAMILIES = ("dwisaptatisama", "panchottari")
|
||||
|
||||
@@ -47,7 +47,7 @@ _CONDITIONS_ZH = {
|
||||
"Neutral/mixed is association-dependent, not an absence of risk.": "中性或混合要看它与哪些行星发生关联,不等于没有风险。",
|
||||
"Natural nature, strength, maraka roles and dasha activation remain separate.": "自然吉凶、力量、与寿命损耗有关的角色、大运是否带动,各自另看。",
|
||||
"Strict yogakarakas do not exhaust the text's broader yoga-producing associations.": "这里的瑜伽主星取严格定义,典籍里更宽的成格关联不止这些。",
|
||||
"Dual lordship needs an integrated judgment of both houses (PVR §13.2).": "管两个宫的行星要把两宫合起来判断(PVR 第 13.2 节)。",
|
||||
"Dual lordship needs an integrated judgment of both houses (PVR §13.2).": "管两个宫的行星要把两宫合起来判断。",
|
||||
}
|
||||
_PAKSHA = {"waxing": ("盈月", "waxing"), "waning": ("亏月", "waning")}
|
||||
_PLANET_ORDER = ("Sun", "Moon", "Mars", "Mercury", "Jupiter", "Venus", "Saturn", "Rahu", "Ketu")
|
||||
@@ -74,10 +74,11 @@ def _ordered(mapping: dict) -> list[tuple[str, Any]]:
|
||||
|
||||
|
||||
def _basis_text(text: str, language: str) -> str:
|
||||
# BUG-2129: the section number of the book is not shown; the profile keeps its name (PVR 表 30).
|
||||
if language != "zh":
|
||||
return text
|
||||
text = text.replace("PVR §13.2 Table 30 note: movable-lagna Moon by paksha", "PVR 第 13.2 节表 30 附注:动星座上升的月亮按盈亏月判定")
|
||||
return text.replace("PVR §13.2 Table 30", "PVR 第 13.2 节表 30")
|
||||
return text.replace("PVR §13.2 Table 30", "PVR Table 30")
|
||||
text = text.replace("PVR §13.2 Table 30 note: movable-lagna Moon by paksha", "PVR 表 30 附注:动星座上升的月亮按盈亏月判定")
|
||||
return text.replace("PVR §13.2 Table 30", "PVR 表 30")
|
||||
|
||||
|
||||
def _profile_short(value: Any, language: str) -> str:
|
||||
@@ -115,8 +116,7 @@ def functional_layer_rows(functional: Any, language: str) -> list[list[str]]:
|
||||
add("上升主星", "Ascendant lord", planet_name(functional.get("lagna_lord"), language))
|
||||
if "functional_profile" in functional:
|
||||
add("功能吉凶口径", "Functional profile", functional_profile_reader_label(functional.get("functional_profile"), language))
|
||||
if functional.get("profile_source"):
|
||||
add("口径出处", "Profile source", functional.get("profile_source"))
|
||||
# BUG-2129 (负责人 2026-11-21): the profile's book citation is not shown to the reader.
|
||||
if functional.get("functional_profile") == "pvr_table30_v1" and functional.get("functional_profile_ruling"):
|
||||
add(
|
||||
"口径选用说明", "How the profile is chosen",
|
||||
@@ -224,12 +224,15 @@ def functional_layer_rows(functional: Any, language: str) -> list[list[str]]:
|
||||
if label:
|
||||
add("结论性质", "Kind of statement", _pick(_ASSERTION.get(str(label)), language) or ("未在名称表内" if zh else "Not in the name table"))
|
||||
note = functional.get("dual_lordship_note") if zh else functional.get("dual_lordship_note_en")
|
||||
if isinstance(note, str):
|
||||
# BUG-2129: the book section is not shown to the reader.
|
||||
note = re.sub(r"^PVR §13\.2[::]\s*", "", note)
|
||||
add("管两个宫的行星", "Planets owning two houses", note)
|
||||
conditions = functional.get("conditions")
|
||||
if isinstance(conditions, (list, tuple)) and conditions:
|
||||
if zh:
|
||||
texts = [_CONDITIONS_ZH[item] for item in conditions if item in _CONDITIONS_ZH]
|
||||
else:
|
||||
texts = [str(item) for item in conditions if isinstance(item, str) and not re.search(r"[一-鿿]", item)]
|
||||
texts = [str(item).replace(" (PVR §13.2)", "") for item in conditions if isinstance(item, str) and not re.search(r"[一-鿿]", item)]
|
||||
add("使用条件", "Conditions of use", " ".join(texts) if not zh else "".join(texts))
|
||||
return rows
|
||||
|
||||
@@ -13,7 +13,7 @@ import re
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from scripts.narayana_legacy_label import narayana_report_dates, narayana_report_status_lines
|
||||
from scripts.narayana_legacy_label import narayana_report_dates, narayana_report_status_lines, report_rath_label
|
||||
from scripts.pl9_interpretation_packs import (
|
||||
_current_period_rows,
|
||||
_dict,
|
||||
@@ -42,7 +42,7 @@ except ModuleNotFoundError: # pragma: no cover - scripts/ on sys.path
|
||||
_timing,
|
||||
_worksheets,
|
||||
)
|
||||
from narayana_legacy_label import narayana_report_dates, narayana_report_status_lines
|
||||
from narayana_legacy_label import narayana_report_dates, narayana_report_status_lines, report_rath_label
|
||||
from report_render.appendix_language import planet_name, sign_name
|
||||
|
||||
_SIGNS = (
|
||||
@@ -184,7 +184,9 @@ def timeline(packet: dict, language: str) -> str:
|
||||
current = _dict(narayana.get("current_dasha"))
|
||||
md, ad = _dict(current.get("md")), _dict(current.get("ad"))
|
||||
if md.get("sign"):
|
||||
# BUG-2129: no book page or ruling round in the label.
|
||||
label = narayana.get("algorithm_label" if zh else "algorithm_label_en")
|
||||
label = label and report_rath_label(label, language)
|
||||
heading = "Narayana 当前大运" if zh else "Current Narayana period"
|
||||
# BUG-2038 原值:中文开篇也带模块给出的算法标签(版本与出处,写在括号里)。
|
||||
# 新值:中文开篇不带;标签留在后面的 Narayana 章节和附录。英文版不变。
|
||||
@@ -357,23 +359,23 @@ def calculation_notes(language: str) -> str:
|
||||
return "\n".join([
|
||||
"**计算说明**",
|
||||
"",
|
||||
"- D5、D6、D8、D11 按 PVR《Vedic Astrology: An Integrated Approach》6.2.5–6.2.11 的分盘规则。D8 动宫从白羊、固定宫从射手、双宫从狮子起算;选 Raman 岁差不会改用另一套 Raman D8 规则。",
|
||||
"- D5、D6、D8、D11 的分盘规则:D8 动宫从白羊、固定宫从射手、双宫从狮子起算;选 Raman 岁差不会改用另一套 Raman D8 规则。",
|
||||
"- Yogini 大运按本命月亮星宿与剩余弧度起算,一年取 365.25 天。表中第一段是出生余额,不是一段新的完整大运。",
|
||||
"- Vimshottari 第一段小运和细运接着原来完整周期的钟点走,只是不列出生前那一部分,不在出生时刻重新起算。",
|
||||
"- Shadbala 按本仓写明的各分量方法计算。最低门槛按 BPHS:太阳 6.5、月亮 6、火星 5、水星 7、木星 6.5、金星 5.5、土星 5 Rupa;门槛比值与总分是两回事。太阳的 Cheshta 等于他的 Ayana Bala,月亮的 Cheshta 等于她的 Paksha Bala(BPHS 27.18),所以在 Kala 细项和 Cheshta 两处各出现一次,这是原文规定,不是重复计算,也不再乘 2。各分量按占星师在 #166 选定的口径;外部软件用的口径不同,个别行星是否达标可能相反,所以达标与否对参数敏感。达标只说明力量,不等于吉;未达标也不等于凶,吉凶要看功能吉凶、宫主、落宫、大运与行运。",
|
||||
"- Shadbala 按本仓写明的各分量方法计算。最低门槛:太阳 6.5、月亮 6、火星 5、水星 7、木星 6.5、金星 5.5、土星 5 Rupa;门槛比值与总分是两回事。太阳的 Cheshta 等于他的 Ayana Bala,月亮的 Cheshta 等于她的 Paksha Bala,所以在 Kala 细项和 Cheshta 两处各出现一次,这是规则本身的规定,不是重复计算,也不再乘 2。各分量按占星师在 #166 选定的口径;外部软件用的口径不同,个别行星是否达标可能相反,所以达标与否对参数敏感。达标只说明力量,不等于吉;未达标也不等于凶,吉凶要看功能吉凶、宫主、落宫、大运与行运。",
|
||||
# BUG-2012:原值「记录的是取消条件,行星仍是落陷;它本身不等于王者格,也不保证结果好」;新值按她 2026-11-19 第 1、3 条写明规则来源和统一说法。
|
||||
"- 落陷取消(Neecha Bhanga)按《Light on Life》的规则判断。条件满足时,说的是「已满足落陷取消条件」:行星仍是落陷,这不等于入旺,也不代表相关困难全部消失;它本身不等于王者格,也不保证结果好。",
|
||||
"- 落陷取消(Neecha Bhanga)按本报告选定的一套规则判断。条件满足时,说的是「已满足落陷取消条件」:行星仍是落陷,这不等于入旺,也不代表相关困难全部消失;它本身不等于王者格,也不保证结果好。",
|
||||
"- 计算用的是用户提供的出生资料和上面写明的计算口径。大运交界是算出的时间边界,不是到了那天就会发生的事。检出的瑜伽是规则筛出的候选,还要看成立与取消条件。",
|
||||
"- 显示精度:时间到整秒,角度最多四位小数。",
|
||||
])
|
||||
return "\n".join([
|
||||
"**Calculation notes**",
|
||||
"",
|
||||
"- D5, D6, D8 and D11 use the PVR divisional rules (Vedic Astrology: An Integrated Approach, 6.2.5-6.2.11). D8 starts from Aries for movable signs, Sagittarius for fixed signs and Leo for dual signs. Raman ayanamsa does not select the separate Raman D8 convention.",
|
||||
"- D5, D6, D8 and D11 divisional rules: D8 starts from Aries for movable signs, Sagittarius for fixed signs and Leo for dual signs. Raman ayanamsa does not select the separate Raman D8 convention.",
|
||||
"- Yogini uses the natal Moon nakshatra and its remaining arc, with a year of 365.25 days. Its first visible period is the birth balance, not a new full period.",
|
||||
"- The first Vimshottari AD and PD continue the original full-period clock; only their pre-birth portions are omitted. They do not restart at birth.",
|
||||
"- Shadbala uses the stated local component methods. Minimum strengths follow BPHS: Sun 6.5, Moon 6, Mars 5, Mercury 7, Jupiter 6.5, Venus 5.5, Saturn 5 Rupas; the threshold ratio is distinct from total strength. The Sun's Cheshta is his Ayana Bala and the Moon's Cheshta is her Paksha Bala (BPHS 27.18), so each value appears once in the Kala detail and once as Cheshta; this is the text's rule, not double counting, and nothing is doubled. Components follow the profile the astrologer chose in #166; external software uses other profiles, and a planet can meet the minimum in one and miss it in the other, so the verdict is parameter-sensitive. Meeting the minimum describes strength only and is not a favourable verdict; missing it is not an unfavourable one. That depends on functional roles, lordship, placement, dashas and transits.",
|
||||
"- Neecha Bhanga is judged by the Light on Life rule. When its conditions are met, the statement is that the cancellation conditions are met: the planet stays debilitated, this is not exaltation, and the related difficulties do not all disappear. It does not by itself establish a Raja Yoga or promise a favourable outcome.",
|
||||
"- Shadbala uses the stated local component methods. Minimum strengths: Sun 6.5, Moon 6, Mars 5, Mercury 7, Jupiter 6.5, Venus 5.5, Saturn 5 Rupas; the threshold ratio is distinct from total strength. The Sun's Cheshta is his Ayana Bala and the Moon's Cheshta is her Paksha Bala, so each value appears once in the Kala detail and once as Cheshta; this is the rule itself, not double counting, and nothing is doubled. Components follow the profile the astrologer chose in #166; external software uses other profiles, and a planet can meet the minimum in one and miss it in the other, so the verdict is parameter-sensitive. Meeting the minimum describes strength only and is not a favourable verdict; missing it is not an unfavourable one. That depends on functional roles, lordship, placement, dashas and transits.",
|
||||
"- Neecha Bhanga is judged by the one rule set this report uses. When its conditions are met, the statement is that the cancellation conditions are met: the planet stays debilitated, this is not exaltation, and the related difficulties do not all disappear. It does not by itself establish a Raja Yoga or promise a favourable outcome.",
|
||||
"- Calculations use the birth details supplied and the stated calculation profile. Dasha boundaries are calculated period boundaries, not promises of events on those dates. Detected yogas are rule-screened candidates requiring condition and cancellation review.",
|
||||
"- Display precision: timestamps to whole seconds, angles to at most four decimals.",
|
||||
])
|
||||
|
||||
@@ -22,6 +22,7 @@ try:
|
||||
narayana_report_extras,
|
||||
narayana_report_reading_lines,
|
||||
narayana_report_status_lines,
|
||||
report_rath_label,
|
||||
)
|
||||
from scripts.report_render.appendix_language import (
|
||||
friendship_table,
|
||||
@@ -45,6 +46,7 @@ except ModuleNotFoundError: # pragma: no cover
|
||||
narayana_report_extras,
|
||||
narayana_report_reading_lines,
|
||||
narayana_report_status_lines,
|
||||
report_rath_label,
|
||||
)
|
||||
from report_render.appendix_language import (
|
||||
friendship_table,
|
||||
@@ -1204,16 +1206,17 @@ def _applicability(packet: dict, language: str) -> str:
|
||||
# 原值:「本报告没有按那些读法计算,上表只反映这里所用的条件」;
|
||||
# 新值:两种读法各占一行(「PVR 统一星宿大运读法(2014)」),说明出处和范围;
|
||||
# 原因:BUG-2122 占星师第 11 问:另一读法作为单独具名读法列出,不替换本报告所用的条件。
|
||||
("标着「PVR 统一星宿大运读法(2014)」的两行,是 P.V.R. Narasimha Rao 2014 年的文章《Unified Nakshatra Dasa Approach》"
|
||||
"对 Panchottari 和 Dwisaptati Sama 适用条件的另一种读法,列在本报告所用条件的下一行,两者分开判断。"
|
||||
"这两行只取文章里的这两条条件:宫位按星座数,上升所在星座是第 1 宫,没有按宫头度数另划宫界;"
|
||||
"文章还有按「控制星」强弱从几种条件大运中挑一种的步骤,这里没有做。"
|
||||
# BUG-2115 补充 / BUG-2129(负责人 2026-11-21):不写作者和文章名。
|
||||
("标着「统一星宿大运读法(2014)」的两行,是对 Panchottari 和 Dwisaptati Sama 适用条件的另一种读法,"
|
||||
"列在本报告所用条件的下一行,两者分开判断。"
|
||||
"这两行只取这一读法里的这两条条件:宫位按星座数,上升所在星座是第 1 宫,没有按宫头度数另划宫界;"
|
||||
"这一读法还有按「控制星」强弱从几种条件大运中挑一种的步骤,这里没有做。"
|
||||
"这一读法成立不改变本报告看时间所用的大运,也不另算周期表。"
|
||||
if zh else
|
||||
"The two rows marked \"PVR unified nakshatra-dasa reading (2014)\" give another reading of the Panchottari and "
|
||||
"Dwisaptati Sama conditions, from P.V.R. Narasimha Rao's 2014 article \"Unified Nakshatra Dasa Approach\". Each sits "
|
||||
"The two rows marked \"Unified nakshatra-dasa reading (2014)\" give another reading of the Panchottari and "
|
||||
"Dwisaptati Sama conditions. Each sits "
|
||||
"under the row for the condition this report uses and is judged separately. Only these two conditions are taken from "
|
||||
"the article: houses are counted by sign, with the Lagna sign as the 1st, not by house-cusp degrees; the article's "
|
||||
"that reading: houses are counted by sign, with the Lagna sign as the 1st, not by house-cusp degrees; the reading's "
|
||||
"further step of choosing among conditional dashas by the strength of a controlling planet is not applied. A met "
|
||||
"condition under this reading does not change the dasha this report uses for timing, and no separate period table "
|
||||
"is calculated."),
|
||||
@@ -1387,6 +1390,7 @@ def _rath_block(module: Any, language: str, fallback: str, extras: dict | None =
|
||||
return fallback
|
||||
zh = language == "zh"
|
||||
label = module.get("algorithm_label" if zh else "algorithm_label_en")
|
||||
label = label and report_rath_label(label, language) # BUG-2129
|
||||
lines = []
|
||||
if module.get("mahadasha"):
|
||||
lines.append(_rows_from([{"method": label, "sign": module.get("seed_sign")}], language,
|
||||
@@ -2113,18 +2117,18 @@ def _coordinates(packet: dict, language: str) -> str:
|
||||
["Planet", "Equatorial declination (°, north positive)", "Ayana intermediate angle (°)", "Speed (°/day)"]
|
||||
)
|
||||
notes = [
|
||||
("赤道赤纬:行星离天赤道的角距,北为正、南为负,单位是度。出处:按出生时刻由星历直接取当日赤道坐标;"
|
||||
("赤道赤纬:行星离天赤道的角距,北为正、南为负,单位是度。按出生时刻由星历直接取当日赤道坐标;"
|
||||
"计都取罗睺的相反数。它与岁差无关。"
|
||||
if zh else
|
||||
"Equatorial declination: the planet's angular distance from the celestial equator, north positive and south "
|
||||
"negative, in degrees. Source: read from the ephemeris in the equator of date at the birth moment; Ketu is "
|
||||
"negative, in degrees. Read from the ephemeris in the equator of date at the birth moment; Ketu is "
|
||||
"Rahu with the sign reversed. It does not depend on the ayanamsa."),
|
||||
("Ayana 中间角:六维力量里算 Ayana 力量时用的中间量,按 BPHS 的七点表插值得到,带 Ayana 力量自己的正负规则,"
|
||||
"单位是度。出处:本报告的六维力量计算。它不是赤纬,两列的数不能互相替代。"
|
||||
("Ayana 中间角:六维力量里算 Ayana 力量时用的中间量,按七点表插值得到,带 Ayana 力量自己的正负规则,"
|
||||
"单位是度。由本报告的六维力量计算得出。它不是赤纬,两列的数不能互相替代。"
|
||||
if zh else
|
||||
"Ayana intermediate angle: the working quantity of the Ayana strength in Shadbala, interpolated from the "
|
||||
"BPHS seven-point table with that strength's own sign rule, in degrees. Source: this report's Shadbala "
|
||||
"calculation. It is not a declination, and the two columns cannot stand in for each other."),
|
||||
"seven-point table with that strength's own sign rule, in degrees. Calculated by this report's Shadbala "
|
||||
"routine. It is not a declination, and the two columns cannot stand in for each other."),
|
||||
("速度:行星黄经每天的变化,单位是度/日,逆行为负。" if zh else
|
||||
"Speed: daily change of the planet's longitude in degrees per day; negative when retrograde."),
|
||||
]
|
||||
@@ -2390,7 +2394,7 @@ def _avastha_method(entry: dict, language: str) -> str:
|
||||
if status == "simplified_heuristic":
|
||||
return "简化规则" if language == "zh" else "Simplified rule"
|
||||
if status == "pvr_15_4_4_running_ghati":
|
||||
return "PVR 15.4.4,按出生后的 ghati" if language == "zh" else "PVR 15.4.4, running ghati"
|
||||
return "按出生后的 ghati" if language == "zh" else "Running ghati"
|
||||
return "—"
|
||||
|
||||
|
||||
@@ -2506,11 +2510,6 @@ def _goel(packet: dict, language: str) -> str:
|
||||
points = jaimini.get("goel_special_points") if isinstance(jaimini, dict) else {}
|
||||
if not isinstance(strength, dict):
|
||||
strength = {}
|
||||
citation = (
|
||||
"出处:V. P. Goel《Predicting through Jaimini Astrology》,印刷页 10–17。"
|
||||
if language == "zh"
|
||||
else "Source: V. P. Goel, Predicting through Jaimini Astrology, printed pages 10-17."
|
||||
)
|
||||
policy = show(strength.get("node_occupancy_policy"), language)
|
||||
ak = show(strength.get("atmakaraka"), language, "planet")
|
||||
intro = _rows_from([{"policy": policy, "atmakaraka": ak, "status": strength.get("status")}], language, [("policy", "text"), ("atmakaraka", "text"), ("status", "text")])
|
||||
@@ -2561,8 +2560,8 @@ def _goel(packet: dict, language: str) -> str:
|
||||
"value": item.get("value"),
|
||||
"rule": item.get("rule"),
|
||||
})
|
||||
# BUG-2129: no book citation line in front of the reader.
|
||||
return "\n\n".join([
|
||||
citation,
|
||||
intro,
|
||||
_rows_from(planet_rows, language, [("planet", "planet"), ("sign", "sign"), ("degree", "text"), ("dignity", "text"), ("total", "text"), ("example_total", "text")]),
|
||||
_rows_from(rashi_rows, language, [("sign", "sign"), ("lord", "planet"), ("permanent", "text"), ("occupant", "text"), ("total", "text"), ("example_total", "text")]),
|
||||
|
||||
@@ -183,11 +183,11 @@ def tithi_lord_lines(module: Any, language: str, dignity_label=None) -> list[str
|
||||
place = (f"{sign_name(module.get('lord_sign'), language)}" + (f",第 {house} 宫" if house else "")) if zh \
|
||||
else (f"{sign_name(module.get('lord_sign'), language)}" + (f", house {house}" if house else ""))
|
||||
caption = (
|
||||
"算法:Tithi 由月亮与太阳的黄经差每 12° 一段得出,共 30 个;主星按 PVR Narasimha Rao《Vedic Astrology: An Integrated Approach》表 3 查得,"
|
||||
"算法:Tithi 由月亮与太阳的黄经差每 12° 一段得出,共 30 个;主星按 Tithi 主星表查得,"
|
||||
"满月的主星是土星,新月的主星是罗睺。这里只列 Tithi 主星,不是 Tithi 之神,也不是月亮所在星宿的主星;仅有主星不构成应期。"
|
||||
if zh else
|
||||
"Method: a Tithi is each 12° of the Moon's longitude minus the Sun's, 30 in all; the lord is read from Table 3 of PVR Narasimha Rao, "
|
||||
"Vedic Astrology: An Integrated Approach, where the Full Moon's lord is Saturn and the New Moon's is Rahu. Only the Tithi lord is listed here — "
|
||||
"Method: a Tithi is each 12° of the Moon's longitude minus the Sun's, 30 in all; the lord is read from the Tithi lord table, "
|
||||
"where the Full Moon's lord is Saturn and the New Moon's is Rahu. Only the Tithi lord is listed here — "
|
||||
"not the Tithi deity and not the lord of the Moon's nakshatra; the lord alone does not make a timing window."
|
||||
)
|
||||
rows = [
|
||||
@@ -196,7 +196,6 @@ def tithi_lord_lines(module: Any, language: str, dignity_label=None) -> list[str
|
||||
("半月内序号(1–15)" if zh else "Number in the paksha (1-15)", module.get("tithi_in_paksha")),
|
||||
("名称" if zh else "Name", _name_zh(module) if zh else module.get("name")),
|
||||
("主星" if zh else "Lord", lord_text),
|
||||
("主星出处" if zh else "Source of the lord", "PVR 表 3" if zh else "PVR Table 3"),
|
||||
("主星在本命盘的位置" if zh else "Lord's natal position", place or ("星盘没有给出" if zh else "Not given by the chart")),
|
||||
("主星的原始尊贵" if zh else "Lord's original dignity", dignity),
|
||||
("落陷化解条件(另列,不改写原始尊贵)" if zh else "Debilitation cancellation (separate; never rewrites the dignity)", cancel),
|
||||
|
||||
@@ -418,9 +418,9 @@ def _auxiliary_chapter(packet: dict, chart: dict, language: str) -> str:
|
||||
section = copied.get("niryaana_shoola") if isinstance(copied.get("niryaana_shoola"), dict) else {}
|
||||
periods = _third_only(section.get("periods") or [])
|
||||
caveat = (
|
||||
"PVR gives no separate sub-period rule for Niryaana Shoola; these rows follow the upstream export and are for comparison only."
|
||||
"There is no separate sub-period rule for Niryaana Shoola; these rows divide each period into equal parts and are for comparison only."
|
||||
if language == "en"
|
||||
else "PVR 原书没有单列 Niryaana Shoola 的子运规则;这里按上游导出的口径列出,只作对照。"
|
||||
else "Niryaana Shoola 没有单列的子运规则;这里把每段平均分开列出,只作对照。"
|
||||
)
|
||||
body = rule + "\n\n" + caveat + "\n\n" + (_third_table(periods, language) if periods else _reason(
|
||||
language,
|
||||
@@ -555,9 +555,9 @@ def _kalachakra(packet: dict, language: str) -> str:
|
||||
if isinstance(module, dict) and module.get("method_profile") == "pvr_classical_nine_sign_md_ad":
|
||||
# BUG-1656: the classical module already has PVR ch.24 third-level rows.
|
||||
classical_note = (
|
||||
"Sign periods start from the natal Moon longitude (PVR ch. 24). The third level divides each sub-period by the same published proportions."
|
||||
"Sign periods start from the natal Moon longitude. The third level divides each sub-period by the same proportions."
|
||||
if language == "en"
|
||||
else "按本命月亮实际经度起算(PVR 第 24 章)。次小运把每个小运按书中同一比例再分一层。"
|
||||
else "按本命月亮实际经度起算。次小运把每个小运按同一比例再分一层。"
|
||||
)
|
||||
shaped = _kalachakra_nested(module)
|
||||
if not shaped:
|
||||
|
||||
@@ -136,14 +136,22 @@ def test_drig_uses_narayana_years_and_matches_pvr_aurobindo() -> None:
|
||||
|
||||
def test_drig_and_sthira_notes_are_shown(fictional) -> None:
|
||||
_packet, chinese, english = fictional
|
||||
assert "每个星座的年数与本站 Narayana 大运同一套规则(PVR 21.2(5)),包括双主星择强与入旺、落陷调整。" in chinese
|
||||
assert "each sign's years follow this site's Narayana rules (PVR 21.2(5))" in english
|
||||
# 原值: 「…同一套规则(PVR 21.2(5)),…」/ "Narayana rules (PVR 21.2(5))"
|
||||
# 新值: 不带书的章节号
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "每个星座的年数与本站 Narayana 大运同一套规则,包括双主星择强与入旺、落陷调整。" in chinese
|
||||
assert "each sign's years follow this site's Narayana rules, including" in english
|
||||
assert "21.2(5)" not in chinese and "21.2(5)" not in english
|
||||
assert "Brahma 按 Goel 完整方法定为" in chinese and "Brahma by Goel's full method:" in english
|
||||
|
||||
|
||||
def test_shadbala_threshold_is_profile_sensitive_not_a_verdict(fictional) -> None:
|
||||
_packet, chinese, english = fictional
|
||||
assert "太阳的 Cheshta 等于他的 Ayana Bala,月亮的 Cheshta 等于她的 Paksha Bala(BPHS 27.18)" in chinese
|
||||
assert "this is the text's rule, not double counting, and nothing is doubled" in english
|
||||
# 原值: 「…Paksha Bala(BPHS 27.18)…这是原文规定」/ "this is the text's rule"
|
||||
# 新值: 不写偈号,「这是规则本身的规定」/ "this is the rule itself"
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "太阳的 Cheshta 等于他的 Ayana Bala,月亮的 Cheshta 等于她的 Paksha Bala,所以" in chinese
|
||||
assert "this is the rule itself, not double counting, and nothing is doubled" in english
|
||||
assert "BPHS 27.18" not in chinese and "BPHS 27.18" not in english
|
||||
assert "达标只说明力量,不等于吉;未达标也不等于凶" in chinese
|
||||
assert "Meeting the minimum describes strength only and is not a favourable verdict" in english
|
||||
|
||||
@@ -121,8 +121,11 @@ def test_empty_packet_chapters_are_headed_and_do_not_print_raw_keys() -> None:
|
||||
assert "来源感知口径" not in zh.split("#### 旧算法(只作对照)", 1)[1]
|
||||
assert en.index("#### Sanjay Rath version (default)") < en.index("#### Source-aware method (comparison)") < en.index("#### Legacy method (comparison only)")
|
||||
assert "Source-aware method" not in en.split("#### Legacy method (comparison only)", 1)[1]
|
||||
assert "印刷页 10" in zh
|
||||
assert "printed pages 10-17" in en
|
||||
# 原值: Goel 一节首行「出处:V. P. Goel《…》,印刷页 10–17。」/ "printed pages 10-17"
|
||||
# 新值: 不写出处行
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "印刷页" not in zh and "Goel《" not in zh
|
||||
assert "printed pages" not in en and "Source: V. P. Goel" not in en
|
||||
for banned in ("source_locator", "profile_id", "niryaana_shoola_strength", "source_discrepancy", "sign_idx"):
|
||||
assert banned not in zh
|
||||
assert banned not in en
|
||||
@@ -244,7 +247,10 @@ def test_three_fictional_charts_render_the_same_chapters(fictional_reports: dict
|
||||
en_clean = _without_narayana_candidate_fields(_without_report_status_cells(en), "Narayana Method Comparison")
|
||||
assert _SNAKE.search(zh_clean.replace("PVR 表 30(pvr_table30_v1)", "PVR 表 30")) is None
|
||||
assert _SNAKE.search(en_clean.replace("PVR Table 30 (pvr_table30_v1)", "PVR Table 30")) is None
|
||||
assert "印刷页 10" in zh and "printed pages 10-17" in en
|
||||
# 原值: assert "印刷页 10" in zh and "printed pages 10-17" in en
|
||||
# 新值: 都不出现
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "印刷页" not in zh and "printed pages" not in en
|
||||
# 原值:「来源感知口径」「既有口径」;新值:Rath 默认 + 两节对照;原因:BUG-1601
|
||||
assert "#### Sanjay Rath 版(默认)" in zh and "#### 来源感知口径(对照)" in zh and "#### 旧算法(只作对照)" in zh
|
||||
assert "#### Sanjay Rath version (default)" in en and "#### Legacy method (comparison only)" in en
|
||||
|
||||
@@ -85,7 +85,10 @@ def test_reader_table_names_signs_and_drops_the_simplified_label(modules: dict)
|
||||
heading = markdown[start:markdown.index("\n", start)]
|
||||
assert "简化模型" not in heading
|
||||
assert "简化模型" not in section
|
||||
assert "PVR 第 24 章" in section
|
||||
# 原值: assert "PVR 第 24 章" in section
|
||||
# 新值: 只写起算方法,不写章节号
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "按本命月亮实际经度起算" in section and "PVR 第 24 章" not in section
|
||||
first_row = next(line for line in section.splitlines() if line.startswith("| 1 |"))
|
||||
assert "天蝎座" in first_row or "Scorpio" in first_row
|
||||
|
||||
@@ -93,5 +96,6 @@ def test_reader_table_names_signs_and_drops_the_simplified_label(modules: dict)
|
||||
def test_research_third_level_reads_the_classical_rows(modules: dict) -> None:
|
||||
text = _kalachakra({"timing_and_predictive_systems": {"kalachakra_dasha": modules["kalachakra_dasha"]}}, "zh")
|
||||
assert "简化模型" not in text
|
||||
assert "PVR 第 24 章" in text
|
||||
# 原值: assert "PVR 第 24 章" in text(同上)
|
||||
assert "按本命月亮实际经度起算" in text and "PVR 第 24 章" not in text
|
||||
assert "| 次小运 |" in text
|
||||
|
||||
@@ -22,6 +22,8 @@ from scripts.narayana_legacy_label import (
|
||||
LEGACY_PROFILE,
|
||||
RATH_LABEL_EN,
|
||||
RATH_LABEL_ZH,
|
||||
RATH_REPORT_LABEL_EN,
|
||||
RATH_REPORT_LABEL_ZH,
|
||||
)
|
||||
from scripts.pl9_reader_export import _pl9_export_markdown_for_edition
|
||||
from tests.test_report_english_edition import CASES, _packet
|
||||
@@ -34,10 +36,13 @@ def test_report_module_and_reference_edition_carry_the_label() -> None:
|
||||
# 原值:full_data 版含「- 算法:{旧算法说明}」,模块顶层是旧算法(profile legacy_reference_only)
|
||||
# 新值:「- 算法:」是 Sanjay Rath 版(默认),旧算法写成「- 对照:」;模块顶层是 Rath,旧算法在 legacy 下
|
||||
# 原因:#166 Q9 产品决定 2026-11-04,Rath 成为默认(BUG-1601)
|
||||
# 原值(2): 报告行「- 算法:{RATH_LABEL_ZH}」(含「按原书 p.43 正文(第七轮裁定)」)
|
||||
# 新值(2): 报告行用 RATH_REPORT_LABEL_ZH「Sanjay Rath 版(默认)」;模块里的标签不变
|
||||
# 原因(2): BUG-2129 负责人 2026-11-21:报告不写书页和内部裁定轮次
|
||||
zh = _pl9_export_markdown_for_edition(copy.deepcopy(packet), "full_data")
|
||||
assert f"- 算法:{RATH_LABEL_ZH}" in zh
|
||||
assert f"- 算法:{RATH_REPORT_LABEL_ZH}" in zh and "p.43" not in zh
|
||||
assert f"- 对照:{LEGACY_NOTE_ZH}" in zh
|
||||
assert zh.index(f"- 算法:{RATH_LABEL_ZH}") < zh.index(f"- 对照:{LEGACY_NOTE_ZH}")
|
||||
assert zh.index(f"- 算法:{RATH_REPORT_LABEL_ZH}") < zh.index(f"- 对照:{LEGACY_NOTE_ZH}")
|
||||
from scripts.jyotish_engine import cmd_full_reading
|
||||
|
||||
reading = cmd_full_reading(type("Args", (), dict(CASES["day"]))())
|
||||
@@ -120,7 +125,7 @@ def test_reference_edition_shows_both_and_english_terms_cover_the_rath_lines() -
|
||||
# 新值:先「- 算法:Sanjay Rath 版(默认…):起运宫」与 Rath 表,后「- 对照:{旧算法}」
|
||||
# 原因:BUG-1601(#166 Q9)Rath 成为默认
|
||||
zh = _pl9_export_markdown_for_edition(copy.deepcopy(packet), "full_data")
|
||||
rath = zh.index(f"- 算法:{RATH_LABEL_ZH}:起运宫 ")
|
||||
rath = zh.index(f"- 算法:{RATH_REPORT_LABEL_ZH}:起运宫 ") # BUG-2129: report label
|
||||
legacy = zh.index(f"- 对照:{LEGACY_NOTE_ZH}")
|
||||
assert rath < legacy
|
||||
assert "| Rath MD | 星座 | 宫主 | 起始年龄 | 结束年龄 | 基本年数 | 修正 | 最终 | 日期 |" in zh
|
||||
@@ -130,9 +135,9 @@ def test_reference_edition_shows_both_and_english_terms_cover_the_rath_lines() -
|
||||
english_packet["report_language"] = "en"
|
||||
en = _pl9_export_markdown_for_edition(english_packet, "full_data")
|
||||
lines = [line for line in rath_report_lines_en(view) if line]
|
||||
assert lines and lines[0].startswith(f"- Algorithm: {RATH_LABEL_EN}:")
|
||||
assert lines and lines[0].startswith(f"- Algorithm: {RATH_REPORT_LABEL_EN}:") # BUG-2129: report label
|
||||
assert not re.search(r"[一-鿿]", "\n".join(lines))
|
||||
start = en.index(f"- Algorithm: {RATH_LABEL_EN}:")
|
||||
start = en.index(f"- Algorithm: {RATH_REPORT_LABEL_EN}:")
|
||||
section = en[start:start + 2500]
|
||||
assert "level " in section and "[source text retained" not in section
|
||||
assert not re.search(r"[一-鿿]", section)
|
||||
|
||||
@@ -386,14 +386,20 @@ def test_jobs_chapter_names_the_method_and_lists_the_upstream_tables() -> None:
|
||||
# 原值: assert "pvr_niryaana_shoola_v1" in niryaana(方法行印出 profile id)
|
||||
# 新值: 方法行写方法名「PVR Niryaana Shoola」,不印 id
|
||||
# 原因: BUG-2095 读者正文不出现内部代码
|
||||
assert "本站选用的方法:PVR Niryaana Shoola," in niryaana and "pvr_niryaana_shoola_v1" not in niryaana
|
||||
# 原值: 「本站选用的方法:PVR Niryaana Shoola,出处:…」
|
||||
# 新值: 方法名后直接接「;未与外部软件逐一核对」,不写出处
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "本站选用的方法:PVR Niryaana Shoola;" in niryaana and "pvr_niryaana_shoola_v1" not in niryaana
|
||||
assert "出处" not in text and "印页" not in text
|
||||
# 原值:"子运规则未定,暂不列出。",子表表头 "| 序号 | 主运 | 子运 |"
|
||||
# 新值:"小运规则未定,暂不列出。",子表表头 "| 序号 | 大运 | 小运 |"
|
||||
# 原因:报告运期名称按占星师口径(issue #163 Q5):星座运第一层大运、第二层小运
|
||||
# 原值:"小运规则未定,暂不列出。",没有小运表。
|
||||
# 新值:写明原书没有单列小运规则、按上游口径只作对照,并列出小运表。
|
||||
# 原因:产品负责人 2026-11-06 决定按上游导出补 Niryaana Shoola 子运。
|
||||
assert "原书没有单列小运规则" in niryaana and "只作对照" in niryaana
|
||||
# 原值: 「原书没有单列小运规则」 新值: 「没有单列的小运规则」
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "没有单列的小运规则" in niryaana and "只作对照" in niryaana and "原书" not in niryaana
|
||||
assert "| 序号 | 大运 | 小运 |" in niryaana
|
||||
assert "子运" not in text and "主运" not in text
|
||||
assert "本站选用的方法:" in text
|
||||
@@ -411,7 +417,11 @@ def test_jobs_chapter_names_the_method_and_lists_the_upstream_tables() -> None:
|
||||
# 原值: assert "pvr_niryaana_shoola_v1" in english_niryaana
|
||||
# 新值: the method line names "PVR Niryaana Shoola", no profile id
|
||||
# 原因: BUG-2095 读者正文不出现内部代码
|
||||
assert "Method used on this site: PVR Niryaana Shoola," in english_niryaana and "pvr_niryaana_shoola_v1" not in english_niryaana
|
||||
# 原值: "Method used on this site: PVR Niryaana Shoola, source: …"
|
||||
# 新值: no source clause
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "Method used on this site: PVR Niryaana Shoola;" in english_niryaana and "pvr_niryaana_shoola_v1" not in english_niryaana
|
||||
assert "source:" not in english and "printed page" not in english
|
||||
assert "for comparison only" in english_niryaana
|
||||
assert "Upstream candidate profile" in english
|
||||
assert "not checked one-by-one against external software." in english
|
||||
|
||||
@@ -138,10 +138,15 @@ def test_neecha_pages_split_by_planet_and_rule_version_but_not_by_condition():
|
||||
names = [page["name"] for page in pages]
|
||||
assert len(names) == 3 and len(set(names)) == 3, names
|
||||
if language == "zh":
|
||||
assert "落陷取消(水星)" in names and "落陷取消(火星;出处:Other text)" in names
|
||||
# 原值: 「落陷取消(火星;出处:Other text)」
|
||||
# 新值: 两个规则版本按序号区分「规则版本 1 / 2」,不写出处
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告不写书名出处
|
||||
assert "落陷取消(水星)" in names and "落陷取消(火星;规则版本 2)" in names
|
||||
assert not any("出处" in name for name in names)
|
||||
assert "原始落陷位置:火星落陷于巨蟹座。" in pages[0]["sections"]["detected"]
|
||||
else:
|
||||
assert "Neecha Bhanga (Mercury)" in names and "Neecha Bhanga (Mars; rule from Other text)" in names
|
||||
assert "Neecha Bhanga (Mercury)" in names and "Neecha Bhanga (Mars; rule version 2)" in names
|
||||
assert not any("rule from" in name for name in names)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case_id", PUBLIC_REPORT_CASES)
|
||||
|
||||
@@ -14,8 +14,11 @@ from scripts.report_render.conditional_dasha_pvr_2014 import pvr_variant_rows
|
||||
from tests.public_chart_reports import public_chart_reports
|
||||
|
||||
PERIOD = [{"lord": "Sun", "start_date": "2000-01-01", "end_date": "2006-01-01"}]
|
||||
EN_SUFFIX = ", PVR unified nakshatra-dasa reading (2014)"
|
||||
ZH_SUFFIX = ",PVR 统一星宿大运读法(2014)"
|
||||
# 原值: ", PVR unified nakshatra-dasa reading (2014)" /「,PVR 统一星宿大运读法(2014)」
|
||||
# 新值: 读法名不带作者
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现作者、书名和文章名
|
||||
EN_SUFFIX = ", Unified nakshatra-dasa reading (2014)"
|
||||
ZH_SUFFIX = ",统一星宿大运读法(2014)"
|
||||
|
||||
|
||||
def _rows(markdown: str) -> dict[str, list[str]]:
|
||||
@@ -122,7 +125,10 @@ def test_public_fixtures_show_both_readings_in_both_editions() -> None:
|
||||
assert en_rows["Dwisaptati Sama"][3] == product_met
|
||||
assert en_rows["Dwisaptati Sama" + EN_SUFFIX][3] == "Not met"
|
||||
assert zh_rows["Dwisaptati Sama" + ZH_SUFFIX][3] == "不成立"
|
||||
assert "Unified Nakshatra Dasa Approach" in en and "Unified Nakshatra Dasa Approach" in zh
|
||||
# 原值: assert "Unified Nakshatra Dasa Approach" in en and … in zh(表注写文章名)
|
||||
# 新值: 表注不写作者和文章名
|
||||
# 原因: BUG-2129
|
||||
assert "Unified Nakshatra Dasa Approach" not in en + zh and "Narasimha Rao" not in en + zh
|
||||
assert "没有按宫头度数另划宫界" in zh and "not by house-cusp degrees" in en
|
||||
for text in (en, zh):
|
||||
assert "pvr_unified" not in text and "seventh_lord" not in text and "pp_cond_dasas" not in text
|
||||
|
||||
@@ -69,7 +69,10 @@ def test_rath_english_lines_cover_levels_tables_and_book_divergence() -> None:
|
||||
assert "house " not in lines
|
||||
assert f"level {level}: {STRENGTH_LEVEL_EN[level]}" in lines
|
||||
assert DIRECTION_EN[direction] in lines
|
||||
assert "the book itself disagrees, not applied:" in lines
|
||||
# 原值: "the book itself disagrees, not applied:"
|
||||
# 新值: "another statement, not applied:"
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告不提书和书页
|
||||
assert "another statement, not applied:" in lines
|
||||
ketu = "\n".join(rath_report_lines_en(_rath_view(level=5, direction="table12_ketu_reversed", with_divergence=True)))
|
||||
assert "level 5: lord's degree in sign" in ketu
|
||||
assert "Ketu in the start sign: reversed (Table 12)" in ketu
|
||||
|
||||
@@ -283,8 +283,11 @@ def test_settings_add_only_what_the_profile_carries() -> None:
|
||||
|
||||
def test_shayanadi_method_has_reader_text() -> None:
|
||||
entry = {"method_status": "pvr_15_4_4_running_ghati"}
|
||||
assert pc._avastha_method(entry, "en") == "PVR 15.4.4, running ghati"
|
||||
assert pc._avastha_method(entry, "zh") == "PVR 15.4.4,按出生后的 ghati"
|
||||
# 原值: "PVR 15.4.4, running ghati" /「PVR 15.4.4,按出生后的 ghati」
|
||||
# 新值: 不写书的节号
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert pc._avastha_method(entry, "en") == "Running ghati"
|
||||
assert pc._avastha_method(entry, "zh") == "按出生后的 ghati"
|
||||
assert pc._avastha_method({"method_status": "simplified_heuristic"}, "en") == "Simplified rule"
|
||||
|
||||
|
||||
|
||||
@@ -112,8 +112,12 @@ def test_yoga_pages_are_keyed_by_rule_in_both_editions():
|
||||
for title in ("Amala Yoga (Benefics in the 10th/11th houses)", "Amala Yoga (Only benefics in the 10th house)",
|
||||
"Durmukha Yoga (Malefic in the 2nd house)",
|
||||
"Mangal Dosha (Mars in 1/4/7/8/12) (Mars in house 8)",
|
||||
"Mangal Dosha (Mars in 1/4/7/8/12) (rule from classical texts)"):
|
||||
# 原值: "Mangal Dosha (Mars in 1/4/7/8/12) (rule from classical texts)"
|
||||
# 新值: 不写出处,另一条已有条件说明,所以这条不加括号
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告不写书名出处
|
||||
"Mangal Dosha (Mars in 1/4/7/8/12)"):
|
||||
assert title in en
|
||||
assert not any("rule from" in title for title in en)
|
||||
assert "Combination: ." not in english and "Combination: ;" not in english
|
||||
_packet, obama_zh, obama_en = public_chart_reports(OBAMA)
|
||||
assert len(_section_pages(obama_zh, "### 瑜伽解释")) == len(_section_pages(obama_en, "### Yoga interpretation"))
|
||||
|
||||
@@ -92,7 +92,12 @@ def test_current_periods_keep_module_label_and_exact_engine_dates(case_id):
|
||||
# 原值: 中英文开篇都带模块的算法标签(assert module[label] in opening)
|
||||
# 新值: 中文开篇不带,标签仍在报告后面的 Narayana 章节;英文开篇照旧
|
||||
# 原因: BUG-2038,复测第九轮;开篇是读者正文,算法版本与出处是后台信息(占星师 2026-11-19 分层答复)
|
||||
assert module[label] in (report if language == "zh" else opening)
|
||||
# 原值(2): assert module[label] in …(模块标签原样,含「按原书 p.43 正文(第七轮裁定)」)
|
||||
# 新值(2): 报告里是去掉书页和裁定轮次的标签
|
||||
# 原因(2): BUG-2129 负责人 2026-11-21:报告不写书页和内部裁定轮次
|
||||
from scripts.narayana_legacy_label import report_rath_label
|
||||
shown = report_rath_label(module[label], language)
|
||||
assert "p.43" not in shown and shown in (report if language == "zh" else opening)
|
||||
if language == "zh":
|
||||
assert module[label] not in opening
|
||||
audit = _dual_dasha_note(packet["worksheets"][TIMING], language)
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
"""BUG-2129: the reader's report carries no book titles, authors as citations, pages or chapter numbers.
|
||||
|
||||
Owner 2026-11-21: 「书名引文去掉」 (after BUG-2115 removed library names and 「来源」 lines).
|
||||
The method's name may stay (for example 「PVR 表 30」 as a named profile); the book, page,
|
||||
table-in-the-book, chapter, verse and internal ruling round do not.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
||||
from scripts.narayana_legacy_label import RATH_LABEL_EN, RATH_LABEL_ZH, report_rath_label
|
||||
from scripts.rashi_dasha_report import _method_line
|
||||
from scripts.report_render.book_refs import strip_book_refs
|
||||
from scripts.report_render.functional_layer_table import functional_layer_rows
|
||||
from tests.public_chart_reports import PUBLIC_REPORT_CASES, public_chart_reports
|
||||
|
||||
BOOK_TITLES = (
|
||||
"Predicting through Jaimini", "Vedic Astrology: An Integrated Approach", "Integrated Approach",
|
||||
"Unified Nakshatra Dasa Approach", "Light on Life", "Crux of Vedic Astrology", "吠陀占星精要",
|
||||
"印度占星生命之光", "Yogini Dasha 实战预测", "帕拉沙拉占星经典", "Narasimha Rao", "V. P. Goel",
|
||||
)
|
||||
CITATION = re.compile(
|
||||
r"出处:|印刷页|印页|PDF 页|printed page|Source:|, source:|原书|书中|书内分歧|the book itself"
|
||||
r"|\bp\.\s?\d|§\s?\d|第 \d+ 章|第 \d+(?:\.\d+)+ 节|\bch\.\s?\d|第[一二三四五六七八九十]+轮|round-\d|PVR 21\.2|BPHS 27\.18|PVR 15\.4\.4"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("case_id", PUBLIC_REPORT_CASES)
|
||||
def test_public_reports_have_no_book_citations(case_id: str) -> None:
|
||||
_packet, zh, en = public_chart_reports(case_id)
|
||||
for text in (zh, en):
|
||||
hits = [title for title in BOOK_TITLES if title in text]
|
||||
assert hits == [], hits
|
||||
assert CITATION.findall(text) == [], sorted(set(CITATION.findall(text)))
|
||||
assert not re.search(r"《(?!D\d)[^》]{2,}》", text), re.findall(r"《[^》]+》", text)[:5]
|
||||
|
||||
|
||||
def test_strip_book_refs_keeps_the_method_and_drops_the_reference() -> None:
|
||||
assert strip_book_refs("按大运星座奇偶(p.50 规则 (12) 与注 2)") == "按大运星座奇偶"
|
||||
assert strip_book_refs("by the odd/even of the AD start sign (Table 13 / Table 25; round-6 Q7)") == \
|
||||
"by the odd/even of the AD start sign"
|
||||
assert strip_book_refs("J.S. 2.4.31–32 看大运星座或其宫主所落星座") == "看大运星座或其宫主所落星座"
|
||||
# A parenthetical without a reference stays.
|
||||
assert strip_book_refs("第 2 级(宫位 (3))") == "第 2 级(宫位 (3))"
|
||||
|
||||
|
||||
def test_narayana_label_and_method_lines_name_the_method_only() -> None:
|
||||
assert report_rath_label(RATH_LABEL_ZH, "zh") == "Sanjay Rath 版(默认)"
|
||||
assert report_rath_label(RATH_LABEL_EN, "en") == "Sanjay Rath version (default)"
|
||||
section = {"status": "listed", "profile_id": "goel_method_1_v1", "source_zh": "某书,印页 1", "source_en": "A book, page 1"}
|
||||
assert "出处" not in _method_line(section, "zh") and "印页" not in _method_line(section, "zh")
|
||||
assert "source" not in _method_line(section, "en") and "page" not in _method_line(section, "en")
|
||||
|
||||
|
||||
def test_functional_table_has_no_profile_source_row() -> None:
|
||||
functional = {
|
||||
"functional_profile": "pvr_table30_v1",
|
||||
"profile_source": "PVR Narasimha Rao, Vedic Astrology: An Integrated Approach, §13.2 Table 30 (p. 167; PDF p. 179)",
|
||||
"dual_lordship_note": "PVR §13.2:管两个星座的行星要把两宫的指示综合判断。",
|
||||
"dual_lordship_note_en": "PVR §13.2: for a planet owning two rasis the two indications must be judiciously combined.",
|
||||
"conditions": ["Dual lordship needs an integrated judgment of both houses (PVR §13.2)."],
|
||||
}
|
||||
for language in ("zh", "en"):
|
||||
text = "\n".join(" | ".join(row) for row in functional_layer_rows(functional, language))
|
||||
assert "Integrated Approach" not in text and "§13.2" not in text and "第 13.2 节" not in text, text
|
||||
assert "口径出处" not in text and "Profile source" not in text
|
||||
@@ -100,8 +100,11 @@ def test_technique_audit_condition_is_written_in_words():
|
||||
|
||||
def test_rashi_dasha_method_is_named_not_coded():
|
||||
section = {"status": "listed", "profile_id": "goel_method_1_v1", "source_zh": "某书,印页 1", "source_en": "A book, page 1"}
|
||||
assert _method_line(section, "zh") == "本站选用的方法:Goel 第一法,出处:某书,印页 1;未与外部软件逐一核对。"
|
||||
assert _method_line(section, "en").startswith("Method used on this site: Goel method 1, source: A book, page 1;")
|
||||
# 原值: 「本站选用的方法:Goel 第一法,出处:某书,印页 1;…」/ "…Goel method 1, source: A book, page 1;"
|
||||
# 新值: 只写方法名
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert _method_line(section, "zh") == "本站选用的方法:Goel 第一法;未与外部软件逐一核对。"
|
||||
assert _method_line(section, "en") == "Method used on this site: Goel method 1; not checked one-by-one against external software."
|
||||
|
||||
|
||||
def test_kp_significator_levels_are_words_not_letters():
|
||||
|
||||
@@ -71,8 +71,11 @@ def test_coordinates_table_has_both_columns_with_definition_unit_and_source() ->
|
||||
real = declinations_for_packet(packet)["planets"]
|
||||
for language, header, word in (
|
||||
("en", ["Planet", "Equatorial declination (°, north positive)", "Ayana intermediate angle (°)", "Speed (°/day)"],
|
||||
"Source: read from the ephemeris"),
|
||||
("zh", ["行星", "赤道赤纬(度,北为正)", "Ayana 中间角(度)", "速度(度/日)"], "出处:按出生时刻由星历"),
|
||||
# 原值: "Source: read from the ephemeris" /「出处:按出生时刻由星历」
|
||||
# 新值: 不带「出处:」/ "Source:" 前缀,说明照写
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告不写「出处」行
|
||||
"Read from the ephemeris"),
|
||||
("zh", ["行星", "赤道赤纬(度,北为正)", "Ayana 中间角(度)", "速度(度/日)"], "按出生时刻由星历"),
|
||||
):
|
||||
text = pc._coordinates(packet, language)
|
||||
rows = _table(text)
|
||||
@@ -314,7 +317,11 @@ def test_applicability_section_prints_rule_inputs_reason_and_table_state() -> No
|
||||
# 原值: "This report does not calculate those readings" /「本报告没有按那些读法计算」
|
||||
# 新值: 另一读法各占一行(PVR unified nakshatra-dasa reading (2014) /「PVR 统一星宿大运读法(2014)」),说明写出处和范围
|
||||
# 原因: BUG-2122 占星师第 11 问:PVR 2014 读法作为单独具名读法列出,不替换本报告所用的条件
|
||||
assert "Panchottari, PVR unified nakshatra-dasa reading (2014)" in en and "Panchottari,PVR 统一星宿大运读法(2014)" in zh
|
||||
# 原值(BUG-2129 前): "Panchottari, PVR unified nakshatra-dasa reading (2014)" /「Panchottari,PVR 统一星宿大运读法(2014)」
|
||||
# 新值: 读法名不带作者
|
||||
# 原因: BUG-2129 负责人 2026-11-21:报告里不给读者出现书名、作者出处、页码和章节号
|
||||
assert "Panchottari, Unified nakshatra-dasa reading (2014)" in en and "Panchottari,统一星宿大运读法(2014)" in zh
|
||||
assert "Narasimha Rao" not in en + zh and "PVR 统一" not in zh
|
||||
for text in (en, zh):
|
||||
assert "bphs_" not in text and "rule_family" not in text and "classical_applicable" not in text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user