Skip to content

Commit 378cbaf

Browse files
committed
use nbytes in array info construction
1 parent 9e8f351 commit 378cbaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zarr/core/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ def nbytes(self) -> int:
980980
The number of bytes that can be stored in the chunks of this array.
981981
"""
982982
# TODO: how can this be meaningful for variable-length types?
983-
return int(np.prod(self.shape) * self.dtype.itemsize)
983+
return self.size * self.dtype.itemsize
984984

985985
async def _get_selection(
986986
self,
@@ -1430,7 +1430,7 @@ def _info(
14301430
_order=self.order,
14311431
_read_only=self.read_only,
14321432
_store_type=type(self.store_path.store).__name__,
1433-
_count_bytes=self.dtype.itemsize * self.size,
1433+
_count_bytes=self.nbytes,
14341434
_count_bytes_stored=count_bytes_stored,
14351435
_count_chunks_initialized=count_chunks_initialized,
14361436
**kwargs,

0 commit comments

Comments
 (0)