mirror of
https://github.com/migatu/astrololo.git
synced 2026-07-18 04:52:11 +00:00
Profekcje roczne (LOG-10) i Solar/Lunar Return (LOG-12)
Pierwsze techniki predykcyjne. Profekcje (LOG-10): - engine/profections.py: Whole Sign, wiek mod 12; profektowany Asc + Władca Roku (władca domicylowy) + profekcje MC/Su/Mo. Obsługa 29 lutego. - endpoint /chart/profections (zakres lat: start_age, count). Returns (LOG-12): - engine/returns.py: moment powrotu Słońca/Księżyca do długości natalnej; skan dobowy + bisekcja do ~sekundy, z pominięciem artefaktu zawinięcia 0/360. - endpoint /chart/return (kind solar|lunar, around) — zwraca pełny horoskop na znaleziony moment (oba warianty użycia po stronie technik wyżej). Walidacja: - profekcje zgodne co do joty z tabelą astro-seek z notes3 (wiek 0..42: Asc + Władca Roku + MC/Su/Mo). - Solar Return 2026: Słońce wraca do Tau 10°08'22" = natalny stopień; Lunar Return trafia natalny Księżyc <2'; samospójność potwierdzona. - 62 testy przechodzą (nowe: test_profections, test_returns). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,62 @@ def chart_report(req: ReportRequest) -> dict:
|
||||
return {"engine": engine.name, **report}
|
||||
|
||||
|
||||
class ProfectionsRequest(BaseModel):
|
||||
when_utc: datetime # moment urodzenia (UTC)
|
||||
lat: float = 0.0
|
||||
lon: float = 0.0
|
||||
start_age: int = 0
|
||||
count: int = 13 # domyślnie pełny cykl 12 lat + rok startowy
|
||||
|
||||
|
||||
@app.post("/chart/profections")
|
||||
def chart_profections(req: ProfectionsRequest) -> dict:
|
||||
"""Profekcje roczne (LOG-10): wiek, profektowany Asc, Władca Roku (+MC/Su/Mo)."""
|
||||
from app.engine import houses as H
|
||||
from app.engine.models import ChartMoment
|
||||
from app.engine.profections import profection_rows
|
||||
|
||||
engine = get_engine()
|
||||
natal = ChartMoment(when_utc=req.when_utc, lat=req.lat, lon=req.lon)
|
||||
ramc, eps = engine.sidereal(natal)
|
||||
points = {
|
||||
"Asc": H.compute_asc(ramc, eps, natal.lat),
|
||||
"MC": H.compute_mc(ramc, eps),
|
||||
}
|
||||
for p in engine.positions(natal, ["Sun", "Moon"]):
|
||||
points[p.name] = p.longitude
|
||||
rows = profection_rows(points, req.when_utc, req.start_age, req.count)
|
||||
return {"engine": engine.name, "rows": rows}
|
||||
|
||||
|
||||
class ReturnRequest(BaseModel):
|
||||
when_utc: datetime # moment urodzenia (UTC)
|
||||
lat: float = 0.0
|
||||
lon: float = 0.0
|
||||
kind: str = "solar" # solar | lunar
|
||||
around: datetime | None = None # data, wokół której szukać powrotu
|
||||
|
||||
|
||||
@app.post("/chart/return")
|
||||
def chart_return(req: ReturnRequest) -> dict:
|
||||
"""Solar/Lunar Return (LOG-12): moment powrotu + pełny horoskop na ten moment."""
|
||||
from app.engine.chart import build_chart
|
||||
from app.engine.models import ChartMoment
|
||||
from app.engine.returns import find_return
|
||||
|
||||
if req.kind not in ("solar", "lunar"):
|
||||
raise HTTPException(status_code=422, detail="kind: solar albo lunar")
|
||||
engine = get_engine()
|
||||
natal = ChartMoment(when_utc=req.when_utc, lat=req.lat, lon=req.lon)
|
||||
around = req.around or req.when_utc
|
||||
hit = find_return(engine, req.kind, natal, around)
|
||||
if hit is None:
|
||||
raise HTTPException(status_code=404, detail="nie znaleziono powrotu w oknie skanu")
|
||||
chart = build_chart(engine, ChartMoment(when_utc=hit, lat=req.lat, lon=req.lon))
|
||||
return {"engine": engine.name, "kind": req.kind,
|
||||
"return_utc": hit.isoformat(), **chart}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health() -> dict:
|
||||
info = {"status": "ok", "layer": "logic"}
|
||||
|
||||
Reference in New Issue
Block a user