Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions cubed/core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from warnings import warn

import numpy as np
import zarr
from tlz import first, partition

from cubed import config
Expand Down Expand Up @@ -684,16 +683,11 @@ def elemwise(func, *args: "Array", dtype=None) -> "Array":


def _create_zarr_indexer(selection, shape, chunks):
if zarr.__version__[0] == "3":
from zarr.core.chunk_grids import ChunkGrid
from zarr.core.indexing import OrthogonalIndexer
from zarr.core.chunk_grids import ChunkGrid
from zarr.core.indexing import OrthogonalIndexer

chunk_grid = ChunkGrid.from_sizes(array_shape=shape, chunk_sizes=chunks)
return OrthogonalIndexer(selection, shape, chunk_grid)
else:
from zarr.indexing import OrthogonalIndexer

return OrthogonalIndexer(selection, ZarrArrayIndexingAdaptor(shape, chunks))
chunk_grid = ChunkGrid.from_sizes(array_shape=shape, chunk_sizes=chunks)
return OrthogonalIndexer(selection, shape, chunk_grid)


@dataclass
Expand Down
Loading