Complete v6.9.14 precision modules
This commit is contained in:
@@ -21,6 +21,7 @@ DEFAULT_REGISTRY = os.path.join(ROOT_DIR, "references", "technique_registry.json
|
||||
|
||||
ALLOWED_STATUS = {
|
||||
"covered",
|
||||
"complete",
|
||||
"partial",
|
||||
"knowledge-only",
|
||||
"workflow-only",
|
||||
|
||||
@@ -4194,7 +4194,7 @@ def cmd_sudarshana(args):
|
||||
# CLI入口
|
||||
# ============================================================================
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='印度占星统一引擎 v6.9.12', formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser = argparse.ArgumentParser(description='印度占星统一引擎 v6.9.14', formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
sub = parser.add_subparsers(dest='command', help='子命令')
|
||||
|
||||
# 1. chart
|
||||
|
||||
@@ -204,7 +204,8 @@ def nakshatra_compatibility(nak1_idx: int, nak2_idx: int) -> Dict:
|
||||
# Gana匹配
|
||||
g1 = NAK_GANA.get(nak1_idx, '')
|
||||
g2 = NAK_GANA.get(nak2_idx, '')
|
||||
gana_score = 6 if g1 == g2 else 3 if ('Dev' in g1 and 'Manushya' in g2) or ('Manushya' in g1 and 'Dev' in g2) else 0
|
||||
same_gana = bool(g1 and g2 and (g1 == g2 or ('Dev' in g1 and 'Dev' in g2) or ('Manushya' in g1 and 'Manushya' in g2) or ('Rakshasa' in g1 and 'Rakshasa' in g2)))
|
||||
gana_score = 6 if same_gana else 3 if ('Dev' in g1 and 'Manushya' in g2) or ('Manushya' in g1 and 'Dev' in g2) else 0
|
||||
|
||||
return {
|
||||
'nak1': NAK_NAMES[nak1_idx],
|
||||
|
||||
@@ -222,6 +222,7 @@ def calc_ashtakoot(male_moon_degree: float, female_moon_degree: float,
|
||||
approved = total >= 18.0 and (scores["Nadi"]>0 or len(exceptions)>0)
|
||||
|
||||
return {
|
||||
"version": "3.8-dashaflow-mit-adapted",
|
||||
"method": "Ashtakoot 16因子兼容性分析 (dashaflow MIT)",
|
||||
"male": {"moon_sign":m_sign,"nakshatra":NAKSHATRAS[m_nak],"gana":GANA[m_nak],"nadi":NADI[m_nak],"yoni":YONI_ANIMALS[m_nak]},
|
||||
"female": {"moon_sign":f_sign,"nakshatra":NAKSHATRAS[f_nak],"gana":GANA[f_nak],"nadi":NADI[f_nak],"yoni":YONI_ANIMALS[f_nak]},
|
||||
@@ -233,3 +234,29 @@ def calc_ashtakoot(male_moon_degree: float, female_moon_degree: float,
|
||||
"additional_kutas": additional,
|
||||
"exceptions": exceptions,
|
||||
}
|
||||
|
||||
|
||||
def calc_synastry(male_chart: Dict, female_chart: Dict) -> Dict:
|
||||
"""
|
||||
Backward-compatible synastry wrapper used by integration tests and older CLI paths.
|
||||
|
||||
Expected chart keys:
|
||||
- moon_lon: Moon longitude in degrees (required)
|
||||
- mars_lon / asc_lon / gender: optional, reserved for Kuja and extended factors
|
||||
"""
|
||||
if "moon_lon" not in male_chart or "moon_lon" not in female_chart:
|
||||
raise ValueError("calc_synastry requires moon_lon in both male_chart and female_chart")
|
||||
|
||||
result = calc_ashtakoot(
|
||||
float(male_chart["moon_lon"]),
|
||||
float(female_chart["moon_lon"]),
|
||||
male_chart=male_chart,
|
||||
female_chart=female_chart,
|
||||
)
|
||||
|
||||
# Historical test/API compatibility: expose BadConstellations as an additional Kuta.
|
||||
# A bad constellation condition is present if Vedha or Rajju is adverse.
|
||||
vedha_bad = result["additional_kutas"].get("Vedha") == "bad"
|
||||
rajju_bad = result["additional_kutas"].get("Rajju", {}).get("result") == "bad"
|
||||
result["additional_kutas"]["BadConstellations"] = "bad" if (vedha_bad or rajju_bad) else "good"
|
||||
return result
|
||||
|
||||
@@ -249,8 +249,17 @@ def search_all_transit_triggers(
|
||||
t['sensitive_point'] = sp['name']
|
||||
all_triggers.append(t)
|
||||
|
||||
# Normalize legacy raw trigger rows (single-contact results may bypass interval merge)
|
||||
for t in all_triggers:
|
||||
if 'start_date' not in t and 'date' in t:
|
||||
t['start_date'] = t['date'].strftime('%Y-%m-%d')
|
||||
if 'end_date' not in t and 'date' in t:
|
||||
t['end_date'] = t['date'].strftime('%Y-%m-%d')
|
||||
if 'duration_days' not in t:
|
||||
t['duration_days'] = 1
|
||||
|
||||
# 排序
|
||||
all_triggers.sort(key=lambda x: x['start_date'])
|
||||
all_triggers.sort(key=lambda x: x.get('start_date', '9999-12-31'))
|
||||
|
||||
# Sade Sati 检测
|
||||
sade_sati = _check_sade_sati_trigger(asc_lon, moon_lon, start_date, end_date)
|
||||
|
||||
Reference in New Issue
Block a user