Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
'donfig',
'pytest',
'universal_pathlib>=0.2.0',
"zarr>=3.0.3,<3.1",
"zarr @ git+https://github.com/zarr-developers/zarr-python",
]

[project.optional-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions python/zarrs/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from zarr.core.chunk_grids import ChunkGrid
from zarr.core.common import ChunkCoords
from zarr.core.indexing import SelectorTuple
from zarr.dtype import ZDType

from ._internal import CodecPipelineImpl, codec_metadata_v2_to_v3
from .utils import (
Expand Down Expand Up @@ -134,7 +135,7 @@ def __iter__(self) -> Iterator[Codec]:
yield from self.codecs

def validate(
self, *, shape: ChunkCoords, dtype: np.dtype[Any], chunk_grid: ChunkGrid
self, *, shape: ChunkCoords, dtype: ZDType, chunk_grid: ChunkGrid
) -> None:
raise NotImplementedError("validate")

Expand Down Expand Up @@ -236,7 +237,7 @@ def _raise_error_on_unsupported_batch_dtype(
# https://github.com/LDeakin/zarrs/blob/0532fe983b7b42b59dbf84e50a2fe5e6f7bad4ce/zarrs_metadata/src/v2_to_v3.rs#L289-L293 for VSUMm
# Further, our pipeline does not support variable-length objects due to limitations on decode_into, so object/np.dtypes.StringDType is also out
if any(
info.dtype.kind in {"V", "S", "U", "M", "m", "O", "T"}
info.dtype.to_native_dtype().kind in {"V", "S", "U", "M", "m", "O", "T"}
for (_, info, _, _, _) in batch_info
):
raise UnsupportedDataTypeError()
6 changes: 3 additions & 3 deletions python/zarrs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy as np
from zarr.core.array_spec import ArraySpec
from zarr.core.indexing import SelectorTuple, is_integer
from zarr.core.metadata.v2 import _default_fill_value

from zarrs._internal import Basic, WithSubset

Expand All @@ -17,6 +16,7 @@
from types import EllipsisType

from zarr.abc.store import ByteGetter, ByteSetter
from zarr.dtype import ZDType


# adapted from https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
Expand Down Expand Up @@ -139,9 +139,9 @@ def get_shape_for_selector(
return resulting_shape_from_index(shape, selector_tuple, drop_axes, pad=pad)


def get_implicit_fill_value(dtype: np.dtype, fill_value: Any) -> Any:
def get_implicit_fill_value(dtype: ZDType, fill_value: Any) -> Any:
if fill_value is None:
fill_value = _default_fill_value(dtype)
fill_value = dtype.default_scalar()
return fill_value


Expand Down
1 change: 1 addition & 0 deletions src/chunk_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ impl Basic {
let chunk_shape = chunk_spec.getattr("shape")?.extract()?;
let mut dtype: String = chunk_spec
.getattr("dtype")?
.call_method0("to_native_dtype")?
.call_method0("__str__")?
.extract()?;
if dtype == "object" {
Expand Down
Loading
Loading