Skip to content

Commit 1dd8c3d

Browse files
authored
Fix compatibility with i386 architectures (#94)
1 parent 6c499ff commit 1dd8c3d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

numpy_groupies/utils.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Common functionality for all aggregate implementations."""
22

3+
import platform
34
import numpy as np
45

56
aggregate_common_doc = """
@@ -258,6 +259,22 @@ def minimum_dtype_scalar(x, dtype, a):
258259
"nanargmin": np.int64,
259260
"nanargmax": np.int64,
260261
}
262+
if platform.architecture()[0] == "32bit":
263+
_forced_types = {
264+
"array": object,
265+
"all": bool,
266+
"any": bool,
267+
"nanall": bool,
268+
"nanany": bool,
269+
"len": np.int32,
270+
"nanlen": np.int32,
271+
"allnan": bool,
272+
"anynan": bool,
273+
"argmax": np.int32,
274+
"argmin": np.int32,
275+
"nanargmin": np.int32,
276+
"nanargmax": np.int32,
277+
}
261278
_forced_float_types = {"mean", "var", "std", "nanmean", "nanvar", "nanstd"}
262279
_forced_same_type = {
263280
"min",

0 commit comments

Comments
 (0)