fix(tajika): store year-lord house separately from sign (BUG-1263, upstream 1918ffaf)

This commit is contained in:
jesse-ux
2026-10-07 16:52:41 +08:00
parent 3adb2460e3
commit 778cb6389c
3 changed files with 40 additions and 6 deletions
@@ -56,6 +56,20 @@ def _select(planet_lons, **kwargs):
return tajika.calc_panchadhikari_year_lord(planet_lons, **defaults)
def test_planet_house_is_relative_to_the_annual_ascendant_not_the_sign_index(monkeypatch) -> None:
"""Taurus under an Aries annual ascendant is house 2. Sign index 1 must not be reused as the house."""
_scores(monkeypatch, {"Moon": 50.0, "Mars": 1.0, "Venus": 1.0, "Mercury": 1.0, "Jupiter": 1.0, "Saturn": 1.0, "Sun": 1.0})
result = _select(dict(BASE))
assert result["year_lord"] == "Moon"
moon = next(row for row in result["candidates"] if row["planet"] == "Moon")
assert moon["planet_sign_idx"] == 1
assert moon["planet_sign"] == "Taurus"
assert moon["planet_house"] == 2
assert result["year_lord_sign_idx"] == 1
assert result["year_lord_house"] == 2
assert result["year_lord_sign"] == "Taurus"
def test_benefic_shortlist_takes_the_strongest(monkeypatch) -> None:
# Candidates: natal Lagna lord Moon (Cancer), Muntha lord Venus (Libra),
# annual Lagna lord Mars, new-year lord and Tri-Rasi lord (day/night).