Skip to content

Commit ef6b919

Browse files
committed
better error message
1 parent 11c1345 commit ef6b919

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/zarr/core/array.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import json
4-
import warnings
54
from asyncio import gather
65
from dataclasses import dataclass, field
76
from itertools import starmap
@@ -1161,9 +1160,11 @@ async def append(self, data: npt.ArrayLike, axis: int = 0) -> ChunkCoords:
11611160
data_shape_preserved = tuple(s for i, s in enumerate(data.shape) if i != axis)
11621161
if self_shape_preserved != data_shape_preserved:
11631162
raise ValueError(
1164-
"shape of data to append is not compatible with the array; "
1165-
"all dimensions must match except for the dimension being "
1166-
"appended"
1163+
f"shape of data to append is not compatible with the array. "
1164+
f"The shape of the data is ({data_shape_preserved})"
1165+
f"and the shape of the array is ({self_shape_preserved})."
1166+
"All dimensions must match except for the dimension being "
1167+
"appended."
11671168
)
11681169
# remember old shape
11691170
old_shape = self.shape
@@ -1356,16 +1357,7 @@ def shape(self) -> ChunkCoords:
13561357

13571358
@shape.setter
13581359
def shape(self, value: ChunkCoords) -> None:
1359-
"""Sets the shape of the array by calling resize.
1360-
1361-
.. deprecated:: 3.0.0
1362-
Setting a shape using the shape setter is deprecated, use Array.resize instead.
1363-
"""
1364-
warnings.warn(
1365-
"Setting a shape using the shape setter is deprecated, use Array.resize instead.",
1366-
stacklevel=2,
1367-
category=DeprecationWarning,
1368-
)
1360+
"""Sets the shape of the array by calling resize."""
13691361
self.resize(value)
13701362

13711363
@property

0 commit comments

Comments
 (0)