Skip to content

Commit ea08be0

Browse files
authored
Merge branch 'main' into feat/memory-store-registry
2 parents 9e2358c + ca53f8e commit ea08be0

14 files changed

Lines changed: 323 additions & 126 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default_language_version:
1111

1212
repos:
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.14
14+
rev: v0.15.4
1515
hooks:
1616
- id: ruff-check
1717
args: ["--fix", "--show-fixes"]
@@ -47,7 +47,7 @@ repos:
4747
- hypothesis
4848
- s3fs
4949
- repo: https://github.com/scientific-python/cookie
50-
rev: 2025.11.21
50+
rev: 2026.03.02
5151
hooks:
5252
- id: sp-repo-review
5353
- repo: https://github.com/pre-commit/pygrep-hooks

changes/3710.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a dedicated in-memory cache for byte-range requests to the experimental `CacheStore`.

src/zarr/_cli/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
from enum import Enum
2+
from enum import StrEnum
33
from typing import Annotated, Literal, cast
44

55
import typer
@@ -24,12 +24,12 @@ def _set_logging_level(*, verbose: bool) -> None:
2424
zarr.set_format("%(message)s")
2525

2626

27-
class CLIZarrFormat(str, Enum):
27+
class CLIZarrFormat(StrEnum):
2828
v2 = "v2"
2929
v3 = "v3"
3030

3131

32-
class CLIZarrFormatV3(str, Enum):
32+
class CLIZarrFormatV3(StrEnum):
3333
"""Limit CLI choice to only v3"""
3434

3535
v3 = "v3"

src/zarr/abc/store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
__all__ = ["ByteGetter", "ByteSetter", "Store", "set_or_delete"]
2020

2121

22-
@dataclass
22+
@dataclass(frozen=True, slots=True)
2323
class RangeByteRequest:
2424
"""Request a specific byte range"""
2525

@@ -29,15 +29,15 @@ class RangeByteRequest:
2929
"""The end of the byte range request (exclusive)."""
3030

3131

32-
@dataclass
32+
@dataclass(frozen=True, slots=True)
3333
class OffsetByteRequest:
3434
"""Request all bytes starting from a given byte offset"""
3535

3636
offset: int
3737
"""The byte offset for the offset range request."""
3838

3939

40-
@dataclass
40+
@dataclass(frozen=True, slots=True)
4141
class SuffixByteRequest:
4242
"""Request up to the last `n` bytes"""
4343

src/zarr/core/chunk_key_encodings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ChunkKeyEncoding(ABC, Metadata):
4242
@classmethod
4343
def from_dict(cls, data: dict[str, JSON]) -> Self:
4444
_, config_parsed = parse_named_configuration(data, require_configuration=False)
45-
return cls(**config_parsed if config_parsed else {})
45+
return cls(**config_parsed or {})
4646

4747
def to_dict(self) -> dict[str, JSON]:
4848
return {"name": self.name, "configuration": super().to_dict()}

src/zarr/core/dtype/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
"TBaseDType",
8282
"TBaseScalar",
8383
"TimeDelta64",
84-
"TimeDelta64",
8584
"TimeDelta64JSON_V2",
8685
"TimeDelta64JSON_V3",
8786
"UInt8",

src/zarr/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _iter_regions(
209209
# ((slice(0, 1, 1), slice(0, 2, 1)), (slice(1, 2, 1), slice(0, 2, 1)))
210210
```
211211
"""
212-
grid_shape = tuple(ceildiv(d, s) for d, s in zip(domain_shape, region_shape, strict=True))
212+
grid_shape = tuple(itertools.starmap(ceildiv, zip(domain_shape, region_shape, strict=True)))
213213
for grid_position in _iter_grid(
214214
grid_shape=grid_shape, origin=origin, selection_shape=selection_shape, order=order
215215
):

src/zarr/dtype.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"StructuredJSON_V2",
7373
"StructuredJSON_V3",
7474
"TimeDelta64",
75-
"TimeDelta64",
7675
"TimeDelta64JSON_V2",
7776
"TimeDelta64JSON_V3",
7877
"UInt8",
@@ -85,6 +84,5 @@
8584
"VariableLengthUTF8JSON_V2",
8685
"ZDType",
8786
"data_type_registry",
88-
"data_type_registry",
8987
"parse_dtype",
9088
]

0 commit comments

Comments
 (0)