refactor: 移除旧评估tab+evolution路由,研究tab改用effectiveness
- 移除评估tab(旧功能被strategy_effectiveness替代) - 移除evolution API路由(引用已删除的evolution目录) - 移除旧evaluation/stats/accuracy路由 - 研究tab: 策略自我进化→改为读取effectiveness/summary - effectivenes.html仍可通过直链访问
This commit is contained in:
@@ -1587,37 +1587,8 @@ def confirm_advice():
|
||||
|
||||
|
||||
# ── 准确率统计API ──
|
||||
@app.route("/api/stats/accuracy")
|
||||
def get_accuracy_stats():
|
||||
data = _load_json(DATA_DIR / "accuracy_stats.json", {})
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
# ── 策略评估API ──
|
||||
@app.route("/api/evaluation")
|
||||
def get_evaluation():
|
||||
"""返回所有策略的双维度评估结果"""
|
||||
# 主数据源:evaluation.json
|
||||
eval_data = _load_json(DATA_DIR / "evaluation.json", {})
|
||||
strategies = eval_data.get("strategies", [])
|
||||
if strategies:
|
||||
return jsonify(strategies)
|
||||
|
||||
# 备选:从 decisions.json 的 evaluation 字段读取(尚未反写时的兼容)
|
||||
decisions = read_decisions()
|
||||
evals = []
|
||||
for d in decisions.get("decisions", []):
|
||||
e = d.get("evaluation", [])
|
||||
if e:
|
||||
evals.append({
|
||||
"code": d["code"],
|
||||
"name": d["name"],
|
||||
"type": d.get("type", ""),
|
||||
"current": d.get("current", ""),
|
||||
"evaluations": e,
|
||||
})
|
||||
return jsonify(evals)
|
||||
|
||||
|
||||
@app.route("/api/evaluation/trigger", methods=["POST"])
|
||||
def trigger_evaluation():
|
||||
@@ -2280,16 +2251,6 @@ def api_research_log():
|
||||
return jsonify({"log": [], "error": str(e)})
|
||||
|
||||
|
||||
@app.route("/api/evolution/dashboard")
|
||||
def api_evolution_dashboard():
|
||||
"""进化模块 Dashboard"""
|
||||
try:
|
||||
sys.path.insert(0, '/home/hmo/MoFin/evolution')
|
||||
from evolution_api import get_evolution_dashboard
|
||||
return jsonify(get_evolution_dashboard())
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@app.route("/api/evolution/merge_b_group", methods=["POST"])
|
||||
def api_evolution_merge_b_group():
|
||||
@@ -2306,28 +2267,6 @@ def api_evolution_merge_b_group():
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
|
||||
@app.route("/api/evolution/health_trend")
|
||||
def api_evolution_health_trend():
|
||||
"""健康度趋势"""
|
||||
try:
|
||||
version = request.args.get('version', 'v_next4')
|
||||
days = int(request.args.get('days', 30))
|
||||
sys.path.insert(0, '/home/hmo/MoFin/evolution')
|
||||
from evolution_api import get_health_trend
|
||||
return jsonify({'trend': get_health_trend(version, days)})
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
@app.route("/api/evolution/combo")
|
||||
def api_evolution_combo():
|
||||
"""组合方案 Dashboard (v_next4+v_mr regime分工 + v_combo回测)"""
|
||||
try:
|
||||
sys.path.insert(0, '/home/hmo/MoFin/evolution')
|
||||
from evolution_api import get_combo_dashboard
|
||||
return jsonify(get_combo_dashboard())
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
|
||||
# ── 📚 文档 Tab 端点(2026-08-11 新增,开源项目式文档体系)──
|
||||
|
||||
Reference in New Issue
Block a user