Skip to content

Commit 014f19b

Browse files
committed
test_sharding_with_empty_inner_chunk
1 parent 23cf523 commit 014f19b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_v3.py

+29
Original file line numberDiff line numberDiff line change
@@ -1082,3 +1082,32 @@ def test_update_attributes_group(store: Store):
10821082

10831083
g = Group.open(store / "update_attributes_group")
10841084
assert g.metadata.attributes["hello"] == "zarrita"
1085+
1086+
1087+
@pytest.mark.parametrize(
1088+
"index_location", [ShardingCodecIndexLocation.start, ShardingCodecIndexLocation.end]
1089+
)
1090+
def test_sharding_with_empty_inner_chunk(store: Store, index_location):
1091+
data = np.arange(0, 16 * 16, dtype="uint16").reshape((16, 16))
1092+
fill_value = 1
1093+
data[:4, :4] = fill_value
1094+
1095+
a = Array.create(
1096+
store / "sharding_with_empty_inner_chunk",
1097+
shape=(16, 16),
1098+
chunk_shape=(8, 8),
1099+
dtype=data.dtype,
1100+
fill_value=fill_value,
1101+
codecs=[
1102+
codecs.sharding_codec(
1103+
chunk_shape=(4, 4),
1104+
codecs=[
1105+
codecs.bytes_codec(),
1106+
codecs.blosc_codec(typesize=data.dtype.itemsize),
1107+
],
1108+
index_location=index_location,
1109+
)
1110+
],
1111+
)
1112+
a[:] = data
1113+
assert np.array_equal(a[:], data)

0 commit comments

Comments
 (0)