fix: build_reason weights 参数设为可选
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""服务器端验证新推荐原因格式"""
|
||||||
|
import sys, warnings
|
||||||
|
sys.path.insert(0, '/opt/a_stock_timeline')
|
||||||
|
warnings.filterwarnings('ignore')
|
||||||
|
from src.fetcher.kline_fetcher import KlineFetcher
|
||||||
|
from src.quant.engine import QuantEngine
|
||||||
|
|
||||||
|
DB = '/opt/a_stock_timeline/data/a_stock.db'
|
||||||
|
q = QuantEngine(emit=lambda e: None, db_path=DB)
|
||||||
|
recs = q.build_recommendations(3)
|
||||||
|
print('=== 新格式推荐 ===')
|
||||||
|
for r in recs:
|
||||||
|
print('{}★ {} | {}'.format('★' * r['stars'], r['name'], r['reason'][:80]))
|
||||||
|
print('=== 全部完成 ===')
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
def build_reason(code, kline_df, weights):
|
def build_reason(code, kline_df, weights=None):
|
||||||
"""
|
"""
|
||||||
从单股日K线(时间升序,≥30行)生成多维度推荐原因。
|
从单股日K线(时间升序,≥30行)生成多维度推荐原因。
|
||||||
返回 (reason_str, factor_detail_dict)
|
返回 (reason_str, factor_detail_dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user