mirror of
https://github.com/migatu/astrololo.git
synced 2026-07-18 04:52:11 +00:00
Aspekty (LOG-06) + faseta aspektu, dedup i dopieszczenie wyników
Aspekty: - engine/aspects.py: aspekty główne (conj/sex/sq/tri/opp) z orbami (bonus dla luminarzy), separacja z obsługą zawinięcia. Applying/sep na później. - build_chart zwraca listę aspektów; /chart/positions je udostępnia; widok Horoskop pokazuje tabelę aspektów. Bogatsze sygnifikatory: - trzecia faseta "w aspekcie": dla każdego aspektu głównego obiektu filtruje rekordy po tokenie aspektu + drugiej planety ([conj + [Mo). Cookbook komplet: znak + dom + aspekt. Dopieszczenie wyników: - ODSIEWANIE DUPLIKATÓW: duplikat = ten sam sygnifikator ORAZ ten sam opis (po normalizacji). Dedup wewnątrz fasety, działa też na wynikach z wielu baz. - _facet_samples przyjmuje wiele tokenów (AND); dedup + istniejące odsiewanie szumu. Zweryfikowano na realnym main_base.xlsx (30.04.1984): 16 aspektów zgodnych z astro.com (Sun conj Moon 9.59°, Sun opp Saturn 3.17°); faseta aspektu daje bogate trafienia (Sun koniunkcja z Moon 84, opozycja z Saturn 43); dedup obniżył duplikaty (Sun w znaku 46->44). 36 testów przechodzi. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,29 @@ def test_no_house_facet_when_house_missing():
|
||||
assert "sign" in types and "house" not in types
|
||||
|
||||
|
||||
def test_dedup_by_significator_and_effect():
|
||||
positions = [{"name": "Moon", "sign": "Taurus", "direction": "D", "house": 11}]
|
||||
data = FakeData({"[Mo": [
|
||||
{"significator": "[Mo in 11th H.", "actioneffect": "efekt"},
|
||||
{"significator": "[Mo in 11th H.", "actioneffect": "efekt"}, # duplikat (sig+opis)
|
||||
{"significator": "[Mo in 11th H.", "actioneffect": "inny efekt"}, # ten sam sig, inny opis
|
||||
]})
|
||||
facets = {f["type"]: f for f in build_report(positions, data)["objects"][0]["facets"]}
|
||||
assert facets["house"]["count"] == 2 # duplikat odsiany, różny opis zostaje
|
||||
|
||||
|
||||
def test_aspect_facet():
|
||||
positions = [
|
||||
{"name": "Sun", "sign": "Taurus", "direction": "D", "house": 11},
|
||||
{"name": "Moon", "sign": "Taurus", "direction": "D", "house": 11},
|
||||
]
|
||||
aspects = [{"obj1": "Sun", "obj2": "Moon", "aspect": "conjunction", "orb": 2.0}]
|
||||
data = FakeData({"[Su": [{"significator": "[Su [conj [Mo", "actioneffect": "złączeni"}]})
|
||||
sun = build_report(positions, data, aspects=aspects)["objects"][0]
|
||||
asp = [f for f in sun["facets"] if f["type"] == "aspect"]
|
||||
assert asp and asp[0]["count"] == 1 and "Moon" in asp[0]["label"]
|
||||
|
||||
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user