Skip to content

Commit 4ab2698

Browse files
committed
rollback to simple version
1 parent 6e8f3da commit 4ab2698

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ async def save_array(
399399
if np.isscalar(arr):
400400
arr = np.array(arr)
401401
shape = arr.shape
402-
chunks = getattr(arr, "chunks", shape) # for array-likes with chunks attribute
402+
chunks = getattr(arr, "chunks", None) # for array-likes with chunks attribute
403403
new = await AsyncArray.create(
404404
store_path,
405405
zarr_format=zarr_format,

tests/test_group.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -447,37 +447,6 @@ def test_group_setitem(store: Store, zarr_format: ZarrFormat) -> None:
447447
assert group[key].shape == (3, 5)
448448
np.testing.assert_array_equal(group[key], arr)
449449

450-
# overwrite with a scalar
451-
# separate bug!
452-
# group["key"] = 1.5
453-
# assert group["key"].shape == ()
454-
# assert group["key"][:] == 1
455-
456-
457-
def test_group_arrays_setter(store: Store, zarr_format: ZarrFormat) -> None:
458-
"""
459-
Test the `Group.__setitem__` method.
460-
"""
461-
group = Group.from_store(store, zarr_format=zarr_format)
462-
arr = np.ones((2, 4))
463-
group.arrays["key"] = arr
464-
assert group["key"].shape == (2, 4)
465-
np.testing.assert_array_equal(group["key"][:], arr)
466-
467-
if store.supports_deletes:
468-
key = "key"
469-
else:
470-
# overwriting with another array requires deletes
471-
# for stores that don't support this, we just use a new key
472-
key = "key2"
473-
474-
# overwrite with another array
475-
arr = np.zeros((3, 5))
476-
with pytest.warns(DeprecationWarning):
477-
group[key] = arr
478-
assert group[key].shape == (3, 5)
479-
np.testing.assert_array_equal(group[key], arr)
480-
481450

482451
def test_group_contains(store: Store, zarr_format: ZarrFormat) -> None:
483452
"""

0 commit comments

Comments
 (0)