fix(chart): keep the ascendant nakshatra the page already renders
The chart API rebuilt the ascendant without nakshatra, lord, and pada, so those cells stayed blank. Cache schema is now 7. Centered column headers line up with their cells, and the current dasha card keeps its tint without the left accent. pytest 34 passed. tsc 0 errors. lint 0 errors and 123 existing warnings. Co-Authored-By: Grok (agent loop) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Grok (agent loop)
Cursor
parent
2b7112a601
commit
454951de27
@@ -2589,12 +2589,24 @@ def _vedastro_runtime_fingerprint() -> dict:
|
||||
}
|
||||
|
||||
|
||||
def _chart_ascendant_nakshatra(ascendant_data: dict, lon: float) -> dict:
|
||||
"""Keep the engine's nakshatra fields when /api/chart rebuilds the ascendant."""
|
||||
fields = {
|
||||
key: ascendant_data[key]
|
||||
for key in ('nakshatra', 'nakshatra_pada', 'nakshatra_lord')
|
||||
if ascendant_data.get(key) not in (None, '')
|
||||
}
|
||||
if 'nakshatra' in fields:
|
||||
return fields
|
||||
return _load_local_module('jyotish_engine')._nakshatra_fields(lon)
|
||||
|
||||
|
||||
def _build_api_chart_cache_payload(body: dict) -> dict:
|
||||
import api_scratch_retention as retention
|
||||
|
||||
today = body.get('today') or body.get('current_date')
|
||||
return {
|
||||
'cache_schema_version': 6,
|
||||
'cache_schema_version': 7,
|
||||
'birth': retention.normalize_chart_cache_birth(body),
|
||||
'calculation': {
|
||||
'ayanamsa': _request_ayanamsa(body),
|
||||
@@ -6663,6 +6675,7 @@ class JyotishAPIHandler(BaseHTTPRequestHandler, VedastroEvidenceMixin, SynastryM
|
||||
'degree': round(asc_lon % 30, 2),
|
||||
'degree_in_sign': round(asc_lon % 30, 2),
|
||||
'lon': round(asc_lon, 4),
|
||||
**_chart_ascendant_nakshatra(ascendant_data, asc_lon),
|
||||
},
|
||||
'planets': planets_data, 'houses': houses, 'shadbala': shadbala_summary,
|
||||
'dasha': {
|
||||
|
||||
Reference in New Issue
Block a user