Files
Jyotisha/tests/public_chart_reports.py
T
ClaudeandClaude Opus 5.5 9358cb01ff feat(annual): each report year computes its own continuous Tajika motion — exact contacts, ingresses and stations from this return to the next — cached per year and time-bounded (BUG-2315)
Ports the astrologer's transit_search.py verbatim (upstream 58f37ee5b), the
solar-return motion request and the annual condition status pack. The scan
runs only in the full-data report (report_render/annual_motion.py), never in
the chat annual card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2U3BH1SxwAGyhhbe1
2026-11-24 15:44:32 +08:00

33 lines
1.6 KiB
Python

"""Cached full-data reports for the repository's public chart fixtures."""
from copy import deepcopy
from functools import lru_cache
from scripts.jyotish_engine import build_professional_report_reference_packet, cmd_full_reading
from scripts.pl9_full_data_export import REPORT_VERSION_FULL
from scripts.pl9_reader_export import _pl9_export_markdown_for_edition
from scripts.professional_report_reference import _export_args
from scripts.report_render.annual_motion import attach_annual_motion
from scripts.report_render.expression_paths_wiring import attach_engine_expression_paths
from tests.test_consult_card_full_source import _public_body
PUBLIC_REPORT_CASES = ("steve_jobs_1955_aa", "barack_obama_1961_aa")
@lru_cache(maxsize=len(PUBLIC_REPORT_CASES))
def public_chart_reports(case_id: str) -> tuple[dict, str, str]:
args = _export_args({**_public_body(case_id), "today": "2026-11-11", "target_year": 2026})
reading = cmd_full_reading(args)
packet = dict(build_professional_report_reference_packet(reading, args, []))
packet["report_version"] = REPORT_VERSION_FULL
# BUG-2315: as the report API does (professional_report_reference._attach_annual_motion).
attach_annual_motion(packet)
# BUG-2296: as the report API does (professional_report_reference.build_professional_report_reference).
attach_engine_expression_paths(reading, packet)
chinese = _pl9_export_markdown_for_edition(packet, "full_data")
english_packet = deepcopy(packet)
english_packet["report_language"] = "en"
english = _pl9_export_markdown_for_edition(english_packet, "full_data")
return packet, chinese, english