From eda518039672cfca5b5d5c2839cde3cb19a96483 Mon Sep 17 00:00:00 2001 From: xxm Date: Sun, 16 Aug 2026 13:20:30 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=BF=9B=E5=8C=96API=E6=94=B9=E8=AF=BB?= =?UTF-8?q?=E9=A2=84=E8=AE=A1=E7=AE=97json=E2=80=94=E2=80=94=E5=81=87?= =?UTF-8?q?=E8=AE=BE=E5=BD=92=E7=BA=B3/B=E7=BB=84/=E8=B5=84=E6=A0=BC?= =?UTF-8?q?=E6=A6=82=E8=A7=88=E4=B8=8D=E5=86=8D=E5=AE=9E=E6=97=B6=E9=87=8D?= =?UTF-8?q?=E7=AE=97(=E9=9D=A2=E6=9D=BF=E5=8A=A0=E8=BD=BD=E5=A4=AA?= =?UTF-8?q?=E6=85=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evolution/evolution_api.py | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/evolution/evolution_api.py b/evolution/evolution_api.py index 5a3d3fe9..a25527fe 100644 --- a/evolution/evolution_api.py +++ b/evolution/evolution_api.py @@ -72,40 +72,15 @@ def get_evolution_dashboard(): 'max_dd': pf.get('portfolio_max_dd_pct', 0), } - # ── 2026-08-16 数据归纳假设(方向一):每个激活策略的归纳优化假设 ── + # ── 2026-08-16 进化机制数据:读预计算快照(precompute_evolution.py 定期生成,避免实时重算)── hypotheses = [] - try: - sys.path.insert(0, '/home/hmo/MoFin/evolution') - from hypothesis_miner import induce_hypotheses - for v in _active_versions(): - mkt = 'hk' if v.startswith('hk') else 'a' - hs, _ = induce_hypotheses(v, mkt, period_tag='2y') - for h in hs[:3]: - hypotheses.append({ - 'strategy': v, 'market': mkt, **h, - }) - except Exception: - pass - - # ── 2026-08-16 B组候选(方向二):由果及因挖掘的候选策略 ── b_group = [] - try: - import json as _j - p = _j.loads(open('/home/hmo/MoFin/data/b_group_candidates.json', encoding='utf-8').read()) - b_group = p.get('candidates', []) - except Exception: - pass - - # ── 2026-08-16 策略资格概览(研究Tab进化中心用)── qual_overview = [] try: - import sys as _sy - _sy.path.insert(0, '/home/hmo/MoFin/deploy/profile-scripts') - from strategy_qualify import evaluate_all_regimes, get_benchmarks - for v in _active_versions(): - mkt = 'hk' if v.startswith('hk') else 'a' - q = evaluate_all_regimes(v, mkt, bench=get_benchmarks(mkt)) - qual_overview.append({'strategy': v, 'market': mkt, 'qualification': q}) + _ec = json.loads(open('/home/hmo/MoFin/data/evolution_center.json', encoding='utf-8').read()) + hypotheses = _ec.get('hypotheses', []) + b_group = _ec.get('b_group', []) + qual_overview = _ec.get('qual_overview', []) except Exception: pass