Skip to content

Commit 07b5645

Browse files
Merge main
2 parents 3230892 + af55fcf commit 07b5645

File tree

11 files changed

+27
-21
lines changed

11 files changed

+27
-21
lines changed

.github/workflows/gpu_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
python-version: ['3.11']
28-
numpy-version: ['2.1']
28+
numpy-version: ['2.2']
2929
dependency-set: ["minimal"]
3030

3131
steps:

.github/workflows/hypothesis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
python-version: ['3.11']
29-
numpy-version: ['2.1']
29+
numpy-version: ['2.2']
3030
dependency-set: ["optional"]
3131

3232
steps:

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
python-version: ['3.11', '3.12', '3.13']
24-
numpy-version: ['1.25', '2.1']
24+
numpy-version: ['1.25', '2.2']
2525
dependency-set: ["minimal", "optional"]
2626
os: ["ubuntu-latest"]
2727
include:
@@ -30,15 +30,15 @@ jobs:
3030
dependency-set: 'optional'
3131
os: 'macos-latest'
3232
- python-version: '3.13'
33-
numpy-version: '2.1'
33+
numpy-version: '2.2'
3434
dependency-set: 'optional'
3535
os: 'macos-latest'
3636
- python-version: '3.11'
3737
numpy-version: '1.25'
3838
dependency-set: 'optional'
3939
os: 'windows-latest'
4040
- python-version: '3.13'
41-
numpy-version: '2.1'
41+
numpy-version: '2.2'
4242
dependency-set: 'optional'
4343
os: 'windows-latest'
4444
runs-on: ${{ matrix.os }}

changes/3066.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `~zarr.errors.GroupNotFoundError`, which is raised when attempting to open a group that does not exist.

changes/3100.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For Zarr format 2, allow fixed-length string arrays to be created without automatically inserting a
2+
``Vlen-UT8`` codec in the array of filters. Fixed-length string arrays do not need this codec. This
3+
change fixes a regression where fixed-length string arrays created with Zarr Python 3 could not be read with Zarr Python 2.18.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ features = ["test"]
149149

150150
[[tool.hatch.envs.test.matrix]]
151151
python = ["3.11", "3.12", "3.13"]
152-
numpy = ["1.25", "2.1"]
152+
numpy = ["1.25", "2.2"]
153153
deps = ["minimal", "optional"]
154154

155155
[tool.hatch.envs.test.overrides]
@@ -185,7 +185,7 @@ features = ["test", "gpu"]
185185

186186
[[tool.hatch.envs.gputest.matrix]]
187187
python = ["3.11", "3.12", "3.13"]
188-
numpy = ["1.25", "2.1"]
188+
numpy = ["1.25", "2.2"]
189189
version = ["minimal"]
190190

191191
[tool.hatch.envs.gputest.scripts]

src/zarr/api/asynchronous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
)
4040
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
4141
from zarr.core.metadata.v2 import _default_compressor, _default_filters
42-
from zarr.errors import NodeTypeValidationError
42+
from zarr.errors import GroupNotFoundError, NodeTypeValidationError
4343
from zarr.storage._common import make_store_path
4444

4545
if TYPE_CHECKING:
@@ -836,7 +836,7 @@ async def open_group(
836836
overwrite=overwrite,
837837
attributes=attributes,
838838
)
839-
raise FileNotFoundError(f"Unable to find group: {store_path}")
839+
raise GroupNotFoundError(store, store_path.path)
840840

841841

842842
async def create(

src/zarr/core/array.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,6 @@ def _create_metadata_v2(
768768

769769
dtype = parse_dtype(dtype, zarr_format=2)
770770

771-
# inject VLenUTF8 for str dtype if not already present
772-
if np.issubdtype(dtype, np.str_):
773-
filters = filters or []
774-
from numcodecs.vlen import VLenUTF8
775-
776-
if not any(isinstance(x, VLenUTF8) or x["id"] == "vlen-utf8" for x in filters):
777-
filters = list(filters) + [VLenUTF8()]
778-
779771
return ArrayV2Metadata(
780772
shape=shape,
781773
dtype=np.dtype(dtype),

src/zarr/errors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def __init__(self, *args: Any) -> None:
2121
super().__init__(self._msg.format(*args))
2222

2323

24+
class GroupNotFoundError(BaseZarrError, FileNotFoundError):
25+
"""
26+
Raised when a group isn't found at a certain path.
27+
"""
28+
29+
_msg = "No group found in store {!r} at path {!r}"
30+
31+
2432
class ContainsGroupError(BaseZarrError):
2533
"""Raised when a group already exists at a certain path."""
2634

tests/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ async def test_invalid_v3_arguments(
12461246
zarr.create(store=store, dtype="uint8", shape=(10,), zarr_format=3, **kwargs)
12471247

12481248
@staticmethod
1249-
@pytest.mark.parametrize("dtype", ["uint8", "float32", "str"])
1249+
@pytest.mark.parametrize("dtype", ["uint8", "float32", "str", "U10", "S10", ">M8[10s]"])
12501250
@pytest.mark.parametrize(
12511251
"compressors",
12521252
[

0 commit comments

Comments
 (0)