Files
Jyotisha/scripts/pyjhora_rectification_d1_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

36 lines
1.2 KiB
Python

"""Optional PyJHora D1 signs for the rectification parity packet.
The product packet calls this only for the PyJHora column. A missing install
raises, and the packet records that column as blocked.
"""
from __future__ import annotations
import importlib
from typing import Any
SIGNS = (
"Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo",
"Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces",
)
def pyjhora_d1(case: dict[str, Any]) -> dict[str, str]:
utils = importlib.import_module("jhora.utils")
charts = importlib.import_module("jhora.horoscope.chart.charts")
drik = importlib.import_module("jhora.panchanga.drik")
jd = utils.julian_day_number(
(case["year"], case["month"], case["day"]),
(case["hour"], case["minute"], case.get("second", 0)),
)
drik.set_ayanamsa_mode("LAHIRI", jd=jd)
place = drik.Place("request-level", case["lat"], case["lon"], case["tz"])
index_to_planet = {
0: "Sun", 1: "Moon", 2: "Mars", 3: "Mercury", 4: "Jupiter", 5: "Venus", 6: "Saturn",
}
return {
index_to_planet[body]: SIGNS[int(position[0])]
for body, position in charts.rasi_chart(jd, place)
if body in index_to_planet
}