Refactor Enochian astrology into modular engine with dynamic guardians, personalized Sigillum, and data-driven mappings#520
Merged
Conversation
Copilot created this pull request from a session on behalf of
kentang2017
June 5, 2026 16:22
View session
kentang2017
marked this pull request as ready for review
June 5, 2026 16:22
Copilot stopped work on behalf of
kentang2017 due to an error
June 5, 2026 16:22
There was a problem hiding this comment.
Pull request overview
This PR refactors astro/enochian into a more modular, data-driven Enochian Astrology subsystem: a standalone computation engine (enochian.py), SVG visualization utilities (visualization.py), interpretation builders (interpretations.py), and JSON-backed rule tables with cached loaders (data/). It also updates the Streamlit tab to surface the expanded guardian angel model and a new elemental-balance SVG.
Changes:
- Introduces a new
compute_enochian_chart()engine that reusescompute_western_chart()outputs and adds dynamic guardian roles (ASC / chart ruler / strongest planet) plus personalized Sigillum data. - Adds new SVG renderers (including
render_element_balance_svg) and wires them into the Enochian Streamlit UI. - Moves rule/config surfaces into JSON data files and keeps backward compatibility via thin re-export wrappers (
calculator.py,renderer.py).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/handlers/tab_enochian/render.py | Updates Enochian Streamlit UI to show additional guardian cards and elemental-balance SVG rendering. |
| astro/enochian/visualization.py | New consolidated SVG rendering module for Sigillum/Watchtower/Aethyr/summary/element-balance visuals. |
| astro/enochian/renderer.py | Backward-compatible re-export wrapper pointing to visualization.py. |
| astro/enochian/interpretations.py | New helpers to generate bilingual spiritual path / magical purpose / invocation text. |
| astro/enochian/enochian.py | New main computation engine with dynamic guardians, Sigillum nodes/activation, and Western chart reuse. |
| astro/enochian/data/watchtower_aethyr_rules.json | Introduces tunable weights intended to influence scoring behavior. |
| astro/enochian/data/sigillum_rules.json | Defines heptagram node mapping and activation-window settings for personalized Sigillum logic. |
| astro/enochian/data/angels.json | Adds angel tables and invocation templates used by the engine. |
| astro/enochian/data/init.py | Adds cached JSON loaders with clear runtime errors for missing/invalid data files. |
| astro/enochian/calculator.py | Backward-compatible re-export wrapper pointing to enochian.py. |
| astro/enochian/init.py | Updates package exports to point to the new engine/visualization/data loader APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+696
to
+698
| # 天使:優先用行星對應,其次用星座對應 | ||
| angel_name = planet_data.get("angel", sign_data.get("angel", "RAPHAEL")) | ||
| angel_zh = planet_data.get("angel_zh", sign_data.get("angel_zh", "拉斐爾")) |
Comment on lines
+640
to
+666
| 計算完整的 Enochian 占星命盤。 | ||
|
|
||
| 此函式為純函式(pure function),無任何 Streamlit 依賴, | ||
| 可安全用於 API 端點和測試。 | ||
|
|
||
| Args: | ||
| year, month, day: 出生年月日 | ||
| hour, minute: 出生時間(24小時制) | ||
| timezone: 時區偏移(UTC+N,如台灣為 8.0) | ||
| latitude, longitude: 出生地緯度、經度 | ||
| location_name: 地點名稱(可選) | ||
|
|
||
| Returns: | ||
| EnochianChart: 完整的 Enochian 分析結果 | ||
| """ | ||
| # 1-3. 重用西方命盤計算(共享 pyswisseph 結果) | ||
| western_chart = compute_western_chart( | ||
| year=year, | ||
| month=month, | ||
| day=day, | ||
| hour=hour, | ||
| minute=minute, | ||
| timezone=timezone, | ||
| latitude=latitude, | ||
| longitude=longitude, | ||
| location_name=location_name, | ||
| ) |
Comment on lines
+550
to
+555
| def _compute_strongest_planet(western_chart: WesternChart) -> str: | ||
| """Score planets by angularity, luminary priority, dignity, and retrograde state.""" | ||
| rules = load_watchtower_aethyr_rules().get("watchtower_weights", {}) | ||
| angular_bonus = float(rules.get("angular_house_bonus", 0.4)) | ||
| luminary_bonus = float(rules.get("luminary_bonus", 0.3)) | ||
| scores: Dict[str, float] = {} |
Comment on lines
+17
to
+27
| import math | ||
| from typing import Dict, List, Optional | ||
|
|
||
| from .calculator import EnochianChart, EnochianPlanetPoint | ||
| from .constants import ( | ||
| AETHYRS, | ||
| WATCHTOWERS, | ||
| SIGILLUM_DEI_AEMETH, | ||
| ELEMENT_TABLE, | ||
| ENOCHIAN_PLANETS, | ||
| ) |
Comment on lines
+134
to
+141
| # 七芒星連線(每個頂點連接隔2個) | ||
| hept_path_pts = [] | ||
| for i in range(7): | ||
| hept_path_pts.append(hept_points[i]) | ||
| hept_path_pts.append(hept_points[(i * 2) % 7]) | ||
| # 繪製七芒星各邊 | ||
| star_path = " ".join(f"{p[0]:.1f},{p[1]:.1f}" for p in hept_points) | ||
| # 重新繪製為兩個交錯三角形 |
Comment on lines
+3
to
+7
| {"index": 1, "planet": "Saturn", "default_angel": "ZAPHKIEL"}, | ||
| {"index": 2, "planet": "Jupiter", "default_angel": "TZADKIEL"}, | ||
| {"index": 3, "planet": "Mars", "default_angel": "CAMAEL"}, | ||
| {"index": 4, "planet": "Sun", "default_angel": "MICHAEL"}, | ||
| {"index": 5, "planet": "Venus", "default_angel": "HANAEL"}, |
| "Sun": {"angel": "MICHAEL", "angel_zh": "米迦勒"}, | ||
| "Moon": {"angel": "GABRIEL", "angel_zh": "加百列"}, | ||
| "Mercury": {"angel": "RAPHAEL", "angel_zh": "拉斐爾"}, | ||
| "Venus": {"angel": "HANAEL", "angel_zh": "哈納爾"}, |
Comment on lines
+469
to
+471
| st.markdown("---") | ||
| st.markdown("**Elemental Balance SVG**") | ||
| st.components.v1.html( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR turns
astro/enochianfrom a mostly static implementation into a modular, data-driven Enochian system that produces personalized outputs from natal chart dynamics (Ascendant, chart ruler, strongest planet) rather than fixed angel assignments. It also formalizes Sigillum/Watchtower/Aethyr mappings and aligns computation with existing Western chart infrastructure.Modular architecture
astro/enochian/enochian.py(core computation)astro/enochian/visualization.py(SVG renderers)astro/enochian/interpretations.py(bilingual narrative builders)astro/enochian/data/*(JSON mapping/rule tables + cached loaders)astro/enochian/calculator.py-> re-export wrapperastro/enochian/renderer.py-> re-export wrapperastro/enochian/__init__.py.Dynamic guardian angel model
chart_ruler_angel,strongest_planet_angel,guardian_angel_cardsPersonalized Sigillum Dei Aemeth
sigillum_rules.json)angels.json)sigillum_nodessigillum_active_angelssigillum_personal_numberTZADKIEL/TZAPHKIEL.Watchtower + Aethyr integration
watchtower_aethyr_rules.json) to support tuning without code edits.Western chart reuse + bilingual output
compute_enochian_chartnow reusescompute_western_chartresults directly (planets/houses/angles) instead of duplicating Swiss Ephemeris work.interpretations.py:invocation_en,invocation_zh)Visualization upgrades
render_element_balance_svgand integrated it into the Streamlit Enochian tab.