xarray调用compute()触发Dask大图警告的原因及疑问
问题
我运行这段代码:
client=Client() ds=xr.open_dataset(file_paths[0], chunks='auto') time_data = ds['ObservTimes'].compute()
每次执行compute()都会弹出这个警告:
UserWarning: Sending large graph of size 23.71 MiB. This may cause some slowdown. Consider loading the data with Dask directly or using futures or delayed objects to embed the data into the graph without repetition
按理解,compute()是把数据加载到内存里,为什么反而会把数据嵌入Dask图?
ds['ObservTimes']的数据如下:
array(['201301010001', '201301010002', '201301010003', ..., '201312312358', '201312312359', '201401010000'], dtype='<U12')
现在看起来像是把这些时间字符串嵌入了Dask图,但我看xarray官方文档的示例里从来没遇到过这种情况。原始数据是NetCDF格式,数据结构显示:ObservTimes是基于time维度的字符型变量,其余变量多为time、lat、lon三维的数值型变量,且全部启用了分块存储。
内容的提问来源于stack exchange,提问作者tangyp
相关产品推荐
相关产品推荐

