#!/usr/bin/env python3 """Optional in-process Panchavargiya lookup for the year-lord research switch. Not on the default full-reading, report, or consultation path. Tajika calls this only when a score was requested with an annual Julian day. The product year-lord path leaves that day empty unless ``JYOTISH_YEAR_LORD_PYJHORA_REFERENCE=1``. """ from __future__ import annotations def external_panchavargiya_score( planet: str, *, annual_jd: float, lat: float, lon: float, tz: float, planet_index: int | None, ) -> dict | None: del planet from jhora.horoscope.chart import strength as j_strength from jhora.panchanga import drik as j_drik place = j_drik.Place("annual_year_lord_probe", float(lat), float(lon), float(tz)) # Annual-chart APIs take the local civil JD. ``annual_jd`` arrives as UT. scores = j_strength.pancha_vargeeya_bala(float(annual_jd) + float(tz) / 24.0, place) if planet_index is None: return None score = float(scores[planet_index]) return { "score": score, "engine": "pyjhora", "components": {"pyjhora_pancha_vargeeya_bala": score}, }