From 511d055b1dfb32116c14954033b86115ffd0f1b1 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Wed, 1 Nov 2023 01:26:06 +0000 Subject: [PATCH] fix: drop itemsize --- src/awkward/_nplikes/array_module.py | 2 +- src/awkward/_nplikes/numpylike.py | 5 ----- src/awkward/_nplikes/placeholder.py | 4 ---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/awkward/_nplikes/array_module.py b/src/awkward/_nplikes/array_module.py index 242e35041b..8884b6b3df 100644 --- a/src/awkward/_nplikes/array_module.py +++ b/src/awkward/_nplikes/array_module.py @@ -436,7 +436,7 @@ def broadcast_to(self, x: ArrayLike, shape: tuple[ShapeItem, ...]) -> ArrayLike: def strides(self, x: ArrayLike) -> tuple[ShapeItem, ...]: if isinstance(x, PlaceholderArray): # Assume contiguous - strides: tuple[ShapeItem, ...] = (x.itemsize,) + strides: tuple[ShapeItem, ...] = (x.dtype.itemsize,) for item in x.shape[-1:0:-1]: strides = (item * strides[0], *strides) return strides diff --git a/src/awkward/_nplikes/numpylike.py b/src/awkward/_nplikes/numpylike.py index 1a54f90e55..e2eb846dca 100644 --- a/src/awkward/_nplikes/numpylike.py +++ b/src/awkward/_nplikes/numpylike.py @@ -41,11 +41,6 @@ def dtype(self) -> numpy.dtype: def ndim(self) -> int: ... - @property - @abstractmethod - def itemsize(self) -> int: - ... - @property @abstractmethod def shape(self) -> tuple[ShapeItem, ...]: diff --git a/src/awkward/_nplikes/placeholder.py b/src/awkward/_nplikes/placeholder.py index 4974c66d53..ea6ac07156 100644 --- a/src/awkward/_nplikes/placeholder.py +++ b/src/awkward/_nplikes/placeholder.py @@ -37,10 +37,6 @@ def size(self) -> ShapeItem: def nbytes(self) -> int: return 0 - @property - def itemsize(self) -> int: - return self._dtype.itemsize - @property def strides(self) -> tuple[ShapeItem, ...]: out: tuple[ShapeItem, ...] = (self._dtype.itemsize,)