netcdf.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:veros 作者: dionhaefner 项目源码 文件源码
def threaded_io(vs, filepath, mode):
    """
    If using IO threads, start a new thread to write the netCDF data to disk.
    """
    if vs.use_io_threads:
        _wait_for_disk(vs, filepath)
        _io_locks[filepath].clear()
    nc_dataset = Dataset(filepath, mode)
    try:
        yield nc_dataset
    finally:
        if vs.use_io_threads:
            io_thread = threading.Thread(target=_write_to_disk, args=(vs, nc_dataset, filepath))
            io_thread.start()
        else:
            _write_to_disk(vs, nc_dataset, filepath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号