python多处理的包装器,提供对tqdm进度条和共享参数的支持
enhanced-multiprocessing的Python项目详细描述
python多处理的包装器,为tqdm提供支持 进度条和共享参数。
提供简单、熟悉的与额外超能力的接口。
安装
pip install enhanced_multiprocessing
示例用法
fromenhanced_multiprocessingimportPooldefadd_n(x,n):returnx+n# the number of processes will be set to number of cores - 1 by defaultp=Pool()# will apply add_n to the element list of length three with n=5, showing a nice progress bar alongresult=p.imap(add_n,[1,2,3],shared_args=(5,))assertlist(result)==[6,7,8]
历史记录
最初发表于 kn-bibs/pathways-analysis, 然后进一步发展 krassowski/drug-disease-profile-matching。