本文整理汇总了Python中joblib.Parallel.extend方法的典型用法代码示例。如果您正苦于以下问题:Python Parallel.extend方法的具体用法?Python Parallel.extend怎么用?Python Parallel.extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类joblib.Parallel
的用法示例。
在下文中一共展示了Parallel.extend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_point
# 需要导入模块: from joblib import Parallel [as 别名]
# 或者: from joblib.Parallel import extend [as 别名]
nnc.sync()
tides = process_point(i,nnc)
write_point(nnc,i,tides)
else:
from joblib import Parallel, delayed
elev = ncv['elev'][:]
# if timeseries or chunked version
# (hand over subarray instead of timeseries)
if False:
result = Parallel(n_jobs=n_jobs)(delayed(process_timeseries_parallel)(elev[:,i]) for i in tqdm(range(inum),ascii=True))
else:
chunksize=100
chunked_result = Parallel(n_jobs=n_jobs)(delayed(process_chunk_parallel)(elev[:,i*chunksize:min(inum,(i+1)*chunksize)]) for i in tqdm(range(int(inum/chunksize)+1),ascii=True))
result=[]
for res in chunked_result:
result.extend(res)
# save result as pickle
with open('result.pickle','wb') as f:
pickle.dump(result,f)
# write to netcdf
write_result(result,nnc)
# close netcdf
nnc.close()