Skip to content

Commit 9ddbe97

Browse files
committed
Merge branch 'main' of github.com:zarr-developers/zarr-python into feat/fixed-length-strings
2 parents 5150d60 + af55fcf commit 9ddbe97

File tree

10 files changed

+27
-13
lines changed

10 files changed

+27
-13
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
create_hierarchy,
4040
)
4141
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
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/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
@@ -1258,7 +1258,7 @@ async def test_invalid_v3_arguments(
12581258
zarr.create(store=store, dtype="uint8", shape=(10,), zarr_format=3, **kwargs)
12591259

12601260
@staticmethod
1261-
@pytest.mark.parametrize("dtype", ["uint8", "float32"])
1261+
@pytest.mark.parametrize("dtype", ["uint8", "float32", "str", "U10", "S10", ">M8[10s]"])
12621262
@pytest.mark.parametrize(
12631263
"compressors",
12641264
[

tests/test_metadata/test_v3.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
parse_dimension_names,
2121
parse_zarr_format,
2222
)
23-
from zarr.errors import MetadataValidationError
23+
from zarr.errors import MetadataValidationError, NodeTypeValidationError
2424

2525
if TYPE_CHECKING:
2626
from collections.abc import Sequence
@@ -73,7 +73,8 @@
7373
@pytest.mark.parametrize("data", [None, 1, 2, 4, 5, "3"])
7474
def test_parse_zarr_format_invalid(data: Any) -> None:
7575
with pytest.raises(
76-
ValueError, match=f"Invalid value for 'zarr_format'. Expected '3'. Got '{data}'."
76+
MetadataValidationError,
77+
match=f"Invalid value for 'zarr_format'. Expected '3'. Got '{data}'.",
7778
):
7879
parse_zarr_format(data)
7980

@@ -99,7 +100,8 @@ def test_parse_node_type_invalid(node_type: Any) -> None:
99100
@pytest.mark.parametrize("data", [None, "group"])
100101
def test_parse_node_type_array_invalid(data: Any) -> None:
101102
with pytest.raises(
102-
ValueError, match=f"Invalid value for 'node_type'. Expected 'array'. Got '{data}'."
103+
NodeTypeValidationError,
104+
match=f"Invalid value for 'node_type'. Expected 'array'. Got '{data}'.",
103105
):
104106
parse_node_type_array(data)
105107

0 commit comments

Comments
 (0)