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.
This commit is contained in:
+15
-15
@@ -15,6 +15,7 @@ Tajika/Varshaphala年运盘模块 v1.0
|
||||
from typing import Dict, List, Optional
|
||||
from datetime import datetime, timedelta
|
||||
from decimal import Decimal, ROUND_HALF_UP
|
||||
import importlib
|
||||
import math
|
||||
import json
|
||||
import os
|
||||
@@ -1403,21 +1404,20 @@ def _external_pyjhora_panchavargiya_score(
|
||||
if annual_jd is None or lat is None or lon is None or tz is None:
|
||||
return None
|
||||
try:
|
||||
from jhora.panchanga import drik as j_drik
|
||||
from jhora.horoscope.chart import strength as j_strength
|
||||
place = j_drik.Place('annual_year_lord_probe', float(lat), float(lon), float(tz))
|
||||
# PyJHora annual-chart APIs use the local civil JD for a Place whose
|
||||
# timezone is already supplied. ``annual_jd`` reaches us as UT.
|
||||
scores = j_strength.pancha_vargeeya_bala(float(annual_jd) + float(tz) / 24.0, place)
|
||||
planet_idx = PLANET_TO_INDEX.get(planet)
|
||||
if planet_idx is None:
|
||||
return None
|
||||
score = scores[planet_idx]
|
||||
return {
|
||||
'score': float(score),
|
||||
'engine': 'pyjhora',
|
||||
'components': {'pyjhora_pancha_vargeeya_bala': float(score)},
|
||||
}
|
||||
# The in-process reference engine lives in a PyJHora adapter module.
|
||||
# This file does not import it unless a caller actually asks for a score.
|
||||
try:
|
||||
reference = importlib.import_module("pyjhora_panchavargiya_reference")
|
||||
except ModuleNotFoundError:
|
||||
reference = importlib.import_module("scripts.pyjhora_panchavargiya_reference")
|
||||
return reference.external_panchavargiya_score(
|
||||
planet,
|
||||
annual_jd=float(annual_jd),
|
||||
lat=float(lat),
|
||||
lon=float(lon),
|
||||
tz=float(tz),
|
||||
planet_index=PLANET_TO_INDEX.get(planet),
|
||||
)
|
||||
except Exception:
|
||||
return _external_pyjhora_panchavargiya_score_sidecar(planet, annual_jd, lat, lon, tz, ayanamsa_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user