Skip to content

Commit 21d9dc7

Browse files
normanrzjhamman
andauthored
Update src/zarr/core/buffer/cpu.py
Co-authored-by: Joe Hamman <[email protected]>
1 parent ee81166 commit 21d9dc7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/zarr/core/buffer/cpu.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ def create(
154154
order: Literal["C", "F"] = "C",
155155
fill_value: Any | None = None,
156156
) -> Self:
157-
ret = cls(np.zeros(shape=tuple(shape), dtype=dtype, order=order))
158-
if fill_value is not None:
159-
ret.fill(fill_value)
157+
ret = cls(np.full(shape=tuple(shape), fill_value=fill_value or 0, dtype=dtype, order=order))
160158
return ret
161159

162160
@classmethod

0 commit comments

Comments
 (0)