Skip to content

Commit c4c1be0

Browse files
committed
fix: np.intp type
1 parent 894594c commit c4c1be0

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/awkward/_reducers.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,19 @@ def _dtype_for_kernel(cls, dtype: DTypeLike) -> DTypeLike:
6262
else:
6363
return dtype
6464

65-
_use32 = (ak._util.win or ak._util.bits32) and not ak._util.numpy2
65+
_use32 = (ak._util.win or ak._util.bits32) and not ak._util.numpy2 and np.intp is np.int32
6666

6767
@classmethod
6868
def _promote_integer_rank(cls, given_dtype: DTypeLike) -> DTypeLike:
6969
if given_dtype in (np.bool_, np.int8, np.int16, np.int32):
70-
# Typically, np.intp is used to represent the platform integer type
71-
return np.int32 if cls._use32 else np.dtype(np.intp).type
70+
return np.int32 if cls._use32 else np.int64
7271

7372
elif given_dtype in (np.uint8, np.uint16, np.uint32):
74-
return np.uint32 if cls._use32 else np.dtype(np.uintp).type
73+
return np.uint32 if cls._use32 else np.uint64
7574

7675
else:
7776
return given_dtype
7877

79-
def get_platform_integer_dtype():
80-
# Typically, np.intp is used to represent the platform integer type
81-
return np.dtype(np.intp)
82-
83-
8478

8579
def apply_positional_corrections(
8680
reduced: ak.contents.NumpyArray,

0 commit comments

Comments
 (0)