Files
Jyotisha/scripts/pyjhora_panchavargiya_reference.py
T
jesse-ux 795b8845c7
Independent Staging Quality Gate / validate (push) Successful in 19m4s
Independent Staging Quality Gate / publish (push) Successful in 3m51s
fix(special-lagnas): compute eight birth points without PyJHora
Production images do not install PyJHora, so those eight points were blocked.
Swiss Ephemeris now computes them in-process. Rectification keeps the old
Hora and Ghati formulas.

BUG-1273.
2026-10-08 15:01:44 +08:00

37 lines
1.1 KiB
Python

#!/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},
}