mirror of
https://github.com/migatu/astrololo.git
synced 2026-07-14 21:38:37 +00:00
Bogatsze sygnifikatory: faseta "w domu" obok "w znaku" (LOG-15/16)
Most horoskop -> sygnifikatory generuje teraz dla każdego obiektu dwie fasety:
- "w znaku": planeta + token znaku ([Su + [Tau)
- "w domu": planeta + token domu ([Su + 11th H.) — używa domów z LOG-05
- significators.build_report: przyjmuje pozycje z build_chart (z numerami domów),
generuje fasety znak/dom, filtruje szum. Ordinal helper (1st..12th).
- /chart/report: używa build_chart (pozycje z domami).
- Prezentacja /interpret: render faset (znak/dom) per obiekt.
Aspekty ([conj/[sq/[opp) na później — wymagają policzenia aspektów (LOG-06).
Zweryfikowano na realnym main_base.xlsx (53969 wierszy), 30.04.1984:
Mars w 5. domu 10 dopasowań ("[Sa or [Ma in the 5th H." -> "abortion/miscarriage"),
Neptune w 7. domu 6, Uranus w 6. domu 4. 7 testów przechodzi.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Testy mostu obliczenia → sygnifikatory → wyszukiwanie (bez efemeryd/HTTP)."""
|
||||
from app.engine.models import DEFAULT_OBJECTS, ObjectPosition
|
||||
from app.significators import PLANET_ABBR, build_report
|
||||
from app.engine.models import DEFAULT_OBJECTS
|
||||
from app.significators import PLANET_ABBR, _ordinal, build_report
|
||||
|
||||
|
||||
class FakeData:
|
||||
@@ -12,31 +12,34 @@ class FakeData:
|
||||
return {"provider": "fake", "total": len(rows), "rows": rows}
|
||||
|
||||
|
||||
def test_build_report_filters_to_sign_and_drops_noise():
|
||||
positions = [ObjectPosition("Sun", 40.0, 0.0, 0.95, False)] # Taurus 10° -> [Su + [Tau
|
||||
def test_sign_and_house_facets():
|
||||
positions = [{"name": "Sun", "sign": "Taurus", "direction": "D", "house": 11}]
|
||||
data = FakeData({"[Su": [
|
||||
{"significator": "[Su in [Tau", "actioneffect": "efekt A"}, # trafienie
|
||||
{"significator": "[Su in [Vir", "actioneffect": "inny znak"}, # zły znak
|
||||
{"significator": "[Su in [Tau", "actioneffect": "nan"}, # szum (pusty efekt)
|
||||
{"significator": "SIGNIFICATOR nagłówek", "actioneffect": "x"}, # szum (nagłówek)
|
||||
{"significator": "[Su in [Tau", "actioneffect": "efekt znak"}, # faseta znak
|
||||
{"significator": "[Su in 11th H.", "actioneffect": "efekt dom"}, # faseta dom
|
||||
{"significator": "[Su in [Vir", "actioneffect": "inny"}, # żadna
|
||||
{"significator": "[Su in [Tau", "actioneffect": "nan"}, # szum
|
||||
]})
|
||||
item = build_report(positions, data, per_object_limit=100)["objects"][0]
|
||||
assert item["object"] == "Sun" and item["sign"] == "Taurus"
|
||||
assert item["planet_token"] == "[Su" and item["sign_token"] == "[Tau"
|
||||
assert item["planet_total"] == 4
|
||||
assert item["in_sign_count"] == 1
|
||||
assert item["samples"][0]["effect"] == "efekt A"
|
||||
item = build_report(positions, data)["objects"][0]
|
||||
assert item["object"] == "Sun" and item["house"] == 11
|
||||
facets = {f["type"]: f for f in item["facets"]}
|
||||
assert facets["sign"]["count"] == 1
|
||||
assert facets["sign"]["samples"][0]["effect"] == "efekt znak"
|
||||
assert facets["house"]["count"] == 1
|
||||
assert facets["house"]["token"] == "11th H."
|
||||
assert facets["house"]["samples"][0]["effect"] == "efekt dom"
|
||||
|
||||
|
||||
def test_effect_falls_back_to_topic_or_bodypart():
|
||||
positions = [ObjectPosition("Mars", 220.0, 0.0, -0.2, True)] # Scorpio -> [Ma + [Sco
|
||||
data = FakeData({"[Ma": [
|
||||
{"significator": "[Ma in [Sco", "actioneffect": "", "topicresult": "temat X"},
|
||||
{"significator": "[Ma in [Sco", "bodypart": "część ciała"},
|
||||
]})
|
||||
samples = build_report(positions, data)["objects"][0]["samples"]
|
||||
assert samples[0]["effect"] == "temat X"
|
||||
assert samples[1]["effect"] == "część ciała"
|
||||
def test_no_house_facet_when_house_missing():
|
||||
positions = [{"name": "Mars", "sign": "Scorpio", "direction": "Rx"}]
|
||||
data = FakeData({"[Ma": [{"significator": "[Ma in [Sco", "actioneffect": "eff"}]})
|
||||
types = [f["type"] for f in build_report(positions, data)["objects"][0]["facets"]]
|
||||
assert "sign" in types and "house" not in types
|
||||
|
||||
|
||||
def test_ordinal():
|
||||
assert _ordinal(1) == "1st" and _ordinal(2) == "2nd" and _ordinal(3) == "3rd"
|
||||
assert _ordinal(4) == "4th" and _ordinal(11) == "11th" and _ordinal(12) == "12th"
|
||||
|
||||
|
||||
def test_planet_abbr_covers_all_default_objects():
|
||||
|
||||
Reference in New Issue
Block a user