File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1085,18 +1085,25 @@ zarr <https://zarr.readthedocs.io/en/stable/user-guide/arrays.html#compressors>`
10851085These options can be passed to the ``to_zarr `` method as variable encoding.
10861086For example:
10871087
1088+ .. jupyter-execute ::
1089+
1090+ zarr_filename = "foo.zarr"
1091+
10881092.. jupyter-execute ::
10891093 :hide-code:
10901094
1091- ! rm -rf foo.zarr
1095+ import os.path
1096+ import tempfile
1097+ tempdir = tempfile.TemporaryDirectory()
1098+ zarr_filename = os.path.join(tempdir.name, zarr_filename)
10921099
10931100.. jupyter-execute ::
10941101
10951102 import zarr
10961103 from zarr.codecs import BloscCodec
10971104
10981105 compressor = BloscCodec(cname="zstd", clevel=3, shuffle="shuffle")
1099- ds.to_zarr("foo.zarr" , consolidated=False, encoding={"foo": {"compressors": [compressor]}})
1106+ ds.to_zarr(zarr_filename , consolidated=False, encoding={"foo": {"compressors": [compressor]}})
11001107
11011108.. note ::
11021109
You can’t perform that action at this time.
0 commit comments