Add missing referenced constants and frozen rule assets

This commit is contained in:
732642856
2026-06-27 18:55:49 +08:00
parent b884b8e7ea
commit 4d875ea242
10 changed files with 268 additions and 4 deletions
+1
View File
@@ -24,6 +24,7 @@ ORBIT_CATEGORIES = {
'moderate': 6, # 中等相位
'loose': 10, # 松散相位(最弱)
}
TIGHT_ORB_DEGREE = 1.0
# 特殊相位规则(从行星所在宫位算起)
SPECIAL_ASPECTS = {
@@ -0,0 +1,17 @@
# MIT Licensed Constants Imported from jyotishganit and jaimini-tropical
# License: MIT
# Source:
# - jyotishganit (https://github.com/jyotishganit)
# - jaimini-tropical (https://github.com/jaimini-tropical)
# Shadbala Constants (from jyotishganit)
ATHIMITRA = 22.5
MITRA = 15.0
SAMA = 7.5
SATRU = 3.75
ATHISATRU = 1.875
UCHCHA_BALA_MAX = 60.0
# Chara Dasha Constants (from jaimini-tropical)
CHARA_DASHA_FWD_SIGNS = [0, 1, 2, 6, 7, 8] # Aries, Taurus, Gemini, Libra, Scorpio, Sagittarius
CHARA_DASHA_REV_SIGNS = [3, 4, 5, 9, 10, 11] # Cancer, Leo, Virgo, Capricorn, Aquarius, Pisces
+17
View File
@@ -0,0 +1,17 @@
from datetime import datetime
import logging
def infer_timezone(lat: float, lon: float, dt: datetime, default: float = 8.0) -> float:
try:
from timezonefinder import TimezoneFinder
import pytz
tf = TimezoneFinder()
tz_name = tf.timezone_at(lng=lon, lat=lat)
if tz_name:
offset_seconds = pytz.timezone(tz_name).localize(dt).utcoffset().total_seconds()
offset = float(offset_seconds / 3600.0)
logging.info(f"[Timezone Auth] Detected {tz_name} offset {offset} for {dt}")
return offset
except Exception as e:
logging.warning(f"Timezone inference failed: {e}")
return float(default)
+2 -1
View File
@@ -15,6 +15,7 @@ Yoga规则扩展模块 v1.0
"""
from typing import Dict, List
from aspects import TIGHT_ORB_DEGREE
SIGNS = ['Aries','Taurus','Gemini','Cancer','Leo','Virgo',
'Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces']
@@ -165,7 +166,7 @@ def detect_graha_yuddha(planets: Dict) -> List[Dict]:
diff = abs(lon1 - lon2) % 360
if diff > 180:
diff = 360 - diff
if diff <= 1.0:
if diff <= TIGHT_ORB_DEGREE:
winner = p1 if lon1 > lon2 else p2
loser = p2 if winner == p1 else p1
wars.append({