Port from yinduzhanxing 5fb8379c (MIT): Naisargika, Kaala, Karaka, Tara, Lagnamsaka, Yogardha, Mandooka, Paryaaya and Padanadhamsa dashas; Sarvatobhadra, Kota and Kalanala chakras; Nakshatra Latta; Pachakadi; Raman Amsayu and Pindayu. Producers and their upstream tests are copied; scripts/upstream_technique_layers.py feeds them our natal and transit positions and attaches chart.consultation_native_layers.upstream_techniques. - dasha_registry: kaala and padanadhamsa keys (35 -> 37); the nine ported dashas are served by compute_dasha or fail closed with upstream's reason. - technique_registry.json: 16 partial entries; README badges follow. - Evidence lookup section `upstream_techniques` in the consultation tool. - Boundaries: Kalanala carries no PyJHora (AGPL) grid coordinates; Padanadhamsa/Lagnamsaka run on our Narayana engine (no Rath Table 12, PVR co-lord variants or second cycle). PyJHora observers and the Amsayu worked-example scaffold live in scripts/research (root .py budget). - PyJHora black-box cross-checks: Naisargika (lords/years) and Kaala (seed segment and fraction within 5e-4) on a public chart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
118 lines
6.5 KiB
Python
118 lines
6.5 KiB
Python
"""Raman Vol2 pp99,105-108: exact contributions from explicit chart conditions.
|
|
|
|
No ephemeris, automatic strength selector, Dasha chronology or outcome inference.
|
|
The condition contract permits caller-selected bhava/divisional/dignity methods.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import copy
|
|
from fractions import Fraction
|
|
import json
|
|
from pathlib import Path
|
|
|
|
PROFILE = "amsayu_raman_v2_supplied_conditions_exact_v1"
|
|
if __package__:
|
|
from .raman_aayu_rules import PLANETS, term as _term, validate_conditions, apply_haranas, unresolved_strength_selections, strength_candidate_report
|
|
else:
|
|
from raman_aayu_rules import PLANETS, term as _term, validate_conditions, apply_haranas, unresolved_strength_selections, strength_candidate_report
|
|
FLAGS = ("exalted", "retrograde", "vargottama", "own_rasi", "own_navamsa",
|
|
"own_drekkana", "inimical_sign", "combust")
|
|
SOURCE = "B.V. Raman, How to Judge a Horoscope Vol2, printed99-100,105-108 / PDF106-107,112-115"
|
|
|
|
|
|
def calculate_amsayu_raman(*, longitude_minutes: dict, conditions: dict,
|
|
condition_profile: str, strongest_by_bhava: dict | None = None) -> dict:
|
|
"""Seven planets + Lagna; bhava is 1..12, Mercury nature is explicit.
|
|
|
|
A crowded visible bhava needs an explicit strongest planet. Missing selection
|
|
blocks only that house's adjusted terms and total, preserving all base terms.
|
|
Boolean conditions are observed/supplied, not automatically computed here.
|
|
"""
|
|
houses, selectors = validate_conditions(longitude_minutes, conditions, condition_profile,
|
|
strongest_by_bhava, FLAGS)
|
|
rows = []
|
|
blockers = []
|
|
total = Fraction(0)
|
|
for planet in (*PLANETS, "Lagna"):
|
|
base = Fraction(longitude_minutes[planet], 200) % 12
|
|
row = {"body": planet, "base": _term(base), "trace": []}
|
|
if planet == "Lagna":
|
|
adjusted = base
|
|
row["trace"].append({"rule": "lagna_base_only", "factor": "1"})
|
|
else:
|
|
c = conditions[planet]
|
|
triple = [f for f in ("exalted", "retrograde") if c[f]]
|
|
double = [f for f in ("vargottama", "own_rasi", "own_navamsa", "own_drekkana") if c[f]]
|
|
factor = 3 if triple else 2 if double else 1
|
|
adjusted = base * factor
|
|
row["trace"].append({"rule": "bharana_maximum_once", "factor": str(factor),
|
|
"triple_conditions": triple, "double_conditions": double,
|
|
"remaining": _term(adjusted)})
|
|
adjusted, trace, reason = apply_haranas(planet, adjusted, c, houses, selectors)
|
|
row["trace"].extend(trace)
|
|
if reason:
|
|
row.update(status="blocked", reason=reason, adjusted=None)
|
|
rows.append(row)
|
|
if reason not in blockers:
|
|
blockers.append(reason)
|
|
continue
|
|
row["trace"].append({"rule": "krurodaya", "status": "not_applicable_to_amsayu"})
|
|
row.update(status="executed", adjusted=_term(adjusted))
|
|
rows.append(row)
|
|
total += adjusted
|
|
return {"profile_id": PROFILE, "tradition_profile": "raman_horoscope_v2_amsayu",
|
|
"status": "blocked" if blockers else "executed", "source": SOURCE,
|
|
"evidence_status": "parameter_sensitive", "condition_profile": condition_profile,
|
|
"supplied_conditions": copy.deepcopy(conditions),
|
|
"strongest_by_bhava": dict(selectors), "contributions": rows,
|
|
"total": None if blockers else _term(total), "blockers": blockers,
|
|
"limits": ["Supplied bhava, dignity, friendship and combustion decisions; no automatic selector",
|
|
"Exact rational years; 360-day half-up display only, no civil calendar",
|
|
"Printed Chart34 contains day-level discrepancies; no constants fitted to them",
|
|
"Chart34 printed Lagna182deg13min equals10933 arcmin, but its minutes column says10938; caller must choose input explicitly",
|
|
"Raman sequential reductions; not BPHS maximum-reduction variant",
|
|
"Not Pindayu/Nisargayu, MD/AD/PD, lifespan or death-date prediction",
|
|
"No default customer routing or global closure"]}
|
|
|
|
|
|
def build_amsayu_raman_report(**request) -> dict:
|
|
raw = calculate_amsayu_raman(**request)
|
|
lines = ["# Raman Amsayu contributions", "", f"Profile: {PROFILE}", "",
|
|
f"Status: {raw['status']}; parameter_sensitive", "", SOURCE, "",
|
|
"| Body | Base years (exact) | Adjusted years (exact) | State |",
|
|
"|---|---:|---:|---|"]
|
|
for row in raw["contributions"]:
|
|
value = row["adjusted"]["years_exact"] if row["adjusted"] else "—"
|
|
lines.append(f"| {row['body']} | {row['base']['years_exact']} | {value} | {row['status']} |")
|
|
lines.extend(["", "Nominal total: " + (raw["total"]["years_exact"] if raw["total"] else "blocked"), ""])
|
|
lines.extend("- " + item for item in raw["blockers"] + raw["limits"])
|
|
lines.extend(["", "## Calculation trace", "", "```json", json.dumps(raw, ensure_ascii=False, indent=2), "```", ""])
|
|
return {"status": raw["status"], "profile_id": PROFILE,
|
|
"evidence_appendix": [{"amsayu_contributions": raw}],
|
|
"exports": {"markdown": "\n".join(lines), "ai_evidence_bundle": copy.deepcopy(raw)}}
|
|
|
|
|
|
def build_amsayu_strength_candidates_report(**request):
|
|
baseline = calculate_amsayu_raman(**request)
|
|
unresolved, selections = unresolved_strength_selections(baseline['supplied_conditions'], baseline['strongest_by_bhava'])
|
|
branches = [dict(branch_key=f'amsayu:strength:{i}', strongest_by_bhava=selection,
|
|
result=calculate_amsayu_raman(**dict(request, strongest_by_bhava=selection)))
|
|
for i,selection in enumerate(selections)]
|
|
return strength_candidate_report(baseline, branches, unresolved, 'Raman Amsayu')
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--request", required=True)
|
|
parser.add_argument("--format", choices=("json", "markdown"), default="json")
|
|
parser.add_argument('--all-strength-candidates', action='store_true')
|
|
args = parser.parse_args()
|
|
producer = build_amsayu_strength_candidates_report if args.all_strength_candidates else build_amsayu_raman_report
|
|
result = producer(**json.loads(Path(args.request).read_text(encoding="utf-8")))
|
|
print(result["exports"]["markdown"] if args.format == "markdown" else json.dumps(result, ensure_ascii=False, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|