Files
Jyotisha/tests/test_d60_varga_mapping.py
T
jesse-uxandGrok (agent loop) 129313e175
Independent Staging Quality Gate / validate (push) Successful in 20m59s
Independent Staging Quality Gate / publish (push) Successful in 4m25s
fix(varga): count D60 from the sign itself for every sign (BUG-1500, issue #149)
The production D60 branch added one sign to 1-based even signs, with no
source, while the repository's own guide and the vedastro mapping count
from the sign itself. PyJHora agrees with the latter: 33/77 recorded times
before, 77/77 after.

- scripts/varga.py: D60 is (si+pi)%12 for odd and even signs; other
  mappings and the vedastro mode are untouched.
- tests/test_d60_varga_mapping.py: 12 signs x 60 parts against
  PyJHora, plus the even-sign first part.
- scripts/research/d60_two_way_run.py: the G1 reconciliation that found
  this, now in the repository with a test; G1 passes 77/77.
- scripts/varga.py is part of the extended frozen identity, so the sealed
  holdout and the reported-offset sweep were re-frozen per ERR-110. All
  20 and 900 trials match the upstream_sync9b records on every field and
  the metrics and summary are unchanged.

Co-Authored-By: Grok (agent loop)
2026-10-29 14:30:57 +08:00

37 lines
1.4 KiB
Python

"""D60 Shashtyamsa counts from the sign itself for every sign (BUG-1500).
The production mapping used to add one sign for 1-based even signs, which put
the same ascendant one D60 sign away from PyJHora on 44 of 77 recorded times.
The guide (references/shodasavarga-complete-guide.md) and PyJHora both count
from the sign itself, odd and even alike.
"""
from __future__ import annotations
import pytest
from scripts.varga import calc_varga
def test_d60_first_part_starts_in_its_own_sign() -> None:
for sign in range(12):
for part in range(60):
longitude = sign * 30 + part * 0.5 + 0.25
assert calc_varga(longitude, 60)["sign_idx"] == (sign + part) % 12, (sign, part)
@pytest.mark.parametrize("sign", [1, 3, 5, 7, 9, 11])
def test_d60_even_signs_first_part_is_the_same_sign(sign: int) -> None:
# 1-based even signs: Taurus, Cancer, Virgo, Scorpio, Capricorn, Pisces.
result = calc_varga(sign * 30 + 0.25, 60)
assert result["sign_idx"] == sign
def test_d60_matches_pyjhora_shashtyamsa_for_all_signs_and_parts() -> None:
charts = pytest.importorskip("jhora.horoscope.chart.charts")
for sign in range(12):
for part in range(60):
degree = part * 0.5 + 0.25
their = int(charts.shashtyamsa_chart([["L", [sign, degree]]])[0][1][0])
assert calc_varga(sign * 30 + degree, 60)["sign_idx"] == their, (sign, part)