Merge pull request 'fix: portfolio_sector_exposure_summary renderer (SECTION_ERROR -> errors=0)' (#57) from feature/fix-sector-exposure-renderer into main
fix: portfolio_sector_exposure_summary renderer
This commit is contained in:
@@ -361,6 +361,19 @@ def _portfolio_performance_summary(data_root: dict, hctx: dict, se: list) -> str
|
||||
return md
|
||||
|
||||
|
||||
def _portfolio_sector_exposure_summary(data_root: dict, hctx: dict, se: list) -> str:
|
||||
raw = hctx.get("sector_concentration_json", [])
|
||||
sectors = _sj(raw) if isinstance(raw, str) else raw
|
||||
if not isinstance(sectors, list) or not sectors:
|
||||
return "## 포트폴리오 섹터 노출\n\n_섹터 노출 데이터 없음_"
|
||||
conc_gate = str(hctx.get("sector_concentration_gate") or "")
|
||||
md = "## 포트폴리오 섹터 노출\n\n"
|
||||
md += _kv([("섹터 집중 게이트", conc_gate)])
|
||||
md += "\n\n"
|
||||
md += _tbl(sectors, ["sector", "weight_pct", "gate"], max_rows=20)
|
||||
return md
|
||||
|
||||
|
||||
def _sector_trend_analysis_v1(data_root: dict, hctx: dict, se: list) -> str:
|
||||
inner_data = data_root.get("data", {}) if isinstance(data_root.get("data"), dict) else {}
|
||||
payload = {"data": inner_data, "data_root": data_root, "_harness_context": hctx}
|
||||
@@ -1152,6 +1165,7 @@ def main() -> int:
|
||||
"immediate_execution_playbook": lambda: _immediate_execution_playbook(hctx, se),
|
||||
"market_context_learning_note": lambda: _market_context_learning_note(hctx, se),
|
||||
"portfolio_performance_summary": lambda: _portfolio_performance_summary(data_root, hctx, se),
|
||||
"portfolio_sector_exposure_summary": lambda: _portfolio_sector_exposure_summary(data_root, hctx, se),
|
||||
"sector_trend_analysis_v1": lambda: _sector_trend_analysis_v1(data_root, hctx, se),
|
||||
"investment_quality_headline": lambda: _investment_quality_headline(hctx, se),
|
||||
"operational_truth_score": lambda: _operational_truth_score(hctx, se),
|
||||
|
||||
Reference in New Issue
Block a user