Skip to content

Commit a2bc655

Browse files
committed
remove off-target changes
1 parent 31c95ca commit a2bc655

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/zarr/core/array_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def from_dict(cls, data: ArrayConfigParams) -> Self:
6363
"""
6464
kwargs_out: ArrayConfigParams = {}
6565
for f in fields(ArrayConfig):
66-
field_name = cast(Literal["order", "write_empty_chunks"], f.name)
66+
field_name = cast("Literal['order', 'write_empty_chunks']", f.name)
6767
if field_name not in data:
6868
kwargs_out[field_name] = zarr_config.get(f"array.{field_name}")
6969
else:

src/zarr/core/buffer/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def as_scalar(self) -> ScalarType:
475475
"""Returns the buffer as a scalar value"""
476476
if self._data.size != 1:
477477
raise ValueError("Buffer does not contain a single scalar value")
478-
return cast(ScalarType, self.as_numpy_array()[()])
478+
return cast("ScalarType", self.as_numpy_array()[()])
479479

480480
@property
481481
def dtype(self) -> np.dtype[Any]:

src/zarr/core/chunk_grids.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def _guess_chunks(
6363
"""
6464
if isinstance(shape, int):
6565
shape = (shape,)
66-
typesize = max(typesize, 1)
66+
67+
if typesize == 0:
68+
return shape
69+
6770
ndims = len(shape)
6871
# require chunks to have non-zero length for all dimensions
6972
chunks = np.maximum(np.array(shape, dtype="=f8"), 1)

0 commit comments

Comments
 (0)