mirror of
https://github.com/migatu/astrololo.git
synced 2026-07-14 21:38:37 +00:00
Spięcie osi czasu z bazą interpretacji i widokiem (LOG-14, 1B->2B)
Realizuje przepływ 1B->2B z notes2: predykcyjne sygnifikatory (z datami)
dopasowane do interpretacji z bazy.
Logika:
- timeline.py: zdarzenia niosą strukturę (directed/aspect/target dla dyrekcji,
lord/sign dla profekcji) do budowy tokenów.
- significators.interpret_events + _event_tokens: z każdego zdarzenia buduje
tokeny bazy (dyrekcja: [planeta][aspekt][cel]; profekcja: [władca][znak]) i
dopina interpretacje reużywając _facet_samples (AND tokenów, dedup, rozwinięcie).
- /chart/timeline: flaga interpret=true.
Prezentacja:
- nowa strona /timeline "Kalendarz": formularz (urodzenie + zakres dat) -> oś
czasu z technikami, datami i interpretacjami; nawigacja + wspólne now.js.
Walidacja E2E na realnym main_base.xlsx (2025-2026):
- dyr. Saturn kwadratura MC -> 50 interpret. ("...5th house" -> "abortion/miscarriage")
- Władca Roku Saturn (wiek 42) -> 63; strona renderuje badge dat/technik.
71 testów przechodzi (nowy test_timeline_interpret).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
"""Spięcie osi czasu z bazą interpretacji (LOG-14 → 1B→2B)."""
|
||||
from app.significators import _event_tokens, interpret_events
|
||||
|
||||
|
||||
class FakeData:
|
||||
def __init__(self, rows_by_value):
|
||||
self.rows_by_value = rows_by_value
|
||||
|
||||
def search(self, key, value, exact, limit, fields=None):
|
||||
rows = self.rows_by_value.get(value, [])
|
||||
return {"provider": "fake", "total": len(rows), "rows": rows}
|
||||
|
||||
|
||||
def test_event_tokens_solar_arc():
|
||||
ev = {"technique": "solar_arc", "directed": "Venus", "aspect": "conjunction", "target": "North Node"}
|
||||
assert _event_tokens(ev) == ["[Ve", "[conj", "[NN"]
|
||||
|
||||
|
||||
def test_event_tokens_solar_arc_to_angle_has_no_target_token():
|
||||
ev = {"technique": "solar_arc", "directed": "Sun", "aspect": "square", "target": "MC"}
|
||||
assert _event_tokens(ev) == ["[Su", "[sq"] # MC nie ma tokenu planety
|
||||
|
||||
|
||||
def test_event_tokens_profection():
|
||||
ev = {"technique": "profection", "lord": "Saturn", "sign": "Capricorn"}
|
||||
assert _event_tokens(ev) == ["[Sa", "[Cap"]
|
||||
|
||||
|
||||
def test_solar_return_has_no_tokens():
|
||||
assert _event_tokens({"technique": "solar_return"}) == []
|
||||
|
||||
|
||||
def test_interpret_attaches_matches_with_all_tokens():
|
||||
events = [
|
||||
{"technique": "solar_arc", "directed": "Venus", "aspect": "conjunction", "target": "North Node"},
|
||||
{"technique": "solar_return"},
|
||||
]
|
||||
data = FakeData({"[Ve": [
|
||||
{"significator": "[Ve [conj [NN", "actioneffect": "spotkanie losowe"}, # wszystkie tokeny
|
||||
{"significator": "[Ve [conj [Mo", "actioneffect": "inny"}, # brak [NN
|
||||
{"significator": "[Ve [conj [NN", "actioneffect": "spotkanie losowe"}, # duplikat
|
||||
]})
|
||||
interpret_events(events, data)
|
||||
assert events[0]["interpretations_count"] == 1 # duplikat odsiany, tylko z [NN
|
||||
assert events[0]["interpretations"][0]["expanded"] == "Venus conjunction North Node"
|
||||
assert "interpretations" not in events[1] # solar_return pominięty
|
||||
Reference in New Issue
Block a user