Skip to content

Commit f49c4e5

Browse files
committed
Add scalar tests
1 parent b90055b commit f49c4e5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/test_indexing.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,14 +815,24 @@ def test_set_orthogonal_selection_1d(store: StorePath) -> None:
815815
_test_set_orthogonal_selection(v, a, z, selection)
816816

817817

818-
def test_set_orthogonal_selection_1d_last_two_chunks():
818+
def test_set_item_1d_last_two_chunks():
819819
# regression test for GH2849
820820
g = zarr.open_group("foo.zarr", zarr_format=3, mode="w")
821821
a = g.create_array("bar", shape=(10,), chunks=(3,), dtype=int)
822822
data = np.array([7, 8, 9])
823823
a[slice(7, 10)] = data
824824
np.testing.assert_array_equal(a[slice(7, 10)], data)
825825

826+
z = zarr.open_group("foo.zarr", mode="w")
827+
z.create_array("zoo", dtype=float, shape=())
828+
z["zoo"][...] = np.array(1) # why doesn't [:] work?
829+
np.testing.assert_equal(z["zoo"][()], np.array(1))
830+
831+
z = zarr.open_group("foo.zarr", mode="w")
832+
z.create_array("zoo", dtype=float, shape=())
833+
z["zoo"][...] = 1 # why doesn't [:] work?
834+
np.testing.assert_equal(z["zoo"][()], np.array(1))
835+
826836

827837
def _test_set_orthogonal_selection_2d(
828838
v: npt.NDArray[np.int_],

0 commit comments

Comments
 (0)