Skip to content

Commit 2ebcc17

Browse files
committed
better error string
1 parent e15f27e commit 2ebcc17

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/chunk_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl WithSubset {
109109
// This permits broadcasting of a constant input.
110110
if subset.num_elements() != chunk_subset.num_elements() && subset.num_elements() > 1 {
111111
return Err(PyErr::new::<PyIndexError, _>(format!(
112-
"subset {subset} and chunk subset {chunk_subset} differ in size",
112+
"the size of the chunk subset {chunk_subset} and input/output subset {subset} are incompatible",
113113
)));
114114
}
115115
Ok(Self {

tests/test_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_ellipsis_indexing_invalid(arr: zarr.Array):
218218
stored_value = np.array([1, 2, 3])
219219
expected_errors = (
220220
"references array indices.*out-of-bounds of array shape",
221-
"subset.*and chunk subset.*differ in size",
221+
"the size of the chunk subset.*and input/output subset.* are incompatible",
222222
)
223223
with pytest.raises(IndexError, match="|".join(expected_errors)):
224224
arr[2, ...] = stored_value

0 commit comments

Comments
 (0)