Skip to content

Commit

Permalink
修改回多线程计算
Browse files Browse the repository at this point in the history
  • Loading branch information
woldy committed Jan 18, 2024
1 parent dbb45d3 commit 07b0f60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion finhack/core/command/finhack
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ if __name__ == '__main__':
atexit.register(Utils.auto_exit) # 注册退出函数
core.do_action()


2 changes: 1 addition & 1 deletion finhack/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def generate_args(self):
self.parser=parser
return parser


#生成参数
def parse_args(self):
args, unknown = self.parser.parse_known_args()
Expand Down
6 changes: 3 additions & 3 deletions finhack/factor/default/indicatorCompute.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def split_list_n_list(origin_list, n):
for code_list in code_lists:
with ProcessPoolExecutor(max_workers=n) as pool:
for ts_code in code_list:
indicatorCompute.computeListByStock(ts_code,list_name=list_name,where='',factor_list=factor_list,c_list=c_list,pure=True,check=False,df_price=pd.DataFrame(),db='tushare')
#indicatorCompute.computeListByStock(ts_code,list_name=list_name,where='',factor_list=factor_list,c_list=c_list,pure=True,check=False,df_price=pd.DataFrame(),db='tushare')

# mytask=pool.submit(indicatorCompute.computeListByStock,ts_code,list_name,'',factor_list,c_list,True,False)
# tasklist.append(mytask)
mytask=pool.submit(indicatorCompute.computeListByStock,ts_code,list_name,'',factor_list,c_list,True,False)
tasklist.append(mytask)

# wait(tasklist,return_when=ALL_COMPLETED)
Log.logger.info(list_name+' computed')
Expand Down

0 comments on commit 07b0f60

Please sign in to comment.