Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Aug 23, 2023
1 parent 1c050bd commit 92de6d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion python/examples/zarr_cupy_nvcomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def main(path):
# and we can write to is as usual
z[:] = numpy.arange(20, 40)

# Let's read the Zarr file back into a CuPy array
# Let's read the Zarr file back into a CuPy array. Notice, even though the metadata
# on disk is specifying NumCodecs's `lz4` CPU decompressor, `open_cupy_array` will
# use nvCOMP to decompress the files.
z = kvikio.zarr.open_cupy_array(store=path, mode="r")
assert isinstance(z[:], cupy.ndarray)
assert (cupy.arange(20, 40) == z[:]).all()
Expand Down
4 changes: 2 additions & 2 deletions python/kvikio/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import os.path
from abc import abstractmethod
from typing import Any, Literal, Mapping, Optional, Sequence
from typing import Any, Literal, Mapping, Optional, Sequence, Union

import cupy
import numcodecs
Expand Down Expand Up @@ -175,7 +175,7 @@ def getitems(


def open_cupy_array(
store: os.PathLike | str,
store: Union[os.PathLike, str],
mode: Literal["r", "r+", "a", "w", "w-"] = "a",
compressor: Codec = lz4_gpu_compressor,
meta_array=cupy.empty(()),
Expand Down

0 comments on commit 92de6d4

Please sign in to comment.