代码:
store = zarr.ZipStore("/mnt/test.zip", "r")
问题描述:您好,不好意思,我在Zarr官方文档中找到了这个关于ZipStorage的声明:
Alternatively, use a DirectoryStore when writing the data, then manually Zip the directory and use the Zip file for subsequent reads.
我正在尝试将 DirectoryStorage 格式的 Zarr 数据集转换为 ZipStorage。我使用 Linux 中提供的 zip 操作。
zip -r test.zip test.zarr
这里 test.zarr 是一个目录存储数据集,包括三组。但是,当我尝试使用上面的代码打开它时,得到如下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/eddie/miniconda3/envs/train/lib/python3.8/site-packages/zarr/storage.py", line 1445, in __init__
self.zf = zipfile.ZipFile(path, mode=mode, compression=compression,
File "/home/eddie/miniconda3/envs/train/lib/python3.8/zipfile.py", line 1190, in __init__
_check_compression(compression)
File "/home/eddie/miniconda3/envs/train/lib/python3.8/zipfile.py", line 686, in _check_compression
raise NotImplementedError("That compression method is not supported")
NotImplementedError: That compression method is not supported
不知道是不是我的压缩方式不对,有没有什么办法可以把目录存储转成zip存储或者其他的DB格式,导致群上来的时候,之前的存储节点太多,不方便传输。提前致谢。
Version and installation information
Value of zarr.__version__: 2.8.1
Value of numcodecs.__version__: 0.7.3
Version of Python interpreter: 3.8.0
Operating system (Linux/Windows/Mac): linux ubuntu 18.04
How Zarr was installed: pip