feat: sync kp ruling planets probe fields
This commit is contained in:
@@ -10,10 +10,11 @@ from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from kp_system import calc_kp_analysis
|
||||
from kp_system import calc_kp_analysis, get_kp_lords
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
@@ -30,6 +31,10 @@ CANONICAL_PLANETS = {
|
||||
"Rahu": {"sign": "Scorpio", "degree": 17.0, "house": 8},
|
||||
"Ketu": {"sign": "Taurus", "degree": 17.0, "house": 2},
|
||||
}
|
||||
CANONICAL_MOMENT = datetime(2026, 7, 19, 12, 0, 0)
|
||||
CANONICAL_ASC_LONGITUDE = 10.0
|
||||
CANONICAL_MOON_LONGITUDE = 35.0
|
||||
WEEKDAY_LORDS = ["Moon", "Mars", "Mercury", "Jupiter", "Venus", "Saturn", "Sun"]
|
||||
|
||||
|
||||
def _stable_hash(data: Any) -> str:
|
||||
@@ -37,8 +42,24 @@ def _stable_hash(data: Any) -> str:
|
||||
return hashlib.sha256(payload.encode("utf-8")).hexdigest()
|
||||
|
||||
|
||||
def _kp_ruling_planets(moment: datetime, asc_longitude: float, moon_longitude: float) -> dict[str, Any]:
|
||||
asc = get_kp_lords(asc_longitude)
|
||||
moon = get_kp_lords(moon_longitude)
|
||||
return {
|
||||
"weekday_lord": WEEKDAY_LORDS[moment.weekday()],
|
||||
"moon_sign_lord": moon.get("rasi_lord"),
|
||||
"moon_star_lord": moon.get("nakshatra_lord"),
|
||||
"moon_sub_lord": moon.get("sub_lord"),
|
||||
"asc_sign_lord": asc.get("rasi_lord"),
|
||||
"asc_star_lord": asc.get("nakshatra_lord"),
|
||||
"asc_sub_lord": asc.get("sub_lord"),
|
||||
"source_boundary": "Minimal KP ruling-planet probe; exact horary/timing use requires question-time location and external worked examples.",
|
||||
}
|
||||
|
||||
|
||||
def build_probe() -> dict[str, Any]:
|
||||
raw = calc_kp_analysis(CANONICAL_PLANETS, asc_sign="Aries")
|
||||
ruling_planets = _kp_ruling_planets(CANONICAL_MOMENT, CANONICAL_ASC_LONGITUDE, CANONICAL_MOON_LONGITUDE)
|
||||
planets = raw.get("planets", {})
|
||||
houses = raw.get("houses", {})
|
||||
kp_lords_by_planet = {
|
||||
@@ -72,6 +93,7 @@ def build_probe() -> dict[str, Any]:
|
||||
"license_boundary": "Local implementation cites diliprk/VedicAstro MIT; keep source/oracle audit before commercial precise timing.",
|
||||
},
|
||||
"kp_lords_by_planet": kp_lords_by_planet,
|
||||
"ruling_planets": ruling_planets,
|
||||
"planet_significators": planet_significators,
|
||||
"house_significators": house_significators,
|
||||
"raw_sha256": _stable_hash(raw),
|
||||
|
||||
Reference in New Issue
Block a user