Files
Jyotisha/scripts/naisargika_dasha.py
ClaudeandClaude Opus 5.5 ac9be6f88c feat(techniques): port the astrologer upstream skill's missing techniques
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
2026-11-07 14:44:37 +08:00

48 lines
1.6 KiB
Python

"""Naisargika Dasha: explicit classical whole-cycle producer.
This module deliberately exposes the seven-planet natural-life sequence as a
whole-cycle calculation. Birth-balance and child-period rules are separate
profile decisions and are not silently invented here.
"""
from datetime import date, datetime, timedelta
from typing import Dict, List, Union
YEAR_DAYS = 365.25636
NAISARGIKA_SEQUENCE = (
("Moon", 1), ("Mars", 2), ("Mercury", 9), ("Venus", 20),
("Jupiter", 18), ("Sun", 20), ("Saturn", 50),
)
def calculate_naisargika_dasha(
start: Union[date, datetime], *, include_children: bool = False
) -> Dict[str, object]:
"""Return the explicit 120-year natural-life cycle.
``start`` is the cycle anchor supplied by the caller. The producer does
not infer a birth balance from an unselected nakshatra or Moon position.
"""
if isinstance(start, datetime):
current = start
else:
current = datetime.combine(start, datetime.min.time())
periods: List[Dict[str, object]] = []
for lord, years in NAISARGIKA_SEQUENCE:
end = current + timedelta(days=years * YEAR_DAYS)
periods.append({
"lord": lord,
"years": years,
"start": current.isoformat(),
"end": end.isoformat(),
"children": [] if include_children else None,
})
current = end
return {
"system": "naisargika",
"status": "executed",
"cycle_years": 120,
"balance_mode": "explicit_cycle_anchor",
"children_status": "not_implemented" if include_children else "not_requested",
"periods": periods,
}