Commit 93c8ce6f authored by pengxiong's avatar pengxiong

Merge remote-tracking branch 'origin/manage' into manage

parents d208cfdb 78b2c84d
...@@ -757,7 +757,7 @@ class PortfolioDiagnose(object): ...@@ -757,7 +757,7 @@ class PortfolioDiagnose(object):
self.new_correlation.index = self.new_correlation.index.map(lambda x: get_fund_name(x).values[0][0]) self.new_correlation.index = self.new_correlation.index.map(lambda x: get_fund_name(x).values[0][0])
end4 = time.time() end4 = time.time()
print("模型计算一次时间:", end4 - end3) print("模型计算一次时间:", end4 - start)
# S = np.asmatrix(S) # S = np.asmatrix(S)
# w_origin = np.asarray([i for i in w_origin.values()]) # w_origin = np.asarray([i for i in w_origin.values()])
# risk_target = np.asarray([1 / len(w_origin)] * len(w_origin)) # risk_target = np.asarray([1 / len(w_origin)] * len(w_origin))
...@@ -1324,6 +1324,7 @@ class PortfolioDiagnose(object): ...@@ -1324,6 +1324,7 @@ class PortfolioDiagnose(object):
return result return result
except Exception as e: except Exception as e:
repr(e) repr(e)
raise e
return None return None
def single_fund_radar(self): def single_fund_radar(self):
......
...@@ -193,9 +193,12 @@ class DataIntegrate: ...@@ -193,9 +193,12 @@ class DataIntegrate:
propose_fund_data_list = [] propose_fund_data_list = []
propose_fund_evaluation = portfolio_diagnose.propose_fund_evaluation() propose_fund_evaluation = portfolio_diagnose.propose_fund_evaluation()
propose_radar_chart_data = portfolio_diagnose.propose_fund_radar() propose_radar_chart_data = portfolio_diagnose.propose_fund_radar()
with futures.ProcessPoolExecutor(os.cpu_count()) as executor: # with futures.ProcessPoolExecutor(os.cpu_count()) as executor:
res = executor.map(gen_radar_chart, propose_radar_chart_data) # res = executor.map(gen_radar_chart, propose_radar_chart_data)
res = list(res) res = []
for chart_data in propose_radar_chart_data:
r = draw_index_combination_chart(chart_data)
res.append(r)
for i in range(len(propose_fund_evaluation)): for i in range(len(propose_fund_evaluation)):
propose_fund_data_list.append({ propose_fund_data_list.append({
'fund_name': propose_fund_evaluation[i]['name'], 'fund_name': propose_fund_evaluation[i]['name'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment